Custom Emacs Command Line Flags

I’m writing this on Christmas day so the festivities mean that I don’t have as much time as usual available for writing this post. Happily, I came across this post by Norman Walsh in which he mentions a fact that I didn’t know and you probably don’t either. It turns out you can define custom flags for the Emacs command line.

That’s pretty easy to do: You just add a (flag . handler) cons to the command-switch-alist variable. You can see an example of it in Walsh’s post. You might wonder why you’d want to do that. Walsh gives one use case in his post but it probably always boils down to wanting to perform some special, optional configuration when Emacs is started.

Wash’s post isn’t so much about that ability as it is the use case he has for it. It’s a short post and worth a minute or so to read.

This entry was posted in General and tagged . Bookmark the permalink.