all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30215: Visiting files from zip archives should not modify directory time
@ 2018-01-22 21:52 Juri Linkov
  2018-01-23 16:41 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2018-01-22 21:52 UTC (permalink / raw)
  To: 30215

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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-28 21:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 21:52 bug#30215: Visiting files from zip archives should not modify directory time Juri Linkov
2018-01-23 16:41 ` 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

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.