]> code.delx.au - gnu-emacs/blobdiff - lisp/image-mode.el
(ispell-keep-choices-win, ispell-dictionary-alist, ispell-word,
[gnu-emacs] / lisp / image-mode.el
index c84dbab371da94a324cd3ea28c1d21e3fec231c8..eb08de1d6bbb12c7d0ba64d7be96a3296cdb42bf 100644 (file)
@@ -1,6 +1,6 @@
 ;;; image-mode.el --- support for visiting image files
 ;;
-;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 ;;
 ;; Author: Richard Stallman <rms@gnu.org>
 ;; Keywords: multimedia
@@ -60,20 +60,19 @@ 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)
-  (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") ".")))))
+  (if (and (display-images-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 (display-images-p)
+      (message "%s" (concat
+                    (substitute-command-keys
+                     "Type \\[image-toggle-display] to view as ")
+                    (if (get-text-property (point-min) 'display)
+                        "text" "an image") "."))))
 
 ;;;###autoload
 (define-minor-mode image-minor-mode
@@ -112,7 +111,8 @@ information on these modes."
                         elt))
                     auto-mode-alist))))
     (if (assoc-default buffer-file-name mode-alist 'string-match)
-       (let ((auto-mode-alist mode-alist))
+       (let ((auto-mode-alist mode-alist)
+             (magic-mode-alist nil))
          (set-auto-mode)
          (image-minor-mode t))
       (image-mode))))