diff options
author | Andreas Schwab <schwab@suse.de> | 2009-02-07 15:29:11 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2009-02-07 15:29:11 +0000 |
commit | d2e9b790b7512af4044eb3f4b7b467f0ec54e2a0 (patch) | |
tree | 4dd67358709956b7a12caf56ec30b2155b6dead1 /lisp/image-mode.el | |
parent | 782c80e89204cbf2c9559ec49d1ebd3ea7fcc9ad (diff) | |
download | emacs-d2e9b790b7512af4044eb3f4b7b467f0ec54e2a0.tar.gz |
(image-mode): Always set image-type.
(image-minor-mode): Likewise.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r-- | lisp/image-mode.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 638f2516741..a5298d8eaa7 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -321,7 +321,6 @@ You can use \\<image-mode-map>\\[image-toggle-display] to toggle between display as an image and display as text." (interactive) (kill-all-local-variables) - (setq mode-name "Image[text]") (setq major-mode 'image-mode) ;; Use our own bookmarking function for images. (set (make-local-variable 'bookmark-make-record-function) @@ -337,8 +336,11 @@ to toggle between display as an image and display as text." ;; Set next vars when image is already displayed but local ;; variables were cleared by kill-all-local-variables (use-local-map image-mode-map) - (setq cursor-type nil truncate-lines t)) + (setq cursor-type nil truncate-lines t + image-type (plist-get (cdr (image-get-display-property)) :type))) + (setq image-type "text") (use-local-map image-mode-text-map)) + (setq mode-name (format "Image[%s]" image-type)) (run-mode-hooks 'image-mode-hook) (if (display-images-p) (message "%s" (concat @@ -362,7 +364,8 @@ See the command `image-mode' for more information on this mode." (if (display-images-p) (if (not (image-get-display-property)) (image-toggle-display) - (setq cursor-type nil truncate-lines t)) + (setq cursor-type nil truncate-lines t + image-type (plist-get (cdr (image-get-display-property)) :type))) (setq image-type "text") (use-local-map image-mode-text-map)) (if (display-images-p) |