aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/image-file.el11
2 files changed, 12 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 76144f85d97..9b0e2e3be36 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12001-02-02 Miles Bader <miles@gnu.org>
2
3 * image-file.el (insert-image-file): When visiting an image,
4 suppress the cursor in the image buffer.
5
12001-02-01 Dave Love <fx@gnu.org> 62001-02-01 Dave Love <fx@gnu.org>
2 7
3 * progmodes/f90.el (f90-mode): Remove startup message. 8 * progmodes/f90.el (f90-mode): Remove startup message.
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)