# HG changeset patch # User Miles Bader # Date 981119382 0 # Node ID a8fd9112792be0f44d97c363b4def0782c25f234 # Parent 774df19dd335ac2381f1eadea68964b50007a367 (insert-image-file): When visiting an image, suppress the cursor in the image buffer. diff -r 774df19dd335 -r a8fd9112792b lisp/image-file.el --- a/lisp/image-file.el Fri Feb 02 13:09:26 2001 +0000 +++ b/lisp/image-file.el Fri Feb 02 13:09:42 2001 +0000 @@ -110,6 +110,7 @@ (when (and (or (null beg) (zerop beg)) (null end)) (let* ((ibeg (point)) (iend (+ (point) (cadr rval))) + (visitingp (and visit (= ibeg (point-min)) (= iend (point-max)))) (data (string-make-unibyte (buffer-substring-no-properties ibeg iend))) @@ -122,11 +123,13 @@ ;; This a cheap attempt to make the whole buffer ;; read-only when we're visiting the file (as ;; opposed to just inserting it). - ,@(and visit - (= ibeg (point-min)) - (= iend (point-max)) + ,@(and visitingp '(read-only t front-sticky (read-only)))))) - (add-text-properties ibeg iend props))) + (add-text-properties ibeg iend props) + (when visitingp + ;; Inhibit the cursor when the buffer contains only an image, + ;; because cursors look very strange on top of images. + (setq cursor-type nil)))) rval)) (defun image-file-handler (operation &rest args)