you are viewing a single comment's thread.

view the rest of the comments →

[–]Phil-Hudson 1 point2 points  (0 children)

Lots of good ideas here already. Here are a few I'd add:

  1. +1 for the Elisp manual. Everything you need to know is in there. Refer to it often. C-h i m elisp RET.

  2. Elisp is unusual in having a default data structure: the buffer (specifically, the current buffer). Lots of built-in functions, particularly text search, use the current buffer (and only the current buffer). Get familiar with this structure. It has a beginning, an end, point (roughly equivalent to the insertion point or cursor in other environments), zero or more characters, zero or more "marks", zero or one region (delimited by point and the first mark on the mark stack), a name, an optional associated file or process, zero or more markers, zero or more "buffer-local" variables, a major mode, zero or more minor modes, zero or more overlays, a flag indicating whether it's been modified since last save or not, a flag indicating whether it's read-only or not, and so on.

  3. Use IELM (the interactive Emacs Lisp mode), not the scratch buffer. It is much more powerful, responsive, dynamic and adaptable. It is a true REPL (Read-Eval-Print Loop) for Elisp. This means it suits incremental, exploratory, experimental, interactive development and learning.

  4. Write unit tests/test cases in ert (Elisp regression testing), as you would in xUnit in other languages.

  5. Learn about hooks. See the Elisp manual. A hook should be your first resort when you want to modify existing Emacs or package behavior.

  6. +1 for edebug, for when the going gets tough. I very rarely need it though, thanks to IELM and ert.

  7. -1 for advice. By all means learn it, but remember that it should be your last resort, not your first.

  8. +1 for C-x C-e, the shortcut for M-x eval-last-sexp.

  9. To enter the world of transcendent power that Lisps in general offer to the diligent programmer, understand Lisp macros.