From: Juri Linkov <juri@linkov.net>
To: 30215@debbugs.gnu.org
Subject: bug#30215: Visiting files from zip archives should not modify directory time
Date: Mon, 22 Jan 2018 23:52:48 +0200 [thread overview]
Message-ID: <87mv157e8f.fsf@mail.linkov.net> (raw)
Visiting a file from zip archive changes the modification time of
its directory. It's possible to prevent directory time modification
by setting ‘buffer-file-truename’ later after the extractor prepares
the file in its buffer:
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index adb3669..d6add45 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1045,8 +1045,6 @@ archive-extract
(setq just-created t)
(with-current-buffer buffer
(setq buffer-file-name arcfilename)
- (setq buffer-file-truename
- (abbreviate-file-name buffer-file-name))
;; Set the default-directory to the dir of the superior buffer.
(setq default-directory arcdir)
(make-local-variable 'archive-superior-buffer)
@@ -1077,6 +1075,9 @@ archive-extract
(progn
(set-buffer-modified-p nil)
(kill-buffer buffer))
+ ;; Set this later to avoid changing dir mtime by lock_file
+ (setq buffer-file-truename
+ (abbreviate-file-name buffer-file-name))
(archive-try-jka-compr) ;Pretty ugly hack :-(
(archive-set-buffer-as-visiting-file ename)
(goto-char (point-min))
next reply other threads:[~2018-01-22 21:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 21:52 Juri Linkov [this message]
2018-01-23 16:41 ` bug#30215: Visiting files from zip archives should not modify directory time Eli Zaretskii
2018-01-23 21:29 ` Juri Linkov
2018-01-24 18:44 ` Eli Zaretskii
2018-01-24 21:36 ` Juri Linkov
2018-01-25 3:30 ` Eli Zaretskii
2018-01-25 21:41 ` Juri Linkov
2018-01-26 7:59 ` Eli Zaretskii
2018-01-27 21:16 ` Juri Linkov
2018-01-28 17:23 ` Eli Zaretskii
2018-01-28 21:28 ` Juri Linkov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mv157e8f.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=30215@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).