diff options
| author | Richard M. Stallman | 2005-03-21 17:42:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-03-21 17:42:36 +0000 |
| commit | 837daa0d4170134e8b94735ff757a33f235c6c8d (patch) | |
| tree | 105f02b2bf8e7920e71a72ed9a3ef867dd2278c1 | |
| parent | 740b479c63d2e380e49b3222e75cda29f2fe481e (diff) | |
| download | emacs-837daa0d4170134e8b94735ff757a33f235c6c8d.tar.gz emacs-837daa0d4170134e8b94735ff757a33f235c6c8d.zip | |
Handle .xpm files too.
(image-toggle-display): Preserve modification flag.
| -rw-r--r-- | lisp/image-mode.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index b5b0f7731dc..0d2b221ee8b 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | ;;;###autoload (push '("\\.tiff\\'" . image-mode) auto-mode-alist) | 43 | ;;;###autoload (push '("\\.tiff\\'" . image-mode) auto-mode-alist) |
| 44 | ;;;###autoload (push '("\\.tif\\'" . image-mode) auto-mode-alist) | 44 | ;;;###autoload (push '("\\.tif\\'" . image-mode) auto-mode-alist) |
| 45 | ;;;###autoload (push '("\\.xbm\\'" . image-mode) auto-mode-alist) | 45 | ;;;###autoload (push '("\\.xbm\\'" . image-mode) auto-mode-alist) |
| 46 | ;;;###autoload (push '("\\.xpm\\'" . image-mode) auto-mode-alist) | ||
| 46 | ;;;###autoload (push '("\\.pbm\\'" . image-mode) auto-mode-alist) | 47 | ;;;###autoload (push '("\\.pbm\\'" . image-mode) auto-mode-alist) |
| 47 | ;;;###autoload (push '("\\.pgm\\'" . image-mode) auto-mode-alist) | 48 | ;;;###autoload (push '("\\.pgm\\'" . image-mode) auto-mode-alist) |
| 48 | ;;;###autoload (push '("\\.ppm\\'" . image-mode) auto-mode-alist) | 49 | ;;;###autoload (push '("\\.ppm\\'" . image-mode) auto-mode-alist) |
| @@ -75,10 +76,12 @@ and showing the image as an image." | |||
| 75 | (interactive) | 76 | (interactive) |
| 76 | (if (get-text-property (point-min) 'display) | 77 | (if (get-text-property (point-min) 'display) |
| 77 | (let ((inhibit-read-only t) | 78 | (let ((inhibit-read-only t) |
| 78 | (buffer-undo-list t)) | 79 | (buffer-undo-list t) |
| 80 | (modified (buffer-modified-p))) | ||
| 79 | (remove-list-of-text-properties (point-min) (point-max) | 81 | (remove-list-of-text-properties (point-min) (point-max) |
| 80 | '(display intangible read-nonsticky | 82 | '(display intangible read-nonsticky |
| 81 | read-only front-sticky)) | 83 | read-only front-sticky)) |
| 84 | (set-buffer-modified-p modified) | ||
| 82 | (kill-local-variable 'cursor-type) | 85 | (kill-local-variable 'cursor-type) |
| 83 | (kill-local-variable 'truncate-lines) | 86 | (kill-local-variable 'truncate-lines) |
| 84 | (message "Repeat this command to go back to displaying the image")) | 87 | (message "Repeat this command to go back to displaying the image")) |
| @@ -97,8 +100,10 @@ and showing the image as an image." | |||
| 97 | ;; read-only when we're visiting the file (as | 100 | ;; read-only when we're visiting the file (as |
| 98 | ;; opposed to just inserting it). | 101 | ;; opposed to just inserting it). |
| 99 | read-only t front-sticky (read-only))) | 102 | read-only t front-sticky (read-only))) |
| 100 | (buffer-undo-list t)) | 103 | (buffer-undo-list t) |
| 104 | (modified (buffer-modified-p))) | ||
| 101 | (add-text-properties (point-min) (point-max) props) | 105 | (add-text-properties (point-min) (point-max) props) |
| 106 | (set-buffer-modified-p modified) | ||
| 102 | ;; Inhibit the cursor when the buffer contains only an image, | 107 | ;; Inhibit the cursor when the buffer contains only an image, |
| 103 | ;; because cursors look very strange on top of images. | 108 | ;; because cursors look very strange on top of images. |
| 104 | (setq cursor-type nil) | 109 | (setq cursor-type nil) |