public
Description: My Emacs initialization files
Homepage: http://www.io.com/~jimm/emacs_tips.html
Clone URL: git://github.com/jimm/elisp.git
jimm (author)
Wed Nov 25 04:31:51 -0800 2009
commit  a7a602bd10849d5e9eed073773a54e1a3fe66ff4
tree    1b741f5d675b8fe8e9b680690c95ce803ee53e67
parent  1a842262c9758f7c398b3a8b7e085f5e03b52299
elisp /
name age message
file .gitignore Tue Dec 16 07:13:36 -0800 2008 .gitignore files [Jim Menard]
file README.rdoc Sat Aug 15 21:10:18 -0700 2009 README [jimm]
file abbrev_defs.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file bootstrap-init.el Sun Jan 25 16:33:23 -0800 2009 Read path file from bootstrap dir. [jimm]
directory bootstrap/ Thu Nov 19 16:01:37 -0800 2009 four-space indent for Java at work [jimm]
file crypt++.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
file dropdown-list.el Tue Jul 28 12:18:33 -0700 2009 yasnippet update [jimm]
file emacs.el Wed Nov 25 04:31:51 -0800 2009 LilyPond mode [jimm]
file eshell-customize.el Tue Apr 07 09:35:01 -0700 2009 removed unnecessary color code [jimm]
directory eshell/ Thu Nov 19 14:27:13 -0800 2009 new alias [jimm]
file flip.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
file hexlify.rb Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file htmlize.el Mon Sep 14 08:46:35 -0700 2009 Fix for Emacs 23 [jimm]
file http-twiddle.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file ido.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file inf-ruby.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
file mac-key-mode.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file malyon.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
file my-cygwin.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file my-emacs-wiki.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
file my-environment.el Sat Feb 14 15:35:33 -0800 2009 nimbus -> home [jimm]
file my-skeletons.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
directory org/ Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file pmd.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
directory progmodes/ Wed Nov 25 04:31:51 -0800 2009 LilyPond mode [jimm]
file psvn.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file rails-find-other-file.el Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
directory remember/ Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
file ri.el Tue Dec 16 07:24:52 -0800 2008 removed executable bit from .el files [Jim Menard]
directory ses/ Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
directory slime/ Tue Dec 16 07:11:37 -0800 2008 initial checkin [Jim Menard]
directory snippets/ Tue Nov 24 06:09:57 -0800 2009 fixed snippet [jimm]
file yasnippet.el Tue Jul 28 12:18:33 -0700 2009 yasnippet update [jimm]
README.rdoc

Introduction

Welcome to my Emacs initialization files.

The main initialization file is emacs.el, which is loaded as part of a machine-specific bootstrap process.

Bootstrap Process

Since I use Emacs on multiple machines, I came up with a customization scheme that lets me run "before" and "after" code for each machine around my main initialization code. Each domain (work, home, etc.) gets its own subdirectory and each machine gets its own subdirectory within the domain. Inside that are up to four files: dot_emacs, before.el, after.el, and the bookmark file emacs.bmk. The file ~/.emacs is a link to the dot_emacs file in that machine’s directory in the proper domain subdirectory.

Here’s the .emacs file on the machine I’m using right now, which is really a link to ~/Library/elisp/home/nimbus/dot_emacs:

  ;; -*- emacs-lisp -*-
  (defvar *my-emacs-lib-dir* "~/Library/elisp/")
  (defvar *my-pim-dir* "~/pim/")
  (load-file (concat *my-emacs-lib-dir* "bootstrap-init.el"))
  (bootstrap-init "home" "nimbux")

Here’s bootstrap-init.el:

  ;;; *my-emacs-lib-dir* must be defined

  (defun bootstrap-file (domain machine file-name)
    (concat *my-emacs-lib-dir* "bootstrap/" domain "/" machine "/" file-name))

  (defun load-init-if-exists (domain machine file)
    (let ((f (bootstrap-file domain machine (concat file ".el"))))
      (if (file-exists-p f)
        (load-file f))))

  (defun bootstrap-init (domain machine)
    (load-init-if-exists domain machine "before")
    (load-file (concat *my-emacs-lib-dir* "emacs"))
    (load-init-if-exists domain machine "after")
    (setq bookmark-default-file
          (bootstrap-file domain machine "emacs.bmk")))

So you can see that bootstrap-init runs a "before.el" file, then my main customization file "emacs.el", then an "after.el" file.

See Also

See also www.io.com/~jimm/emacs_tips.html.