# HG changeset patch # User Augie Fackler # Date 1259094337 21600 # Node ID 36a4e4b0f9c399f2bc0dcf8d5717a7e2b6e15f2f # Parent 95b7dc384677ff3feb0dea5d1a0a0abf97f25189 localfuncs: smart multi-vcs diff command Requires mercurial.el, but it works with both Mercurial and Git. diff --git a/.elisp/settings/50.localfuncs.el b/.elisp/settings/50.localfuncs.el --- 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 "