chiark / gitweb /
emacs, dot-emacs: Support debian-changelog-mode after fast startup.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 13 Jan 2009 16:08:55 +0000 (16:08 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 13 Jan 2009 16:08:55 +0000 (16:08 +0000)
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
emacs

index d94f962634db750fb4bb4e2f1ea2438433c6a77d..f338fc32514ad9c1bfb41361dc86a7aa1e012651 100644 (file)
@@ -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 841ad0d38f43c5dbf54441788434972608ed8016..ba1c902361a3f95958a37e345753a7d21f4df5f0 100644 (file)
--- a/emacs
+++ b/emacs
 (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)))