bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30215: Visiting files from zip archives should not modify directory


From: Juri Linkov
Subject: bug#30215: Visiting files from zip archives should not modify directory time
Date: Mon, 22 Jan 2018 23:52:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

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))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]