Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/profile
[profile] / dot / emacs
index 31cfd15..f1bcfbf 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 ;;; along with this program; if not, write to the Free Software
 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-(setq load-path (nconc load-path (list "~/lib/emacs")))
+(let ((path "~/lib/emacs/")
+      (pkgs (list "bbdb/" "multiple-cursors/" "rust-mode/"))
+      pkg)
+  (setq load-path (nconc load-path (list path)))
+  (while (setq pkg (pop pkgs))
+    (let ((dir (concat path pkg)))
+      (if (file-exists-p dir)
+         (setq load-path (nconc load-path (list dir))))))
+  (let ((boot (concat path "mdw-pkgs.el")))
+    (if (file-exists-p boot)
+       (load boot))))
+
 (require 'dot-emacs)
 (require 'cl)
 
 
 ;; Multiple cursors.
 
-(setq load-path (nconc load-path (list "~/lib/emacs/multiple-cursors/")))
 (global-set-key [?\C-c ?r] 'mdw-multiple-cursors-keymap)
 (autoload 'mdw-multiple-cursors-keymap "mdw-multiple-cursors.el"
   "A keymap for Magnar Sveen's awesome multiple-cursors." nil 'keymap)
 
 ;; Rust mode.
 
-(setq load-path (nconc load-path (list "~/lib/emacs/rust-mode/")))
 (autoload 'rust-mode "rust-mode" nil t)
 (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))