# HG changeset patch # User Chong Yidong # Date 1217425108 0 # Node ID bfcd3905d0e46c49092487824dcf508b0a218d96 # Parent c2235fc45f890f22cf1871a098950c1dd218b727 (image-mode): Set image-mode-text-map when image cannot be displayed. diff -r c2235fc45f89 -r bfcd3905d0e4 lisp/image-mode.el --- 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