aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/iimage.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/iimage.el b/lisp/iimage.el
index 39ee1fb805c..3b5006491aa 100644
--- a/lisp/iimage.el
+++ b/lisp/iimage.el
@@ -116,6 +116,7 @@ Examples of image filename patterns to match:
116(defun iimage-mode-buffer (arg) 116(defun iimage-mode-buffer (arg)
117 "Display images if ARG is non-nil, undisplay them otherwise." 117 "Display images if ARG is non-nil, undisplay them otherwise."
118 (let ((image-path (cons default-directory iimage-mode-image-search-path)) 118 (let ((image-path (cons default-directory iimage-mode-image-search-path))
119 (edges (window-inside-pixel-edges (get-buffer-window)))
119 file) 120 file)
120 (with-silent-modifications 121 (with-silent-modifications
121 (save-excursion 122 (save-excursion
@@ -128,10 +129,15 @@ Examples of image filename patterns to match:
128 ;; remove them either (we may leave some of ours, and we 129 ;; remove them either (we may leave some of ours, and we
129 ;; may remove other packages's display properties). 130 ;; may remove other packages's display properties).
130 (if arg 131 (if arg
131 (add-text-properties (match-beginning 0) (match-end 0) 132 (add-text-properties
132 `(display ,(create-image file) 133 (match-beginning 0) (match-end 0)
133 modification-hooks 134 `(display
134 (iimage-modification-hook))) 135 ,(create-image file nil nil
136 :max-width (- (nth 2 edges) (nth 0 edges))
137 :max-height (- (nth 3 edges) (nth 1 edges)))
138 keymap ,image-map
139 modification-hooks
140 (iimage-modification-hook)))
135 (remove-text-properties (match-beginning 0) (match-end 0) 141 (remove-text-properties (match-beginning 0) (match-end 0)
136 '(display modification-hooks)))))))))) 142 '(display modification-hooks))))))))))
137 143