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: Wed, 24 Jan 2018 23:36:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> If that's the problem, then I think it would be cleaner to disable
> creation of lock files and backup files by less subtle means -- by
> let-binding create-lockfiles and make-backup-files.  Doing that by
> leaving buffer-file-truename at nil leaves the code less clear IMO,
> and relies on assumptions that might not hold at some future point.

Thanks for the suggestion, this is better indeed:

diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index adb3669..4fe1b03 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -807,7 +807,7 @@ archive-summarize
 Optional argument SHUT-UP, if non-nil, means don't print messages
 when parsing the archive."
   (widen)
-  (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file
+  (let ((create-lockfiles 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)
@@ -1064,7 +1064,9 @@ archive-extract
                      ;; We read an archive member by no-conversion at
                      ;; first, then decode appropriately by calling
                      ;; archive-set-buffer-as-visiting-file later.
-                     (coding-system-for-read 'no-conversion))
+                     (coding-system-for-read 'no-conversion)
+                     ;; Avoid changing dir mtime by lock_file
+                     (create-lockfiles nil))
                  (condition-case err
                      (if (fboundp extractor)
                          (funcall extractor archive ename)





reply via email to

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