summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2018-04-14 15:36:53 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2018-04-14 15:36:53 +0200
commitc768fe1be0d68c182d037891e0946983e5fbe644 (patch)
tree576f777ed6d5e3f55bff9773deda9fc997616023 /lisp/image-mode.el
parent42141da5b0885b199636524c1e57f08ee1723aea (diff)
downloademacs-c768fe1be0d68c182d037891e0946983e5fbe644.tar.gz
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.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el8
1 files changed, 7 insertions, 1 deletions
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."
(edges (and (null image-transform-resize)
(window-inside-pixel-edges
(get-buffer-window (current-buffer)))))
- (type (if (fboundp 'imagemagick-types)
+ (type (if (image--imagemagick-wanted-p filename)
'imagemagick
(image-type file-or-data nil data-p)))
(image (if (not edges)
@@ -803,6 +803,12 @@ was inserted."
(if (called-interactively-p 'any)
(message "Repeat this command to go back to displaying the file as text"))))
+(defun image--imagemagick-wanted-p (filename)
+ (and (fboundp 'imagemagick-types)
+ (not (eq imagemagick-types-inhibit t))
+ (not (memq (intern (upcase (file-name-extension filename)) obarray)
+ imagemagick-types-inhibit))))
+
(defun image-toggle-hex-display ()
"Toggle between image and hex display."
(interactive)