mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-03 14:10:47 -08:00
Adjust error message in image-mode
* lisp/image-mode.el (image-mode): Even when `image-user-external-converter' is on, we may get `unknown-image-type' (bug#39994). Adjust the error message in that case.
This commit is contained in:
parent
f921feceb8
commit
26b9a1da63
1 changed files with 17 additions and 15 deletions
|
|
@ -614,21 +614,23 @@ Key bindings:
|
|||
(if (not (image-get-display-property))
|
||||
(progn
|
||||
(when (condition-case err
|
||||
(progn
|
||||
(image-toggle-display-image)
|
||||
t)
|
||||
(unknown-image-type
|
||||
(image-mode-as-text)
|
||||
(funcall
|
||||
(if (called-interactively-p 'any) 'error 'message)
|
||||
"Unknown image type; consider switching `image-use-external-converter' on")
|
||||
nil)
|
||||
(error
|
||||
(image-mode-as-text)
|
||||
(funcall
|
||||
(if (called-interactively-p 'any) 'error 'message)
|
||||
"Cannot display image: %s" (cdr err))
|
||||
nil))
|
||||
(progn
|
||||
(image-toggle-display-image)
|
||||
t)
|
||||
(unknown-image-type
|
||||
(image-mode-as-text)
|
||||
(funcall
|
||||
(if (called-interactively-p 'any) 'error 'message)
|
||||
(if image-use-external-converter
|
||||
"Unknown image type"
|
||||
"Unknown image type; consider switching `image-use-external-converter' on"))
|
||||
nil)
|
||||
(error
|
||||
(image-mode-as-text)
|
||||
(funcall
|
||||
(if (called-interactively-p 'any) 'error 'message)
|
||||
"Cannot display image: %s" (cdr err))
|
||||
nil))
|
||||
;; If attempt to display the image fails.
|
||||
(if (not (image-get-display-property))
|
||||
(error "Invalid image"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue