mq.el: add mq-diff function.
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 08 May 2007 11:54:39 -0700
changeset 4424 1d31302c4522
parent 4423 2647f1fbc24c
child 4425 a57ac6049e22
mq.el: add mq-diff function.
contrib/mq.el
--- a/contrib/mq.el
+++ b/contrib/mq.el
@@ -62,6 +62,7 @@
 (define-key mq-global-map ">" 'mq-push-all)
 (define-key mq-global-map "," 'mq-pop)
 (define-key mq-global-map "<" 'mq-pop-all)
+(define-key mq-global-map "=" 'mq-diff)
 (define-key mq-global-map "r" 'mq-refresh)
 (define-key mq-global-map "e" 'mq-refresh-edit)
 (define-key mq-global-map "i" 'mq-new)
@@ -346,6 +347,14 @@ directory is modified."
       (error "Not in an MQ repository!"))
     (find-file (concat root ".hg/patches/series"))))
 
+(defun mq-diff ()
+  "Display a diff of the topmost applied patch."
+  (interactive)
+  (hg-view-output ((format "MQ: Diff of %s" (mq-patch-info "qtop")))
+    (call-process (hg-binary) nil t nil "qdiff")
+    (diff-mode)
+    (font-lock-fontify-buffer)))
+
 
 (provide 'mq)