diff options
| author | Lars Ingebrigtsen | 2020-08-03 08:18:39 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-08-03 08:18:39 +0200 |
| commit | 26b9a1da63bab8c8ee00a484df46db6ed57e2317 (patch) | |
| tree | add981134857eb466a9661194bd053f6ab18c9c7 | |
| parent | f921feceb8cd8c52f281447c984d0b67a738a33c (diff) | |
| download | emacs-26b9a1da63bab8c8ee00a484df46db6ed57e2317.tar.gz emacs-26b9a1da63bab8c8ee00a484df46db6ed57e2317.zip | |
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.
| -rw-r--r-- | lisp/image-mode.el | 32 |
1 files changed, 17 insertions, 15 deletions
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: | |||
| 614 | (if (not (image-get-display-property)) | 614 | (if (not (image-get-display-property)) |
| 615 | (progn | 615 | (progn |
| 616 | (when (condition-case err | 616 | (when (condition-case err |
| 617 | (progn | 617 | (progn |
| 618 | (image-toggle-display-image) | 618 | (image-toggle-display-image) |
| 619 | t) | 619 | t) |
| 620 | (unknown-image-type | 620 | (unknown-image-type |
| 621 | (image-mode-as-text) | 621 | (image-mode-as-text) |
| 622 | (funcall | 622 | (funcall |
| 623 | (if (called-interactively-p 'any) 'error 'message) | 623 | (if (called-interactively-p 'any) 'error 'message) |
| 624 | "Unknown image type; consider switching `image-use-external-converter' on") | 624 | (if image-use-external-converter |
| 625 | nil) | 625 | "Unknown image type" |
| 626 | (error | 626 | "Unknown image type; consider switching `image-use-external-converter' on")) |
| 627 | (image-mode-as-text) | 627 | nil) |
| 628 | (funcall | 628 | (error |
| 629 | (if (called-interactively-p 'any) 'error 'message) | 629 | (image-mode-as-text) |
| 630 | "Cannot display image: %s" (cdr err)) | 630 | (funcall |
| 631 | nil)) | 631 | (if (called-interactively-p 'any) 'error 'message) |
| 632 | "Cannot display image: %s" (cdr err)) | ||
| 633 | nil)) | ||
| 632 | ;; If attempt to display the image fails. | 634 | ;; If attempt to display the image fails. |
| 633 | (if (not (image-get-display-property)) | 635 | (if (not (image-get-display-property)) |
| 634 | (error "Invalid image")) | 636 | (error "Invalid image")) |