unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Liu <sdl.web@gmail.com>
To: 63744@debbugs.gnu.org
Subject: bug#63744: 28.2; fix dired-guess-default
Date: Sun, 28 May 2023 10:40:16 +0800	[thread overview]
Message-ID: <m1cz2l2n73.fsf@gmail.com> (raw)
In-Reply-To: <m1h6ry2z4o.fsf@gmail.com>

On 2023-05-27 09:49 +0300, Eli Zaretskii wrote:
[snipped 10 lines]
> What is the semantics of a list of strings in this case?
> shell-command takes a single string as its argument COMMAND, it
> doesn't take a list of strings.

See the documentation of dired-guess-default.

,----
| Return a shell command, or a list of commands, appropriate for FILES.
`----

[snipped 10 lines]
> I'd rather not proliferate an undocumented "feature" that is merely a
> side effect of the particular implementation we had at some point,
> without understanding what it gives us. 

I agree in principle.

> The alternative is for you to change your customization so that EXP
> returns the car of the list it returned before, and that should be
> both easy and backward-compatible, AFAIU.

Unfortunately many (or most) things in Emacs grow from a 50% solution.
There is no alternative at the moment other than redefining
dired-guess-default.

If you have a static list it can be expressed as an element in
dired-guess-shell-alist-user as such:

   (RE "STR1" "STR2" ...)

If you have a dynamic list (for example a list from querying the OS) you
are stuck. The patch makes this possible and in my view makes
dired-guess-shell-alist-user more coherent. (RE "STR1" "STR2" ...) can
be regarded as another syntax for

   (RE ("STR1" "STR2" ...))

WDYT?






  reply	other threads:[~2023-05-28  2:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27  4:10 bug#63744: 28.2; fix dired-guess-default Leo Liu
2023-05-27  6:49 ` Eli Zaretskii
2023-05-28  2:40   ` Leo Liu [this message]
2023-05-28  6:27     ` Eli Zaretskii
2023-05-29  1:23       ` Michael Heerdegen
2023-05-29  3:49         ` Leo Liu
2023-05-29 12:38           ` Eli Zaretskii
2023-05-30  0:04             ` Michael Heerdegen
2023-05-29 12:07         ` Eli Zaretskii
2023-05-29 18:20           ` Leo Liu
2023-05-29 18:27             ` Eli Zaretskii
2023-05-30  0:24               ` Michael Heerdegen
2023-05-30  2:36                 ` Eli Zaretskii
2023-06-02  0:14       ` Michael Heerdegen
2023-06-02  4:28         ` Leo Liu

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=m1cz2l2n73.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=63744@debbugs.gnu.org \
    /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).