I have declared .emacs bankruptcy for 2014. I’ve wanted a simple, extensible Emacs configuration for some time now. On the way to that goal, I discovered a module that’s made it easier, and has changed how I think about Emacs configuration.
Drew Adams is the insanely productive programmer behind Icicles and DoReMi, and countless other Emacs contributions. He is absolutely prolific on the EmacsWiki, tirelessly responding to other users and providing support. In short, he’s a model community member. He’s also the author of
Its goal is simple: to unify the changes you make both outside and inside Emacs’ Customize system. The results, however, are phenomenal. Huge swaths of my disorganized
.emacs.d should have been tracked by Customize.
Here’s a file hidden in my mess of an
.emacs.d directory called
(setq backup-by-copying t backup-directory-alist '(("." . "~/.emacs.d/saves")) delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t ido-enable-prefix nil ido-enable-flex-matching t ido-create-new-buffer 'always ido-use-filename-at-point 'guess ido-max-prospects 10)
If you’re like me, this should look familiar. Undocumented detritus with a useless filename, multiple modifications to seemingly unrelated variables.
Here’s what it looks like after using
Those settings are now in my
custom-file. I can
M-x customize-saved, and I get their name, their description, their current value, and what group they belong to.
As I go through my old
- I find settings that I know I want and execute them.
- I use
cus-edit+to update its repertoire of modified custom variables, by
- Then I
cus-edit+function—to bring all those modified settings into one customize page, so I can review and set them.
It’s basically painless. It doesn’t solve all my problems with Customize (another entry entirely) but it takes huge strides towards finally mopping up the mess that brought me to .emacs bankruptcy in the first place.