Check that the buffer in diff-buffer-with-file is visiting a file
* lisp/vc/diff.el (diff-buffer-with-file): Signal a specific error when the buffer passed to diff-buffer-with-file is not visiting a file (bug#43401).
This commit is contained in:
parent
e408f2fab2
commit
d727d3dad6
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue