From: Lars Ingebrigtsen Date: Mon, 3 Aug 2020 06:18:39 +0000 (+0200) Subject: Adjust error message in image-mode X-Git-Tag: emacs-28.0.90~6852 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=26b9a1da63bab8c8ee00a484df46db6ed57e2317;p=emacs.git 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. --- diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 1bb213c2489..129529542ae 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -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"))