Cleaning Up My Emacs Environment

While I was installing magit the other day, I decided it was a good time to do a little digital house cleaning. I keep all my important file groups—writing, software development, blogging, and personal—in Git repositories. Oddly, given that these all flow through Emacs, I didn't have my Emacs environment in Git. As I wrote yesterday in my Magit post, one of the primary uses for these Git repositories is to keep my various machines in sync so not having .emacs.d in Git made no sense at all.

Part of the problem was some early poor choices on my part. I installed the Org-mode distribution as a subdirectory of .emacs.d. There's nothing necessarily wrong with that but I had it in there as a Git repository. A while back I decided to try to put .emacs.d in Git but the nested Git repositories didn't work out so well—not at all, in fact. When I finally got around to installing magit I already had some Emacs packages in my tools directory, so I moved the Org-mode repository out of .emacs.d and into tools. I had already replaced .emacs with init.el in .emacs.d so all I had to do was initialize .emacs.d as a Git repository, clone it as a bare repository, and move the cloned repository to the server with the rest of the repositories.

Many people like to break their .emacs into several files with a separate file for each mode or function. Some even use Babel's literate programming facilities to tie everything together. I keep everything in one file otherwise I'd never be able to find anything. That means that I don't have much in my .emacs.d but init.el and some elisp files for small packages that don't need their own subdirectory. Here's what it looks like


Looking at that list, I could probably get rid of quack.el since Geiser has pretty much taken over its functions. Unfortunately the .emacs.bmk file lives in my home directory by default and there doesn't appear to be a way to change it. That's not really a problem for me because I don't use book marks but it would be nice to get everything in one place. I suppose I could set a symbolic link if I did start using them.

This entry was posted in General. Bookmark the permalink.
  • Regarding .emacs.bmk, check out bookmark-default-file.

    • jcs

      Thanks, Chris. I checked the documentation and didn't find anything. Another reason to Use the source, Luke, I guess.

      • Susan Pinochet

        I keep my bookmarks file in the ~/.emacs.d directory/ thusly:

        (setq bookmark-default-file "~/.emacs.d/.bookmarks")

        Help on the variable bookmark-default-file reveals it as "File in which to save bookmarks by default," and it is customizable.

        • jcs

          Thanks, Susan. I don't know how I missed finding it in the online docs. Now I can have everything safely saved in .emacs.d.

  • As a suggestion, you might take a look at package.el, which will ship by default in Emacs 24. It allows you to install elisp packages in an apt-like fashion. I've been using it and I've been able to eliminate all the source elisp files from my emacs directory. I use emacs 24, so I don't have to actually have a package.el file around, but you likely would. If you go that route, also check out as a great non-gnu hosting mechanism for packages.

    • jcs

      Thanks, Justin. I'll take a look.