From eac7b6224fc7804fcdd2409c6f8e0159e3379a03 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Tue, 13 Jan 2009 16:08:55 +0000 Subject: [PATCH] emacs, dot-emacs: Support debian-changelog-mode after fast startup. Organization: Straylight/Edgeware From: Mark Wooding Two parts: first, a hairy loop in dot-emacs.el to install interesting- looking directories into the load-path; second, a conditional installation of a hairy auto-mode-alist item in emacs. --- dot-emacs.el | 11 +++++++++++ emacs | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/dot-emacs.el b/dot-emacs.el index d94f962..f338fc3 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -85,6 +85,17 @@ (defun mdw-config (sym) (concat "(" (buffer-string) ")"))))))) (cdr (assq sym mdw-config))) +;; --- Set up the load path convincingly --- + +(dolist (dir (append (and (boundp 'debian-emacs-flavor) + (list (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp"))))) + (dolist (sub (directory-files dir t)) + (when (and (file-accessible-directory-p sub) + (not (member sub load-path))) + (setq load-path (nconc load-path (list sub)))))) + ;; --- Is an Emacs library available? --- (defun library-exists-p (name) diff --git a/emacs b/emacs index 841ad0d..ba1c902 100644 --- a/emacs +++ b/emacs @@ -40,6 +40,17 @@ (maybe-autoload 'nc-timesheet-prepare "nc-timesheet" nil t nil) (maybe-autoload 'nc-timesheet-submit "nc-timesheet" nil t nil) +(and (library-exists-p "debian-changelog-mode") + (add-to-list 'auto-mode-alist + `(,(concat "/debian/" + "\\(" + "[" "[:lower:][:digit:]]" + "[[:lower:][:digit:].+-" "]+" + "\\." + "\\)?" + "changelog\\'") + . debian-changelog-mode))) + (and (library-exists-p "vc-git") (not (memq 'GIT vc-handled-backends)) (setq vc-handled-backends (cons 'GIT vc-handled-backends))) -- [mdw]