# HG changeset patch # User Chong Yidong # Date 1156805365 0 # Node ID 02a05917de2aac01b64fbda218b2310989257f8c # Parent b562a18db09491808a5ca5b8df177bc581db4bea * image-mode.el (image-mode): Display image as text on a terminal. diff -r b562a18db094 -r 02a05917de2a lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 28 21:58:27 2006 +0000 +++ b/lisp/ChangeLog Mon Aug 28 22:49:25 2006 +0000 @@ -1,3 +1,7 @@ +2006-08-28 Chong Yidong + + * image-mode.el (image-mode): Display image as text on a terminal. + 2006-08-28 Stefan Monnier * progmodes/python.el (python-send-command): Simplify. diff -r b562a18db094 -r 02a05917de2a lisp/image-mode.el --- a/lisp/image-mode.el Mon Aug 28 21:58:27 2006 +0000 +++ b/lisp/image-mode.el Mon Aug 28 22:49:25 2006 +0000 @@ -60,16 +60,20 @@ (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