summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index c0186f07a1d..c504afa6970 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)
@@ -780,7 +780,7 @@ was inserted."
rear-nonsticky (display) ;; intangible
read-only t front-sticky (read-only)))
- (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file
+ (let ((create-lockfiles nil)) ; avoid changing dir mtime by lock_file
(add-text-properties (point-min) (point-max) props)
(restore-buffer-modified-p modified))
;; Inhibit the cursor when the buffer contains only an image,
@@ -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)