summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-08-29 13:02:53 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-08-29 13:02:53 +0000
commitab145daf37fde928424742bd87a55e67b09254bc (patch)
tree4f87d3754f4b7986a47c4c8ade5434abf9eba929 /lisp/image-mode.el
parent1a762140f1c8f02262bae85d50743ae37de62348 (diff)
downloademacs-ab145daf37fde928424742bd87a55e67b09254bc.tar.gz
* image-mode.el (image-mode): Fix last fix.
Suggested by Kim F. Storm.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el27
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index c84dbab371d..66f719ae1eb 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -60,20 +60,19 @@ to toggle between display as an image and display as text."
(setq major-mode 'image-mode)
(use-local-map image-mode-map)
(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
- (let ((image-display-supported-p (memq window-system '(x w32 mac))))
- (if (and image-display-supported-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
- (setq cursor-type nil truncate-lines t))
- (run-mode-hooks 'image-mode-hook)
- (if image-display-supported-p
- (message "%s" (concat
- (substitute-command-keys
- "Type \\[image-toggle-display] to view the image as ")
- (if (get-text-property (point-min) 'display)
- "text" "an image") ".")))))
+ (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
+ (setq cursor-type nil truncate-lines t))
+ (run-mode-hooks 'image-mode-hook)
+ (if (display-images-p)
+ (message "%s" (concat
+ (substitute-command-keys
+ "Type \\[image-toggle-display] to view the image as ")
+ (if (get-text-property (point-min) 'display)
+ "text" "an image") "."))))
;;;###autoload
(define-minor-mode image-minor-mode