Live data from Hacker News

Learn Emacs Lisp in 15 minutes

bzg.fr

21–30 of 71 posts

Re: Learn Emacs Lisp in 15 minutes

#21
post #17

Earlier quoted context omitted.

emacs is the editor of sore wrists.

Q: How do you recognize experienced Emacs user? A: Foot pedals. http://bc.tech.coop/blog/041024.html http://www.cb1.com/~john/computing/emacs/handsfree/pedals.ht...

After a decade of Emacs, I never had wrist problems, but I did end up developing pinky problems, due to remapping Ctrl to Caps Lock.

I tried foot pedals (and still have them under my desk). They were better than nothing, but after I switched to the Kinesis Advantage keyboard I ended up not using them anymore. Hitting Ctrl+Alt with your thumbs is more convenient than hitting them with your feet, especially since I tend to fidget a lot. Another advantage (no pun intended) is that the arrow keys are convenient to hit, which lets you remap several standard Emacs keybindings. For example, I use C-b to switch buffers.

Neither switching keyboards nor using foot pedals solved my hand pain, however. I ended up having to take more drastic measures: I switched to the carpalx QGMLWB keyboard layout[1]. One of the advantages of the carpalx approach is the clear and powerful mathematical model which quantifies the effectiveness of keyboard layouts. I was able to select a layout that minimizes pinky strain--if I had switched to Dvorak or Colemak, I would have increased my pinky strain.

[1]: http://mkweb.bcgsc.ca/carpalx/?full_optimization

Re: Learn Emacs Lisp in 15 minutes

#22

Earlier quoted context omitted.

Q: How do you recognize experienced Emacs user? A: Foot pedals. http://bc.tech.coop/blog/041024.html http://www.cb1.com/~john/computing/emacs/handsfree/pedals.ht...

After a decade of Emacs, I never had wrist problems, but I did end up developing pinky problems, due to remapping Ctrl to Caps Lock. I tried foot pedals (and still have them under my desk). They were better than nothing, but after I switched to the Kinesis Advantage keyboard I ended up not using them anymore. Hitting Ctrl+Alt with your thumbs is more convenient than hitting them with your feet, especially since I ten…

>A: Foot pedals.

That's hilarious.

I get that emacs has technical merit but the keybindings are horrendous. Even if they don't cause hand pain they're long-winded and distracting.

Re: Learn Emacs Lisp in 15 minutes

#24

Earlier quoted context omitted.

Well, the problem is that these bindings don't usually implement the corner case Vim functionality I've come to rely on over the years. Can it record macros perfectly? Does :%s/foo/bar/ work? How about selecting, then :s/foo/bar/gi? Does the period key reproduce all actions properly? How about :%s/foo\([0-9]+\)/bar\1/ ? Do all of the basic actions do exactly the same thing as they do in a vim editor? Does % take you…

It actually works similar enough that I switch between Vim and Evil daily without getting annoyed. I usually use Vim from the terminal. The follow things you asked about are all working: Macros Repeat :' s/foo/bar/gi :%s/foo\(bar\)/bar\1/ It is very actively developed and quite stable. There are of cause Vim features that are not implemented yet, but the core seams to be very well covered.

Interesting, maybe I'll give it a try. Do you feel any kind of impedance mismatch from using emacs w/o the native emacs bindings?

Re: Learn Emacs Lisp in 15 minutes

#25
post #22

Earlier quoted context omitted.

After a decade of Emacs, I never had wrist problems, but I did end up developing pinky problems, due to remapping Ctrl to Caps Lock. I tried foot pedals (and still have them under my desk). They were better than nothing, but after I switched to the Kinesis Advantage keyboard I ended up not using them anymore. Hitting Ctrl+Alt with your thumbs is more convenient than hitting them with your feet, especially since I ten…

>A: Foot pedals. That's hilarious. I get that emacs has technical merit but the keybindings are horrendous. Even if they don't cause hand pain they're long-winded and distracting.

If you are emacs user, that's not a problem. You just change them to whatever you want. Besides, food pedals is not so crazy ideal. Any time you must do something meta- or control with any software, you end up doing movements that are not so natural.

Re: Learn Emacs Lisp in 15 minutes

#27

Earlier quoted context omitted.

Q: How do you recognize experienced Emacs user? A: Foot pedals. http://bc.tech.coop/blog/041024.html http://www.cb1.com/~john/computing/emacs/handsfree/pedals.ht...

After a decade of Emacs, I never had wrist problems, but I did end up developing pinky problems, due to remapping Ctrl to Caps Lock. I tried foot pedals (and still have them under my desk). They were better than nothing, but after I switched to the Kinesis Advantage keyboard I ended up not using them anymore. Hitting Ctrl+Alt with your thumbs is more convenient than hitting them with your feet, especially since I ten…

I use my thumbs for control and alt on a regular (scissor type) keyboard. I remap alt to control and super to alt and have had no problem since I switched, about 4 or 5 years ago.

Re: Learn Emacs Lisp in 15 minutes

#28
1. Every book on computers, or anything technical should read this guys blog before they get fire up the word processor.

2. My biggest gripe about 99.9% of COmputer programming books are: They are long. They are poorly written. They read like a telephone books.

3. I once heard one famous programmer state, I won't read a programming book with more than 500 pages. I think he was off by 400 pages?

4. I truly believe if you take 80% of words out of most books; it would make learning a subject easier.

Re: Learn Emacs Lisp in 15 minutes

#29
post #22

Earlier quoted context omitted.

>A: Foot pedals. That's hilarious. I get that emacs has technical merit but the keybindings are horrendous. Even if they don't cause hand pain they're long-winded and distracting.

If you are emacs user, that's not a problem. You just change them to whatever you want. Besides, food pedals is not so crazy ideal. Any time you must do something meta- or control with any software, you end up doing movements that are not so natural.

I've been considering giving EVIL a try. I feel that non-standard bindings would be a pain to deal with.

Re: Learn Emacs Lisp in 15 minutes

#30
post #4

That was actually quite helpful. I've had the toughest time "thinking in Lisp" as I'm told I have to do to get my head around it (also because I work with the C++/C#/PHP family and switching between them and Lisp doesn't help). I really appreciate the simple instructions in that regard.

I'm not a professional programmer, but I spend all day in Emacs primarily because of org-mode. Two years ago I read about org-mode here on HN and was inspired to give Emacs a shot. Today Emacs is my main technical hobby. Extending Emacs with Elisp is a pleasure and a joy. My various init files total over 3,000 lines of code that I wrote my own little self.

That said, while I remain incredibly impressed with the integrated documentation system, especially the Info manuals for their sheer literacy and clarity, I discovered over time that it doesn't adequately teach you "the Lisp way." Explanations of the basic concepts -- like a symbol for crying out loud -- are scattered and not really complete, leading to frustration as I got deeper into extending Emacs.

For me, the light bulb went off after I worked through Seibel's Practical Common Lisp. I've also read chunks of PG's On Lisp. Together these two outstanding books resulted in an epiphany regarding Lisp and the functional approach in general.

The result is that, where before I couldn't figure out Emacs's own Elisp sources (i.e., "Why is this function written this way, and not that way? Why do I see this idiom so often, what's it doing?"), now I can. The payoff for writing my own Elisp has been incalculable. Now I'm fired up to read SICP, and Felleisen et al, hoping to learn more about functional programming.

Post reply on HN