diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2006-08-28 22:49:25 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2006-08-28 22:49:25 +0000 |
commit | 0e8b7151caab1f574ec2898bcad008afffc7e5db (patch) | |
tree | ec0a1041ab2c86234741e46702fec2fd36064734 /lisp/image-mode.el | |
parent | e2ac11eba7776e890e2668d7c74e9c0b0b860b8e (diff) | |
download | emacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.tar.gz emacs-0e8b7151caab1f574ec2898bcad008afffc7e5db.tar.bz2 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.el | 24 |
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." (setq major-mode 'image-mode) (use-local-map image-mode-map) (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) - (if (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) - (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") "."))) + (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") "."))))) ;;;###autoload (define-minor-mode image-minor-mode |