summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-07-30 13:38:28 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-07-30 13:38:28 +0000
commit698ab06b1655f00bb8705e1ed5ce83c10634079f (patch)
treec9f5ac19f05cb2a8f0fe407e158cd9b4a96adc17 /lisp/image-mode.el
parent2f5687ffa9097882a57ea03d253cdb45636a2cb1 (diff)
downloademacs-698ab06b1655f00bb8705e1ed5ce83c10634079f.tar.gz
(image-mode): Set image-mode-text-map when image cannot be displayed.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 6891796d122..b903d497ec0 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -208,13 +208,14 @@ to toggle between display as an image and display as text."
(setq mode-name "Image")
(setq major-mode 'image-mode)
(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
- (if (and (display-images-p)
- (not (get-text-property (point-min) 'display)))
- (image-toggle-display)
- ;; 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))
+ (if (display-images-p)
+ (if (not (image-get-display-property))
+ (image-toggle-display)
+ ;; 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))
+ (use-local-map image-mode-text-map))
(run-mode-hooks 'image-mode-hook)
(if (display-images-p)
(message "%s" (concat