changeset 218:b9b118dba61a

emacs: make diff-mode mq-aware
author Augie Fackler <durin42@gmail.com>
date Sat, 14 Aug 2010 21:58:40 -0500
parents e4842709368a
children bb74667967e1 a2ea4a78e02c
files .elisp/settings/40.modes.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.elisp/settings/40.modes.el
+++ b/.elisp/settings/40.modes.el
@@ -87,3 +87,10 @@ point."
           (lambda ()
             (c-set-offset 'topmost-intro-cont
                           annotation-fix)))
+
+;; mq diff-mode support
+(add-to-list 'auto-mode-alist '("\\.hg/patches/" . diff-mode))
+(defun mq-patch-set-default-directory ()
+  (when (string= ".hg" (nth 2 (reverse (split-string default-directory "/"))))
+    (setq default-directory (expand-file-name (concat default-directory "../../")))))
+(add-hook 'diff-mode-hook 'mq-patch-set-default-directory)