unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Eliachevitch <m.eliachevitch@posteo.de>
Cc: 66532-done@debbugs.gnu.org
Subject: bug#66532: 29.1; dired-guess-default command for tar.zst file fails
Date: Wed, 25 Oct 2023 16:33:17 +0300	[thread overview]
Message-ID: <831qdikesi.fsf@gnu.org> (raw)
In-Reply-To: <877cnp57v9.fsf@posteo.de> (message from Michael Eliachevitch on Sat, 14 Oct 2023 18:41:52 +0000)

> From: Michael Eliachevitch <m.eliachevitch@posteo.de>
> Cc: 66532@debbugs.gnu.org
> Date: Sat, 14 Oct 2023 18:41:52 +0000
> 
> 
> 
> > Does the patch below fix this?
> >
> > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
> > index fc3f6f4..458acad 100644
> > --- a/lisp/dired-aux.el
> > +++ b/lisp/dired-aux.el
> > @@ -1172,7 +1172,7 @@ dired-guess-shell-alist-default
> >           "unxz")
> >
> >     ;; zstandard archives
> > -   `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -")
> > +   `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c * | tar -xf -")
> >     `(,(rx ".zst" eos)                  "unzstd --rm")
> >
> >     '("\\.shar\\.Z\\'" "zcat * | unshar")
> 
> 
> Yes, this patch works for me for a single tar.zst archive.
> 
> However, when I mark multiple tar.zst archives and then run the
> suggested shell command (with *) on all of them, only the first archive
> gets extracted.. I just opened the Emacs manual dired section and found
> the `?' is a placeholder for which the command gets executed separately
> for each marked file. So with
> 
>     unzstd -c ? | tar -xf -
> 
> each marked archive gets successfully extracted. Here also formatted as a patch;
> 
> diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
> index 2ff620065a5..e0bcae6b005 100644
> --- a/lisp/dired-aux.el
> +++ b/lisp/dired-aux.el
> @@ -1176,7 +1176,7 @@ dired-guess-shell-alist-default
>           "unxz")
> 
>     ;; zstandard archives
> -   `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c %i | tar -xf -")
> +   `(,(rx (or ".tar.zst" ".tzst") eos) "unzstd -c ? | tar -xf -")
>     `(,(rx ".zst" eos)                  "unzstd --rm")
> 
>     '("\\.shar\\.Z\\'" "zcat * | unshar")
> 
> I am just wondering that I didn't find the questionmark placeholder in
> any of the other suggested commands for compressed tar files, not sure
> if they work fur multiple marked files, I didn't test that.

Thanks, I installed your variant on the emacs-29 branch, and I'm
therefore closing this bug.





      reply	other threads:[~2023-10-25 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 11:54 bug#66532: 29.1; dired-guess-default command for tar.zst file fails Michael Eliachevitch
2023-10-14  6:24 ` Eli Zaretskii
2023-10-14 18:41   ` Michael Eliachevitch
2023-10-25 13:33     ` Eli Zaretskii [this message]

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=831qdikesi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66532-done@debbugs.gnu.org \
    --cc=m.eliachevitch@posteo.de \
    /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).