all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: emacs-pretest-bug@gnu.org
Subject: bug#2295: Viewing images with image-mode changes directory time
Date: Thu, 12 Feb 2009 00:55:48 +0200	[thread overview]
Message-ID: <873aepkksk.fsf@jurta.org> (raw)

Using image-mode to visit image files touches directory modification
dates.  This is especially annoying when image files are in an old
archive.  The problem is in the function `add-text-properties' that
temporarily modifies the image buffer causing lock-file to create a lock
file in the current directory that modifies the directory timestamp.

As a solution I propose to let-bind `buffer-file-truename' to nil
around the call to `add-text-properties' to prevent directory time
modification:

Index: lisp/image-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-mode.el,v
retrieving revision 1.55
diff -c -r1.55 image-mode.el
*** lisp/image-mode.el	7 Feb 2009 15:29:14 -0000	1.55
--- lisp/image-mode.el	11 Feb 2009 22:52:35 -0000
***************
*** 457,464 ****
  	   (buffer-undo-list t)
  	   (modified (buffer-modified-p)))
        (image-refresh image)
!       (add-text-properties (point-min) (point-max) props)
!       (set-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)
--- 457,465 ----
  	   (buffer-undo-list t)
  	   (modified (buffer-modified-p)))
        (image-refresh image)
!       (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file
!         (add-text-properties (point-min) (point-max) props)
!         (set-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)

-- 
Juri Linkov
http://www.jurta.org/emacs/






             reply	other threads:[~2009-02-11 22:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <878wob496n.fsf@jurta.org>
2009-02-11 22:55 ` Juri Linkov [this message]
2009-02-12  2:40   ` bug#2295: Viewing images with image-mode changes directory time Stefan Monnier
2012-09-28 16:59     ` bug#2295: Viewing archives with arc-mode " Juri Linkov
2009-02-12 22:00   ` bug#2295: marked as done (Viewing images with image-mode changes directory time) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873aepkksk.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=2295@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.