diff options
| author | Miles Bader | 2001-02-02 13:11:39 +0000 |
|---|---|---|
| committer | Miles Bader | 2001-02-02 13:11:39 +0000 |
| commit | 33155ffbf64fea0a2e1d32e6d820b1cbc69a647e (patch) | |
| tree | dc5dddb245328e0cbee8a8f9ba4c271efd9f06cd /lisp | |
| parent | 1b66ab0e17a5dbb860545b9b13c4008a1ce5222b (diff) | |
| download | emacs-33155ffbf64fea0a2e1d32e6d820b1cbc69a647e.tar.gz emacs-33155ffbf64fea0a2e1d32e6d820b1cbc69a647e.zip | |
(insert-image-file): When visiting an image, suppress the cursor in the
image buffer.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/image-file.el | 11 |
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 @@ | |||
| 1 | 2001-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 | |||
| 1 | 2001-02-01 Dave Love <fx@gnu.org> | 6 | 2001-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) |