From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 2295@debbugs.gnu.org
Subject: bug#2295: Viewing archives with arc-mode changes directory time
Date: Fri, 28 Sep 2012 19:59:19 +0300 [thread overview]
Message-ID: <874nmi13tk.fsf_-_@mail.jurta.org> (raw)
In-Reply-To: <jwv63jg9y4y.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Wed, 11 Feb 2009 21:40:54 -0500")
>> 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:
>
> That sounds OK. We should provide at least a macro for that.
I don't know how this macro could look, but there is exactly the same
problem in arc-mode and tar-mode.el. Visiting an archive file modifies
the mtime of its directory. This can be fixed with the same method
as used to fix image-mode (by binding buffer-file-truename to nil):
=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el 2012-05-04 06:13:18 +0000
+++ lisp/arc-mode.el 2012-09-28 16:51:56 +0000
@@ -787,7 +789,8 @@ (defun archive-summarize (&optional shut
Optional argument SHUT-UP, if non-nil, means don't print messages
when parsing the archive."
(widen)
- (let ((inhibit-read-only t))
+ (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file
+ (inhibit-read-only t))
(setq archive-proper-file-start (copy-marker (point-min) t))
(set (make-local-variable 'change-major-mode-hook) 'archive-desummarize)
(or shut-up
=== modified file 'lisp/tar-mode.el'
--- lisp/tar-mode.el 2012-08-13 10:34:25 +0000
+++ lisp/tar-mode.el 2012-08-20 01:25:16 +0000
@@ -518,12 +518,13 @@ (defun tar-summarize-buffer ()
(progress-reporter-done progress-reporter)
(message "Warning: premature EOF parsing tar file"))
(goto-char (point-min))
- (let ((inhibit-read-only t)
+ (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file
+ (inhibit-read-only t)
(total-summaries
(mapconcat 'tar-header-block-summarize tar-parse-info "\n")))
- (insert total-summaries "\n"))
+ (insert total-summaries "\n")
(goto-char (point-min))
- (restore-buffer-modified-p modified)))
+ (restore-buffer-modified-p modified))))
\f
(defvar tar-mode-map
(let ((map (make-keymap)))
next prev parent reply other threads:[~2012-09-28 16:59 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 ` bug#2295: Viewing images with image-mode changes directory time Juri Linkov
2009-02-12 2:40 ` Stefan Monnier
2012-09-28 16:59 ` Juri Linkov [this message]
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=874nmi13tk.fsf_-_@mail.jurta.org \
--to=juri@jurta.org \
--cc=2295@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.