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

> From: Leo Liu <sdl.web@gmail.com>
> Date: Sun, 28 May 2023 10:40:16 +0800
> 
> 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.
> `----

That's not the same, but I get the intent.

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

Where are you when I'm trying to convince people on emacs-devel not to
install such 50% solutions?  If every marginally-useful change that
can "potentially" help someone is press-pushed into the code base,
with the main reason being "why not?", the result is what you observe.
But almost no one tries to see this in advance when half-baked changes
are brought up, so stuff gets in.  Help in reviewing extensions and
noticing such marginal solutions will be greatly appreciated.

But I digress.

> There is no alternative at the moment other than redefining
> dired-guess-default.

But your suggestion is also a change in that function, so what's the
difference?

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

Can't you generate the entire value of dired-guess-shell-alist-user
dynamically, including the RE part?

Anyway, you are requesting a new feature: that the elements of the
alist could be of the form (REGEXP (COMMAND1 COMMAND2 ...)).  I don't
see how this makes dired-guess-shell-alist-user more coherent, but I
have nothing against such an extension.  However, it's too late for
such extensions on the emacs-29 release branch, so it could only go to
master, for Emacs 30.  And it should be properly documented, of
course.





  reply	other threads:[~2023-05-28  6:27 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
2023-05-28  6:27     ` Eli Zaretskii [this message]
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=83jzwthsx5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63744@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /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).