diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-07-30 13:35:50 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-07-30 13:35:50 +0000 |
commit | bb1244d19550d1b9a643589395f9795a5543b41b (patch) | |
tree | b9d9ba068261ea50ac03662e5aaa476a740c8b95 /lisp/image-mode.el | |
parent | 2eb75d4f8710eb04bb73d93634d7a4ec53a3137d (diff) | |
download | emacs-bb1244d19550d1b9a643589395f9795a5543b41b.tar.gz |
Set image-mode-text-map when image cannot be displayed.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r-- | lisp/image-mode.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 78b4ab53547..6687ed3fed4 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -290,11 +290,9 @@ This variable is used to display the current image type in the mode line.") (let ((map (make-sparse-keymap))) (suppress-keymap map) (define-key map "q" 'quit-window) - ;; (define-key map "\C-c\C-c" 'image-toggle-display) (define-key map (kbd "SPC") 'image-scroll-up) (define-key map (kbd "DEL") 'image-scroll-down) - ;; (define-key map [remap forward-char] 'image-forward-hscroll) (define-key map [remap backward-char] 'image-backward-hscroll) (define-key map [remap previous-line] 'image-previous-line) @@ -333,13 +331,14 @@ to toggle between display as an image and display as text." (image-mode-setup-winprops) (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) - (if (and (display-images-p) - (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)) + (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 |