diff options
| author | Chong Yidong | 2008-07-30 13:38:28 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-07-30 13:38:28 +0000 |
| commit | 698ab06b1655f00bb8705e1ed5ce83c10634079f (patch) | |
| tree | c9f5ac19f05cb2a8f0fe407e158cd9b4a96adc17 | |
| parent | 2f5687ffa9097882a57ea03d253cdb45636a2cb1 (diff) | |
| download | emacs-698ab06b1655f00bb8705e1ed5ce83c10634079f.tar.gz emacs-698ab06b1655f00bb8705e1ed5ce83c10634079f.zip | |
(image-mode): Set image-mode-text-map when image cannot be displayed.
| -rw-r--r-- | lisp/image-mode.el | 15 |
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." | |||
| 208 | (setq mode-name "Image") | 208 | (setq mode-name "Image") |
| 209 | (setq major-mode 'image-mode) | 209 | (setq major-mode 'image-mode) |
| 210 | (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) | 210 | (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) |
| 211 | (if (and (display-images-p) | 211 | (if (display-images-p) |
| 212 | (not (get-text-property (point-min) 'display))) | 212 | (if (not (image-get-display-property)) |
| 213 | (image-toggle-display) | 213 | (image-toggle-display) |
| 214 | ;; Set next vars when image is already displayed but local | 214 | ;; Set next vars when image is already displayed but local |
| 215 | ;; variables were cleared by kill-all-local-variables | 215 | ;; variables were cleared by kill-all-local-variables |
| 216 | (use-local-map image-mode-map) | 216 | (use-local-map image-mode-map) |
| 217 | (setq cursor-type nil truncate-lines t)) | 217 | (setq cursor-type nil truncate-lines t)) |
| 218 | (use-local-map image-mode-text-map)) | ||
| 218 | (run-mode-hooks 'image-mode-hook) | 219 | (run-mode-hooks 'image-mode-hook) |
| 219 | (if (display-images-p) | 220 | (if (display-images-p) |
| 220 | (message "%s" (concat | 221 | (message "%s" (concat |