aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-08-29 13:02:53 +0000
committerChong Yidong2006-08-29 13:02:53 +0000
commitab145daf37fde928424742bd87a55e67b09254bc (patch)
tree4f87d3754f4b7986a47c4c8ade5434abf9eba929
parent1a762140f1c8f02262bae85d50743ae37de62348 (diff)
downloademacs-ab145daf37fde928424742bd87a55e67b09254bc.tar.gz
emacs-ab145daf37fde928424742bd87a55e67b09254bc.zip
* image-mode.el (image-mode): Fix last fix.
Suggested by Kim F. Storm.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/image-mode.el27
2 files changed, 18 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1aeaf174e37..78e0ee532f6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12006-08-29 Chong Yidong <cyd@stupidchicken.com>
2
3 * image-mode.el (image-mode): Fix last fix.
4 Suggested by Kim F. Storm.
5
12006-08-29 Michael Albinus <michael.albinus@gmx.de> 62006-08-29 Michael Albinus <michael.albinus@gmx.de>
2 7
3 Sync with Tramp 2.0.54. 8 Sync with Tramp 2.0.54.
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."
60 (setq major-mode 'image-mode) 60 (setq major-mode 'image-mode)
61 (use-local-map image-mode-map) 61 (use-local-map image-mode-map)
62 (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) 62 (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
63 (let ((image-display-supported-p (memq window-system '(x w32 mac)))) 63 (if (and (display-images-p)
64 (if (and image-display-supported-p 64 (not (get-text-property (point-min) 'display)))
65 (not (get-text-property (point-min) 'display))) 65 (image-toggle-display)
66 (image-toggle-display) 66 ;; Set next vars when image is already displayed but local
67 ;; Set next vars when image is already displayed but local 67 ;; variables were cleared by kill-all-local-variables
68 ;; variables were cleared by kill-all-local-variables 68 (setq cursor-type nil truncate-lines t))
69 (setq cursor-type nil truncate-lines t)) 69 (run-mode-hooks 'image-mode-hook)
70 (run-mode-hooks 'image-mode-hook) 70 (if (display-images-p)
71 (if image-display-supported-p 71 (message "%s" (concat
72 (message "%s" (concat 72 (substitute-command-keys
73 (substitute-command-keys 73 "Type \\[image-toggle-display] to view the image as ")
74 "Type \\[image-toggle-display] to view the image as ") 74 (if (get-text-property (point-min) 'display)
75 (if (get-text-property (point-min) 'display) 75 "text" "an image") "."))))
76 "text" "an image") ".")))))
77 76
78;;;###autoload 77;;;###autoload
79(define-minor-mode image-minor-mode 78(define-minor-mode image-minor-mode