Table of Contents
“Don’t just learn Excel, learn VBA.” – darrensharperholdmah
1. Why you should learn Elisp (i.e. Emacs Lisp)
Maybe you don’t have to learn Emacs Lisp right now. You may find that keyboard macros, the Customize facility and Emacs packages help you do most of what you want for now, but there will come a day when you want more.
Some story about Alice. Alice is an amateur programmer who loves Python, but has no experience with Lisp at all. One day, Alice meets a talking rabbit. The rabbit introduces her to Emacs. Alice starts using Emacs for her Python coding. She is even taking notes in Emacs using org-mode. All is well until gradually Alice starts noticing more and more things she doesn’t quite like about her current Emacs/org-mode setup and things that her Emacs configuration doesn’t provide for now. Those things can be divided into three categories:
- things that Alice cannot change or implement (even after learning elisp); only the Emacs dev team or the org-mode dev team can.
- things that Alice could implement by writing more than a few lines of Emacs Lisp code, if she knew elisp.
- things that Alice can change by writing just a few lines of Emacs Lisp code or/and by installing a package.
Alice starts to notice more and more things in the second category, but she is not sure if she is capable of writing a huge amount of Emacs Lisp code, because Emacs Lisp is unlike other languages that she is comfortable with. Emacs Lisp is too different, says Alice. Time has come for Alice to let go of her fear of Lisp. Truth is, anyone who can learn Python is capable of learning Emacs Lisp.
The “Living with Emacs Lisp” series is a collection of articles to help those feeling the same as Alice, to help them become comfortable with Emacs Lisp. Also see Living with Emacs.
2. Living with Emacs Lisp
Here is the list of all articles/topics in “Living with Emacs Lisp” (some of them not written yet):
- How to read Lisp code
- How to edit Lisp code in Emacs or without Emacs
- On reference semantics and call by sharing
- Lisp lists and gotchas
- dash.el threading macros (including some notes on why one should not fear deeply nested forms)
- Global variables and special variables
- (needs a shorter article, but for now see lexical scoping and dynamic scoping in Emacs Lisp)
- Elisp lexical binding gotchas and related best practices
- emulating static variables in elisp
- Local variables
- pointers and references: double pointers and Lisp lists
- When to quote
- Catch and throw
- Exception handling
- CL and CL-LIB: Differences between Common Lisp and Emacs Lisp
- Font lock
There will be at least one new article in the series per month. There is no feed you can subscribe to just for “Living with Emacs Lisp” updates, but you can subscribe to the feed for new posts on Emacs and the feed for posts on Lisp which will likely cover all posts in Living with Emacs Lisp.
some helpful external links that may help you:
- Learn #Emacs Lisp in 15 minutes
- Lisp: Common Lisp, Racket, Clojure, Emacs Lisp – Hyperpolyglot : listing of Emacs Lisp syntax. (To delete the columns you don’t care from the table, use ActiveTable bookmarklet.)
- Magnar Sveen’s dash.el (utility functions) and s.el (string manipulation): even if you don’t want to use these libraries, reading the source code may help you learn how to do certain tasks in Emacs Lisp.
- Which Chapters of Elisp manual to read first
- Elisp Cookbook (collection of how to do things in elisp)