changeset 80655:bfcd3905d0e4

(image-mode): Set image-mode-text-map when image cannot be displayed.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 30 Jul 2008 13:38:28 +0000
parents c2235fc45f89
children 28298210911d
files lisp/image-mode.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/image-mode.el	Wed Jul 30 13:37:27 2008 +0000
+++ b/lisp/image-mode.el	Wed Jul 30 13:38:28 2008 +0000
@@ -208,13 +208,14 @@
   (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