;;; 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
(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))
+ (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)
- (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 (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
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))))
(if (get-text-property (point-min) 'display)
(image-toggle-display)))
+(defvar archive-superior-buffer)
+(defvar tar-superior-buffer)
+
(defun image-toggle-display ()
"Start or stop displaying an image file as the actual image.
This command toggles between showing the text of the image file
;; was inserted
(let* ((image
(if (and (buffer-file-name)
+ (not (file-remote-p (buffer-file-name)))
(not (buffer-modified-p))
(not (and (boundp 'archive-superior-buffer)
archive-superior-buffer))