;;; image-mode.el --- support for visiting image files
;;
-;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;;
;; Author: Richard Stallman <rms@gnu.org>
;; Keywords: multimedia
(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
(if (display-images-p)
- (if (not (get-text-property (point-min) 'display))
+ (if (not (image-get-display-property))
(image-toggle-display)
;; Set next vars when image is already displayed but local
;; variables were cleared by kill-all-local-variables
:version "22.1"
(if (not image-minor-mode)
(image-toggle-display-text)
- (if (image-get-display-property)
- (setq cursor-type nil truncate-lines t)
- (setq image-type "text"))
(image-mode-setup-winprops)
(add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
- (message "%s" (concat (substitute-command-keys
- "Type \\[image-toggle-display] to view the image as ")
- (if (image-get-display-property)
- "text" "an image") "."))))
+ (if (display-images-p)
+ (if (not (image-get-display-property))
+ (image-toggle-display)
+ (setq cursor-type nil truncate-lines t))
+ (setq image-type "text")
+ (use-local-map image-mode-text-map))
+ (if (display-images-p)
+ (message "%s" (concat
+ (substitute-command-keys
+ "Type \\[image-toggle-display] to view the image as ")
+ (if (image-get-display-property)
+ "text" "an image") ".")))))
;;;###autoload
(defun image-mode-maybe ()
(setq mode-name (format "Image[%s]" type)))
(if (called-interactively-p)
(message "Repeat this command to go back to displaying the file as text")))))
-
+\f
;;; Support for bookmark.el
(declare-function bookmark-make-record-default "bookmark"
(&optional point-only))
`((image-type . ,image-type)
(handler . image-bookmark-jump))))
-
-
;;;###autoload
(defun image-bookmark-jump (bmk)
;; This implements the `handler' function interface for record type
(prog1 (bookmark-default-handler bmk)
(when (not (string= image-type (bookmark-prop-get bmk 'image-type)))
(image-toggle-display))))
-
+\f
(provide 'image-mode)
;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb