]> git.eshelyaron.com Git - emacs.git/commitdiff
* image-mode.el (image-mode): Display image as text on a terminal.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 28 Aug 2006 22:49:25 +0000 (22:49 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 28 Aug 2006 22:49:25 +0000 (22:49 +0000)
lisp/ChangeLog
lisp/image-mode.el

index ec5296ba0ca12ff57e986ef9ca15e0cdad103c34..b857f9e85ec0af6b70d9d226f01e0dcc9326c7e6 100644 (file)
@@ -1,3 +1,7 @@
+2006-08-28  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image-mode.el (image-mode): Display image as text on a terminal.
+
 2006-08-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/python.el (python-send-command): Simplify.
index 523ef3f73a845fcf73d25750a4204b348a357ccb..c84dbab371da94a324cd3ea28c1d21e3fec231c8 100644 (file)
@@ -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