lisp/cedet/semantic/db-typecache.el (semanticdb-typecache)
[bpt/emacs.git] / lisp / image-mode.el
index 638f251..b751652 100644 (file)
@@ -321,7 +321,6 @@ You can use \\<image-mode-map>\\[image-toggle-display]
 to toggle between display as an image and display as text."
   (interactive)
   (kill-all-local-variables)
-  (setq mode-name "Image[text]")
   (setq major-mode 'image-mode)
   ;; Use our own bookmarking function for images.
   (set (make-local-variable 'bookmark-make-record-function)
@@ -337,8 +336,11 @@ to toggle between display as an image and display as text."
        ;; Set next vars when image is already displayed but local
        ;; variables were cleared by kill-all-local-variables
        (use-local-map image-mode-map)
-       (setq cursor-type nil truncate-lines t))
+       (setq cursor-type nil truncate-lines t
+             image-type (plist-get (cdr (image-get-display-property)) :type)))
+    (setq image-type "text")
     (use-local-map image-mode-text-map))
+  (setq mode-name (format "Image[%s]" image-type))
   (run-mode-hooks 'image-mode-hook)
   (if (display-images-p)
       (message "%s" (concat
@@ -362,7 +364,8 @@ See the command `image-mode' for more information on this mode."
     (if (display-images-p)
        (if (not (image-get-display-property))
            (image-toggle-display)
-         (setq cursor-type nil truncate-lines t))
+         (setq cursor-type nil truncate-lines t
+               image-type (plist-get (cdr (image-get-display-property)) :type)))
       (setq image-type "text")
       (use-local-map image-mode-text-map))
     (if (display-images-p)
@@ -454,8 +457,9 @@ and showing the image as an image."
           (buffer-undo-list t)
           (modified (buffer-modified-p)))
       (image-refresh image)
-      (add-text-properties (point-min) (point-max) props)
-      (set-buffer-modified-p modified)
+      (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file
+       (add-text-properties (point-min) (point-max) props)
+       (restore-buffer-modified-p modified))
       ;; Inhibit the cursor when the buffer contains only an image,
       ;; because cursors look very strange on top of images.
       (setq cursor-type nil)