I’ve never really liked the built-in customization UI in Emacs (M-x customize). I’m sure plenty of people use it and enjoy it, but, to me, it feels like an abominable tree of never ending and difficult to navigate options. Plus, it sticks your saved customizations as an unorganized mess of elisp smack at the bottom of your init file. I’m not quite sure how to solve my first gripe, but the second is manageable.
By setting the custom-file variable, you can keep those automated customizations in a separate file. Put this in your Emacs init:
(setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror)
Both lines are necessary. The first line tells Custom to save all customizations in the file, but does not load it. The 'noerror argument passed to load prevents errors if the file doesn’t exist. If you had existing customizations in your init file, be sure to copy them to the new custom file.
Now, go enjoy a cleaner init file. This tip is especially useful if you keep your init files under a version control system. You do keep your init files under version control, right?
5 responses so far ↓
Amen, brudda! And yes, I’ve been keeping my dotfiles in revision control for years … inspired by http://joey.kitenet.net/svnhome/
Thank you. I hate that custom cruft, too.
I just have a one-liner .emacs: “(load-library “~/emacs/my-emacs”)”, and let emacs do what it wants with .emacs. A simpler solution IMHO, because it does less – my-emacs.el loads a lot of my-foo.el libraries for various foo, anyway.
Thanks, you save my day
Hello, I am writing a new Java source browser for Emacs, using Pymacs and Python. It’s called PyJDE.
http://code.google.com/p/pyjde/
Take a look.
Leave a Comment