changeset 101986:aab85e9d78b6

(image-toggle-display): Let-bind `buffer-file-truename' to nil around the call to `add-text-properties' to prevent directory time modification by lock_file. Replace `set-buffer-modified-p' with `restore-buffer-modified-p'. (Bug#2295)
author Juri Linkov <juri@jurta.org>
date Thu, 12 Feb 2009 21:48:55 +0000
parents 82f3d6b4d8c1
children ed50bbe67a12
files lisp/image-mode.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/image-mode.el	Thu Feb 12 18:20:52 2009 +0000
+++ b/lisp/image-mode.el	Thu Feb 12 21:48:55 2009 +0000
@@ -457,8 +457,9 @@
 	   (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)