Emacs Reboot #4: Customizing Customization

Unlike some Emacs old-schoolers, I make heavy use of the Emacs built-in GUI-ish customization system. In order to make customizations in my new blank-slate setup, I need to first set it up to use a different file than the default. So the first additions I make to my init.el are to customize the customizations file.

First, I set up some variables recording the full path of the init.el file and the directory it lives in. That way I can refer to relative paths within my .emacs24.d directory without hardcoding any paths.

Note that I prefix all of my variables with “abg-” (my initials) in order to avoid stepping on existing variable names.

Once I have a reference to the current directory, I set up the custom file and then load it.

Here’s the code:

Then to test it out, I load the file with M-x load-file and then open up a customize buffer for the tool-bar-mode toggle.

Once I toggle the toolbar mode to “off” and click “Save for future sessions” I can see the customizations have been saved to ~/.emacs24.d/emacs-customizations.el: