diff options
| author | Lars Ingebrigtsen | 2018-04-14 15:36:53 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2018-04-14 15:36:53 +0200 |
| commit | c768fe1be0d68c182d037891e0946983e5fbe644 (patch) | |
| tree | 576f777ed6d5e3f55bff9773deda9fc997616023 | |
| parent | 42141da5b0885b199636524c1e57f08ee1723aea (diff) | |
| download | emacs-c768fe1be0d68c182d037891e0946983e5fbe644.tar.gz emacs-c768fe1be0d68c182d037891e0946983e5fbe644.zip | |
Make image-mode respect `imagemagick-types-inhibit'
* lisp/image-mode.el (image--imagemagick-wanted-p): New function
(bug#29584).
(image-toggle-display-image): Use it to see whether we want to use
imagemagick.
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/image-mode.el | 8 |
2 files changed, 14 insertions, 1 deletions
| @@ -551,6 +551,13 @@ such decisions (if they are to be made at all) are left to | |||
| 551 | higher-level functions. | 551 | higher-level functions. |
| 552 | 552 | ||
| 553 | 553 | ||
| 554 | ** image-mode | ||
| 555 | |||
| 556 | *** image-mode started using ImageMagick by default for all images | ||
| 557 | some years back. It now respects `imagemagick-types-inhibit' as a way | ||
| 558 | to disable that. | ||
| 559 | |||
| 560 | |||
| 554 | +++ | 561 | +++ |
| 555 | ** The new function 'read-answer' accepts either long or short answers | 562 | ** The new function 'read-answer' accepts either long or short answers |
| 556 | depending on the new customizable variable 'read-answer-short'. | 563 | depending on the new customizable variable 'read-answer-short'. |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 70d2ca87cc6..320f21a62d7 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -758,7 +758,7 @@ was inserted." | |||
| 758 | (edges (and (null image-transform-resize) | 758 | (edges (and (null image-transform-resize) |
| 759 | (window-inside-pixel-edges | 759 | (window-inside-pixel-edges |
| 760 | (get-buffer-window (current-buffer))))) | 760 | (get-buffer-window (current-buffer))))) |
| 761 | (type (if (fboundp 'imagemagick-types) | 761 | (type (if (image--imagemagick-wanted-p filename) |
| 762 | 'imagemagick | 762 | 'imagemagick |
| 763 | (image-type file-or-data nil data-p))) | 763 | (image-type file-or-data nil data-p))) |
| 764 | (image (if (not edges) | 764 | (image (if (not edges) |
| @@ -803,6 +803,12 @@ was inserted." | |||
| 803 | (if (called-interactively-p 'any) | 803 | (if (called-interactively-p 'any) |
| 804 | (message "Repeat this command to go back to displaying the file as text")))) | 804 | (message "Repeat this command to go back to displaying the file as text")))) |
| 805 | 805 | ||
| 806 | (defun image--imagemagick-wanted-p (filename) | ||
| 807 | (and (fboundp 'imagemagick-types) | ||
| 808 | (not (eq imagemagick-types-inhibit t)) | ||
| 809 | (not (memq (intern (upcase (file-name-extension filename)) obarray) | ||
| 810 | imagemagick-types-inhibit)))) | ||
| 811 | |||
| 806 | (defun image-toggle-hex-display () | 812 | (defun image-toggle-hex-display () |
| 807 | "Toggle between image and hex display." | 813 | "Toggle between image and hex display." |
| 808 | (interactive) | 814 | (interactive) |