1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix visiting zip archives inside tar archives

* lisp/tar-mode.el (tar-archive-from-tar): New local variable.
(tar-extract): Set it non-nil for an extracted member that happens
to be arc-mode archive.
* lisp/arc-mode.el (tar-archive-from-tar): Defvar it.
(archive-unique-fname): Make sure FNAME can be created in DIR,
even if FNAME is provided as an absolute file name (this happens
if the archive is a member of a Tar archive, for example).
(archive-extract): Set 'archive-remote' for archives that were
extracted from Tar archives.  (Bug#70987)
This commit is contained in:
Eli Zaretskii 2024-05-20 15:29:39 +03:00
parent 18457c64b0
commit 45916eadae
2 changed files with 16 additions and 1 deletions

View file

@ -135,6 +135,10 @@ This information is useful, but it takes screen space away from file names."
(put 'tar-superior-buffer 'permanent-local t)
(put 'tar-superior-descriptor 'permanent-local t)
(defvar tar-archive-from-tar nil
"Non-nil if an arc-mode archive file is a member of a tar archive.")
(put tar-archive-from-tar 'permanent-local t)
;; The Tar data is made up of bytes and better manipulated as bytes
;; and can be very large, so insert/delete can be costly. The summary we
;; want to display may contain non-ascii chars, of course, so we'd like it
@ -1124,6 +1128,8 @@ return nil. Otherwise point is returned."
default-directory))
(set-buffer-modified-p nil)
(normal-mode) ; pick a mode.
(when (derived-mode-p 'archive-mode)
(setq-local tar-archive-from-tar t))
(setq-local tar-superior-buffer tar-buffer)
(setq-local tar-superior-descriptor descriptor)
(setq buffer-read-only read-only-p)