My Dot Emacs

I have been using Emacs on Unix systems since the 1980s. The vast majority of my work is done on PCs, though, and from about 1988 until 2011 I used an editor for the PC called Qedit, later renamed TSE Pro, from The SemWare Corporation. TSE Pro is small, fast, and highly customizable via its own macro language. I customized it to my preferences over many years, in particular for use with \LaTeX, and wrote four books and many papers with it. When I acquired a Mac laptop in 2009 I realized that I needed to switch to an editor that runs on both Windows and Mac, so after trying Vim and Emacs (and temporarily using TextMate on the Mac) I switched to Emacs.

My past use of Emacs had mainly been to send emails or edit web pages, often over a terminal connection, and I had not realized how fast Emacs was—nor that one could issue commands by typing Alt- instead of the two consecutive keys Esc .

Emacs interrupted by a train, courtesy of

Since 2011 I have used Emacs exclusively and have built up my dot emacs to its current size of nearly 3000 lines. For non-Emacs users, a dot emacs (.emacs) file is an Emacs Lisp file that is read and executed when Emacs loads, and it is where one sets customizations and loads packages.

I have now made my dot emacs file available on Github.

A few notes:

  • Some of the code uses conditional tests to see whether Emacs is running on a Windows machine or a Mac machine and take different action in each case.
  • The code is lightly documented with links to sources for the things I am using.
  • I have recently started using John Wiegley’s use-package for loading packages. Not everything is converted and I may convert other package to load this way. Use-package has several advantages:
    • It makes the dot emacs more readable.
    • It makes it easy to disable a package, by adding a line “:disabled t”.
    • It speeds up the loading of Emacs by delaying loading of packages until they are first used. When I first started using use-package my Emacs load time dropped from 8 seconds to 5 seconds.
  • I do not use the Emacs package manager, but rather download packages manually and place them in ~/dropbox/elisp. The one exception is the Helm package, which I was unable to install manually.
  • I spend most of my time in Emacs in org-mode, latex-mode, or bibtex-mode, so quite a lot of my dot emacs concerns those modes.
  • I recently started using Oleh Krehel’s hydra package, which was released at the start of the year. It provides a nice way to set up key bindings based on a prefix key and provides a reminder at the bottom of the screen about possible subsequent keypresses.

You should not expect to be able to take my dot emacs and use it as is, because many of the packages that are loaded will not be present on your system in the expected location. However, the main benefit of sharing Emacs configurations is that one can copy and adapt pieces of code.

My dot emacs is long, and I have trouble remembering all the features I have set up, even though I have an even longer file that contains notes and a summary of my customized keypresses.

I still use TSE Pro: to edit my dot emacs file when an error introduced therein causes Emacs to fail to start properly! (Of course, I could also use emacs -q, which inhibits loading of the .emacs, but I like to keep my hand in with TSE Pro).