diff options
| author | Chong Yidong | 2008-07-30 13:35:50 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-07-30 13:35:50 +0000 |
| commit | bb43424bfb80a3d2c397cc1bfacf1505eed88442 (patch) | |
| tree | aa79f5e0a474817c5aea2e498b722ee1035a2c3b | |
| parent | a2716a8e13e92676322111e45fa1f4b2624f32ed (diff) | |
| download | emacs-bb43424bfb80a3d2c397cc1bfacf1505eed88442.tar.gz emacs-bb43424bfb80a3d2c397cc1bfacf1505eed88442.zip | |
Set image-mode-text-map when image cannot be displayed.
| -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.") | |||
| 290 | (let ((map (make-sparse-keymap))) | 290 | (let ((map (make-sparse-keymap))) |
| 291 | (suppress-keymap map) | 291 | (suppress-keymap map) |
| 292 | (define-key map "q" 'quit-window) | 292 | (define-key map "q" 'quit-window) |
| 293 | ;; | ||
| 294 | (define-key map "\C-c\C-c" 'image-toggle-display) | 293 | (define-key map "\C-c\C-c" 'image-toggle-display) |
| 295 | (define-key map (kbd "SPC") 'image-scroll-up) | 294 | (define-key map (kbd "SPC") 'image-scroll-up) |
| 296 | (define-key map (kbd "DEL") 'image-scroll-down) | 295 | (define-key map (kbd "DEL") 'image-scroll-down) |
| 297 | ;; | ||
| 298 | (define-key map [remap forward-char] 'image-forward-hscroll) | 296 | (define-key map [remap forward-char] 'image-forward-hscroll) |
| 299 | (define-key map [remap backward-char] 'image-backward-hscroll) | 297 | (define-key map [remap backward-char] 'image-backward-hscroll) |
| 300 | (define-key map [remap previous-line] 'image-previous-line) | 298 | (define-key map [remap previous-line] 'image-previous-line) |
| @@ -333,13 +331,14 @@ to toggle between display as an image and display as text." | |||
| 333 | (image-mode-setup-winprops) | 331 | (image-mode-setup-winprops) |
| 334 | 332 | ||
| 335 | (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) | 333 | (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) |
| 336 | (if (and (display-images-p) | 334 | (if (display-images-p) |
| 337 | (not (image-get-display-property))) | 335 | (if (not (image-get-display-property)) |
| 338 | (image-toggle-display) | 336 | (image-toggle-display) |
| 339 | ;; Set next vars when image is already displayed but local | 337 | ;; Set next vars when image is already displayed but local |
| 340 | ;; variables were cleared by kill-all-local-variables | 338 | ;; variables were cleared by kill-all-local-variables |
| 341 | (use-local-map image-mode-map) | 339 | (use-local-map image-mode-map) |
| 342 | (setq cursor-type nil truncate-lines t)) | 340 | (setq cursor-type nil truncate-lines t)) |
| 341 | (use-local-map image-mode-text-map)) | ||
| 343 | (run-mode-hooks 'image-mode-hook) | 342 | (run-mode-hooks 'image-mode-hook) |
| 344 | (if (display-images-p) | 343 | (if (display-images-p) |
| 345 | (message "%s" (concat | 344 | (message "%s" (concat |