aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-08-28 22:49:25 +0000
committerChong Yidong2006-08-28 22:49:25 +0000
commit0e8b7151caab1f574ec2898bcad008afffc7e5db (patch)
treeec0a1041ab2c86234741e46702fec2fd36064734
parente2ac11eba7776e890e2668d7c74e9c0b0b860b8e (diff)
downloademacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.tar.gz
emacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.zip
* image-mode.el (image-mode): Display image as text on a terminal.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/image-mode.el24
2 files changed, 18 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ec5296ba0ca..b857f9e85ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12006-08-28 Chong Yidong <cyd@stupidchicken.com>
2
3 * image-mode.el (image-mode): Display image as text on a terminal.
4
12006-08-28 Stefan Monnier <monnier@iro.umontreal.ca> 52006-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * progmodes/python.el (python-send-command): Simplify. 7 * progmodes/python.el (python-send-command): Simplify.
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 523ef3f73a8..c84dbab371d 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -60,16 +60,20 @@ 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 (if (not (get-text-property (point-min) 'display)) 63 (let ((image-display-supported-p (memq window-system '(x w32 mac))))
64 (image-toggle-display) 64 (if (and image-display-supported-p
65 ;; Set next vars when image is already displayed but local 65 (not (get-text-property (point-min) 'display)))
66 ;; variables were cleared by kill-all-local-variables 66 (image-toggle-display)
67 (setq cursor-type nil truncate-lines t)) 67 ;; Set next vars when image is already displayed but local
68 (run-mode-hooks 'image-mode-hook) 68 ;; variables were cleared by kill-all-local-variables
69 (message "%s" (concat (substitute-command-keys 69 (setq cursor-type nil truncate-lines t))
70 "Type \\[image-toggle-display] to view the image as ") 70 (run-mode-hooks 'image-mode-hook)
71 (if (get-text-property (point-min) 'display) 71 (if image-display-supported-p
72 "text" "an image") "."))) 72 (message "%s" (concat
73 (substitute-command-keys
74 "Type \\[image-toggle-display] to view the image as ")
75 (if (get-text-property (point-min) 'display)
76 "text" "an image") ".")))))
73 77
74;;;###autoload 78;;;###autoload
75(define-minor-mode image-minor-mode 79(define-minor-mode image-minor-mode