aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/image-file.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/image-file.el')
-rw-r--r--lisp/image-file.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/image-file.el b/lisp/image-file.el
index 87314f3b90c..afee88d1346 100644
--- a/lisp/image-file.el
+++ b/lisp/image-file.el
@@ -110,6 +110,7 @@ the command `insert-file-contents'."
110 (when (and (or (null beg) (zerop beg)) (null end)) 110 (when (and (or (null beg) (zerop beg)) (null end))
111 (let* ((ibeg (point)) 111 (let* ((ibeg (point))
112 (iend (+ (point) (cadr rval))) 112 (iend (+ (point) (cadr rval)))
113 (visitingp (and visit (= ibeg (point-min)) (= iend (point-max))))
113 (data 114 (data
114 (string-make-unibyte 115 (string-make-unibyte
115 (buffer-substring-no-properties ibeg iend))) 116 (buffer-substring-no-properties ibeg iend)))
@@ -122,11 +123,13 @@ the command `insert-file-contents'."
122 ;; This a cheap attempt to make the whole buffer 123 ;; This a cheap attempt to make the whole buffer
123 ;; read-only when we're visiting the file (as 124 ;; read-only when we're visiting the file (as
124 ;; opposed to just inserting it). 125 ;; opposed to just inserting it).
125 ,@(and visit 126 ,@(and visitingp
126 (= ibeg (point-min))
127 (= iend (point-max))
128 '(read-only t front-sticky (read-only)))))) 127 '(read-only t front-sticky (read-only))))))
129 (add-text-properties ibeg iend props))) 128 (add-text-properties ibeg iend props)
129 (when visitingp
130 ;; Inhibit the cursor when the buffer contains only an image,
131 ;; because cursors look very strange on top of images.
132 (setq cursor-type nil))))
130 rval)) 133 rval))
131 134
132(defun image-file-handler (operation &rest args) 135(defun image-file-handler (operation &rest args)