summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)