summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-02-25 22:40:54 -0500
committerKyle Meyer <kyle@kyleam.com>2016-02-25 22:40:54 -0500
commit975c3b347f39f1ced00d1e0701aac9234f232b7f (patch)
treecfcc259e45745f484d5b47d6b195b3bddac4ca95
parentd9c2b69946f572f8fba420edaf4c95b4f27f2ed9 (diff)
downloademacs.d-975c3b347f39f1ced00d1e0701aac9234f232b7f.tar.gz
Add diff-current-buffer-with-file command
-rw-r--r--lisp/km-diff.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/km-diff.el b/lisp/km-diff.el
index b5d3c4b..9c2b143 100644
--- a/lisp/km-diff.el
+++ b/lisp/km-diff.el
@@ -33,6 +33,14 @@
(abbreviate-file-name
(substring-no-properties (diff-find-file-name))))))
+;;;###autoload
+(defun km/diff-current-buffer-with-file ()
+ "Like `diff-buffer-with-file', but use current buffer without prompting."
+ (interactive)
+ (unless (buffer-file-name)
+ (user-error "Buffer isn't associated with a file"))
+ (diff-buffer-with-file (current-buffer)))
+
(defun km/diff--with-other-window (diff-func)
(let ((windows (window-list)))
(unless (= (length windows) 2)