summaryrefslogtreecommitdiff
path: root/lisp/vc/diff.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/diff.el')
-rw-r--r--lisp/vc/diff.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index 469888078c4..b7f17bf3c73 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -258,6 +258,8 @@ This requires the external program `diff' to be in your `exec-path'."
(interactive "bBuffer: ")
(let ((buf (get-buffer (or buffer (current-buffer)))))
(with-current-buffer (or (buffer-base-buffer buf) buf)
+ (unless buffer-file-name
+ (error "Buffer is not visiting a file"))
(diff buffer-file-name (current-buffer) nil 'noasync))))
;;;###autoload