diff options
author | Juri Linkov <juri@jurta.org> | 2005-03-25 21:45:47 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2005-03-25 21:45:47 +0000 |
commit | 90d0be7d3f78333787e7e439a678542100490ae2 (patch) | |
tree | 95d0018eb5046d7402995f8e8d52f6c21b9cfebe /lisp/image-mode.el | |
parent | e0e6e9b80a853e1c8babead9c0c629e0f6072376 (diff) | |
download | emacs-90d0be7d3f78333787e7e439a678542100490ae2.tar.gz |
(image-minor-mode): Set `cursor-type' and `truncate-lines' if the
image is already displayed. Add turning image-minor-mode off to
`change-major-mode-hook'. Add message.
Call `image-toggle-display-text' after turning image-minor-mode off.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r-- | lisp/image-mode.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index c955a432148..b29027fcf42 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -79,8 +79,15 @@ See the command `image-mode' for more information on this mode." nil " Image" image-mode-map :group 'image :version "22.1" - (unless (or (eq major-mode 'image-mode) image-minor-mode) - (use-local-map image-mode-map))) + (if (not image-minor-mode) + (image-toggle-display-text) + (if (get-text-property (point-min) 'display) + (setq cursor-type nil truncate-lines t)) + (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t) + (message (concat (substitute-command-keys + "Type \\[image-toggle-display] to view the image as ") + (if (get-text-property (point-min) 'display) + "text" "an image") ".")))) ;;;###autoload (defun image-mode-maybe () |