diff .elisp/settings/50.localfuncs.el @ 158:36a4e4b0f9c3

localfuncs: smart multi-vcs diff command Requires mercurial.el, but it works with both Mercurial and Git.
author Augie Fackler <durin42@gmail.com>
date Tue, 24 Nov 2009 14:25:37 -0600
parents e30655eb7050
children cd4e645d1207
line wrap: on
line diff
--- a/.elisp/settings/50.localfuncs.el
+++ b/.elisp/settings/50.localfuncs.el
@@ -1,3 +1,17 @@
+(defun af-generic-diff-repo ()
+  (interactive)
+  (let ((root (textmate-project-root)))
+    (cd root)
+    (hg-view-output
+        ((format "project diff for %s" root))
+      (call-process (textmate-project-root-type root) nil t nil "diff")
+      (diff-mode)
+      (setq diff (not (= (point-min) (point-max))))
+      (font-lock-fontify-buffer)
+      (cd root))))
+(global-set-key [(control c)(t)(=)] 'af-generic-diff-repo)
+(global-set-key [(control c)(d)] 'af-generic-diff-repo)
+
 (defun pyflakes-this-buffer ()
   (interactive)
   (compilation-start (concat "cd  "