aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorChong Yidong2006-08-28 22:49:25 +0000
committerChong Yidong2006-08-28 22:49:25 +0000
commit0e8b7151caab1f574ec2898bcad008afffc7e5db (patch)
treeec0a1041ab2c86234741e46702fec2fd36064734 /lisp/image-mode.el
parente2ac11eba7776e890e2668d7c74e9c0b0b860b8e (diff)
downloademacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.tar.gz
emacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.zip
* image-mode.el (image-mode): Display image as text on a terminal.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el24
1 files changed, 14 insertions, 10 deletions
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