Emacs in daemon mode is awesome, when it properly loads your init config

Categories

This post still working for you?

It's been a while since this was posted. Hopefully the information in here is still useful to you (if it isn't please let me know!). If you want to get the new stuff as soon as it's out though, sign up to the mailing list below.

Join the Mailing list
Emacs Icon

I’ve recently made the switch to using Emacs in Daemon mode.

The primary benefit (for me) is super quick boot up time — and it’s been wonderful, except I ran into the problem today of having a large set of my configuration not working. A bunch of my trusty keybinds were gone, some packages weren’t loaded, and this led to sessions started with emacsclient -t not feeling quite like home.

Here are a few tips in case you run into issues with init config loading for you:

  • Make sure your init file is properly named (generally ~/.emacs or ~/.emacs.d/emacs.el are looked for on startup (Because the documentation said so)
  • Simple attempts at triggering --debug-init so I devolved to print-statement debugging (the message elisp function is your friend). Find out quickly whether your init file is being read at all by putting in some statements, and checking the *Messages* buffer once Emacs has started up.
  • If you want your Emacs to start a server in case there isn’t one already running, alias some command (like “emax”) to emacsclient -t -a ''
  • Often, the reasons that later parts of your Emacs init file won’t load are due to faulty requires, and possibly functions that assume there is a default frame (for example, I had a little bit of init code that opened and closed sr-speedbar, and it subtly erroring)
  • Remember to pkill emacs between bug fixing iterations

While somewhat painful, after getting all the problems fixed, you’ll have a wonderfully fast emacs launch speed, and probably a better grasp on elisp.

Like what you're reading? Get it in your inbox