From: Juri Linkov Date: Thu, 12 Feb 2009 21:49:29 +0000 (+0000) Subject: (image-toggle-display): Let-bind `buffer-file-truename' to nil around the X-Git-Tag: emacs-pretest-23.0.91~254 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6c34bcde1e907318c58bb7af3583a8e76ce37b6a;p=emacs.git (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) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 041c0dd59ea..a0533e6558b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2009-02-12 Juri Linkov + + * image-mode.el (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) + 2009-02-12 Stefan Monnier * progmodes/python.el (python-use-skeletons): Re-add. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index a5298d8eaa7..b7516522670 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -457,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)