Category Archives: Emacs Chat

2015-04-08 Emacs Lisp Development Tips with John Wiegley

You can find John Wiegley on Twitter (@jwiegley) or at

0:00:00 Paredit mode. Start with it from day 1! Matching pairs of parentheses, won’t let you delete one without the other. Inserts appropriate newlines, too
0:03:56 Emacs as a Lisp environment. (Also, Helm is what’s responsible for the display.) Evaluating a function makes it available in the global scope, which has all these functions and commands you can do. This makes it easy to iteratively develop your functions, because you can just execute things directly.
0:05:08 Without (interactive), you can’t call functions with M-x. You can use M-: or put the call in your scratch buffer.
0:06:00 command-log-mode
0:06:47 pp-eval-last-sexp. Check out for other config things
0:07:14 debugging. e to evaluate within the current context. Also, stepping, quit.
0:08:09 Edebug with C-u C-M-x. Interactive debugging. SPC moves you forward, one Lisp form at a time. It shows you results in the minibuffer. You can descend into Lisp forms or go into functions. ? shows keybindings. Check out the Emacs Lisp chapter on EDebug, highly recommendeg.
0:09:25 You can also use the (debug) form to go to the debugger.
0:10:26 eldoc: Seeing arguments in the minibuffer as you type, because no one remembers all the arguments anyway. eldoc-mode, or add (turn-on-eldoc-mode) to your config.
0:11:30 What functions should you call in the first place? What concepts? Emacs predates many standard terms, so that’s why things are a little confusing. Ex: “frames” and “windows” are not what you might think they are. OS window = frame. Area within Emacs = window. Opposite of HTML. Use the Emacs tutorial C-h t.
0:13:04 Read the Emacs Lisp intro, which you can get to with C-h i (which lists the manuals that are available). Read the Emacs Lisp manual too.
0:14:03 Other weird terms: point, mark, marker. (point) vs (point-marker).
0:15:35 C-h f (describe-function) shows the help for the function. Nearly all functions you’ll probably call are documented well. Lots of options. Check out C-h f for interactive, for example.
0:17:17 C-h v (describe-variable).
0:17:46 More in-depth documentation: C-h i, go to the Emacs Lisp manual, then use i to view the index.
0:18:22 info-lookmore shows you the Info documentation for the symbol under point. Works for other Lisps too (ex: Common Lisp)
0:19:46 Sanity-checking paired parentheses with M-x check-parens. Handy for adding to your after-save-hook in Emacs Lisp mode.
0:20:40 Paredit editing capabilities. Ex: C-k kills the current sexp. paredit-raise-sexp replaces the parent sexp with the following sexp. slurping and barfing. Barfing – spitting out an element from the list form. C-{ or C-} (with suggested keybindings). C-( and C-) are slurping, which pulls forms in. Works for strings, too.
0:22:38 Maximum barfage and slurpage. Useful for slurping everything in, for example. paredit-slurp-all-the-way-forward.
0:24:13 redshank (companion to paredit) for refactoring. Ex: redshank-condify-form converts an if to a cond for when you realize you’ve got more than two conditions.
0:25:05 M-1 M-( surround the next one thing with parens
0:25:25 redshank: wrap a let, change if to a when, etc.
0:25:52 C-h k (describe-key) shows what a keyboard shortcut or menu item will do.
0:27:26 Took a while to get used to paredit, but you eventually get into the zen of paredit.
0:27:54 Linter – M-x elint-current-buffer. Loads every module that your code depends on (so the first time is slow), and then shows you style notes.
0:28:50 C-q for manually inserting parentheses
0:29:10 Helm, which shows you all the other stuff that matches your query. Lets you select by regex, multiple patterns, etc. Much nicer and more interactive.
0:30:29 Profiler M-x elp-instrument-function, then call the function, then elp-results will show you the time it took to execute. Results aggregate, and are reset when you call elp-results.
0:32:30 Measuring memory consumption. Also, internal representation of lists. reverse vs. nreverse. Like nconc, nreverse, setcar, setcdr. This can greatly speed up your code, if you can avoid using the garbage collector. EmacsWiki – memory-use-counts, but not particularly helpful? Another package that extends the Emacs Lisp profiler? Avoid premature optimization.
0:38:55 elint and flycheck? flycheck’s designed for external processes, so that might be a challenge. Possibility: use async to spawn another Emacs? Doesn’t seem to be available yet.
0:40:40 ert
0:48:11 testcover,, undercover.el
0:48:13 Read Emacs Lisp manual, etc.
0:48:20 Creating a mode. You don’t have to make it from scartch – start by copying someone else, and then strip away everything you don’t want.
0:49:58 checkdoc – checks the style of your documentation strings.
0:51:30 defining a minor mode
0:56:08 when to define a major mode – structure of your buffer

Emacs Chat with Steve Purcell

In this Emacs Chat, Steve Purcell shares how he got started with Emacs by using a Vim emulation mode, what it’s like to give hundreds of package authors feedback on Emacs Lisp style, and how he’s eventually replacing himself with Emacs Lisp (flycheck-package). He also highlights useful packages for managing buffers of version-controlled files (ibuffer-vc), working with lines if the region isn’t active (whole-line-or-region), or maximizing certain buffers (full-frame).

Quick video table of contents (times are approximate):

0:04 From Vim to Emacs with Viper
0:11 Packages
0:18 Feedback
0:20 Lisp style
0:21 Flycheck
0:28 Versioning
0:32 Config
0:40 ibuffer-vc
0:41 whole-line-or-region
0:44 full-frame
0:47 Not using Emacs for everything
0:48 Auto-complete, hippie-expand
0:51 Graceful degradation with maybe-require-package
0:57 Making sense

Transcript will follow. In the meantime, you can check out Steve’s config at, follow him on Twitter at @sanityinc, or go to his website at You can find other Emacs Chats at .

Got a nifty Emacs workflow or story that you think other people might find useful? I’d love to set up an Emacs Chat episode with you. Please feel free to comment below or e-mail me at [email protected]!

Emacs Chat: Karl Voit

Org Mode, Memacs, lazyblorg, .emacs, Yasnippet, tags . , ,

Check out Karl’s notes for more details. (Or at least, you can check them out when his server is up again!)

Thanks, Karl!

Got an interesting Emacs workflow? Please share. =) Happy to bring on more people for Emacs Chats. Also, check out the upcoming Emacs Hangout on Dec 17 (8 PM Toronto)!

Check out TRANSCRIPT here!

Emacs Chat: Mickey Petersen

Mickey Petersen chats about Mastering Emacs, learning advanced topics, navigating by expressions, and making the most of dired and shell. You can find him at or

Transcript here!

Emacs Chat: Christopher Wellons

Christopher Wellons (, started using Emacs nine years ago and has built all sorts of nifty customizations since, including something that plays Tetris for you. He demonstrates the benefits of having an HTTP server running inside Emacs by using Skewer to interact with a web browser and Impatient-mode to share his syntax-highlighted buffer through the Web. In addition, he covers foreign function interfaces, packages, and other good things. Check it out!


Download the MP3