Tag Archives: elisp

why learn elisp (Emacs Lisp)

This post is the intro module of Living with Emacs Lisp. The goal of this post is to hopefully convince you why you should learn elisp. Readers are assumed to be beginning users of Emacs. (Of course he who does … Continue reading

Posted in Emacs | Tagged | 2 Comments

It is not hard to edit Lisp code

Table of Contents 1. Intro 2. Which editor or IDE to use 3. The three phases 4. Always indent. 5. Evaluate! 6. One liners 7. Breaking lines 8. Joining lines 9. Placement of close parens 10. The “No red tape” … Continue reading

Posted in Emacs, Lisp | Tagged | 2 Comments

It is not hard to read Lisp code

Table of Contents 1. Intro 2. Tree view 3. Terminology 3.1. Emacs Lisp note 3.2. Common Lisp note 4. Variations 5. How to find where the expression ends. 6. Some difference from Python 7. Tools 8. Logical operators being used … Continue reading

Posted in Emacs, Lisp | Tagged , | 4 Comments

Checking Windows version with Emacs Lisp

elisp code example for programmatically checking the version of Microsoft Windows on which Emacs is running: (when (eq system-type ‘windows-nt) (print “Hello, MS Windows.”) (let ((winversion (when (string-match (rx “nt” (group (+ digit)) “.” (group (+ digit)) “.” (+ digit) … Continue reading

Posted in Emacs, Lisp | Tagged , | Leave a comment

threading macros from dash for Emacs Lisp

Table of Contents 1. what are threading macros? where do they come from? 2. how to use the dash library 3. thread-first nesting and the thread-first macro 4. example uses of the thread-first macro 5. side note on fear of … Continue reading

Posted in Emacs, Lisp | Tagged , | 1 Comment

question mark and Emacs Lisp

Table of Contents 1. motivation 2. short answer 3. some background 4. escaping question marks in symbol names 5. what happens if I don’t escape question marks that are first letters? 6. what about rx forms? 7. Common Lisp note … Continue reading

Posted in Emacs | Tagged | Leave a comment

Emacs Lisp lexical binding gotchas and related best practices

Table of Contents 1. motivation 2. non-local variables and closures 3. gotchas and best practices 3.1. code as data 3.2. invasion of special variable 3.3. – – – 3.4. mixing iteration, closures, and asynchronous programming together 4. testing tools 4.1. … Continue reading

Posted in Emacs, Lisp | Tagged , , , | Leave a comment