A friendlier error message from image-mode in an empty buffer
* lisp/image-mode.el (image-mode): Handle the case where the empty buffer doesn't visit a file (Bug#54084)
This commit is contained in:
parent
b7a651ba37
commit
b38223a844
1 changed files with 5 additions and 3 deletions
|
@ -621,9 +621,11 @@ Key bindings:
|
|||
;; Bail out early if we have no image data.
|
||||
(if (zerop (buffer-size))
|
||||
(funcall (if (called-interactively-p 'any) 'error 'message)
|
||||
(if (file-exists-p buffer-file-name)
|
||||
"Empty file"
|
||||
"(New file)"))
|
||||
(if (stringp buffer-file-name)
|
||||
(if (file-exists-p buffer-file-name)
|
||||
"Empty file"
|
||||
"(New file)")
|
||||
"Empty buffer"))
|
||||
(image-mode--display)))
|
||||
|
||||
(defun image-mode--display ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue