# HG changeset patch # User Andreas Schwab # Date 1234020551 0 # Node ID 5cb3814c8e09b629375c99c96c44b86d0859fe51 # Parent 288dd91ca0c153934d7983076fc0ae8afa9a6918 (image-mode): Always set image-type. (image-minor-mode): Likewise. diff -r 288dd91ca0c1 -r 5cb3814c8e09 lisp/ChangeLog --- a/lisp/ChangeLog Sat Feb 07 15:16:57 2009 +0000 +++ b/lisp/ChangeLog Sat Feb 07 15:29:11 2009 +0000 @@ -1,3 +1,8 @@ +2009-02-07 Andreas Schwab + + * image-mode.el (image-mode): Always set image-type. + (image-minor-mode): Likewise. + 2009-02-07 Eli Zaretskii * mail/rmailedit.el (rmail-cease-edit): Look for the message's diff -r 288dd91ca0c1 -r 5cb3814c8e09 lisp/image-mode.el --- a/lisp/image-mode.el Sat Feb 07 15:16:57 2009 +0000 +++ b/lisp/image-mode.el Sat Feb 07 15:29:11 2009 +0000 @@ -321,7 +321,6 @@ 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 @@ ;; 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 @@ (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)