From: Boruch Baum <boruch_baum@gmx.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48072@debbugs.gnu.org, kevin.legouguec@gmail.com
Subject: bug#48072: 28.0.50: dired-read-shell-command: handle empty input properly [PATCH]
Date: Wed, 28 Apr 2021 11:01:44 -0400 [thread overview]
Message-ID: <20210428150144.4uxrcguggkh7vrjx@E15-2016.optimum.net> (raw)
In-Reply-To: <83mttiftnl.fsf@gnu.org>
On 2021-04-28 16:03, Eli Zaretskii wrote:
> > Date: Wed, 28 Apr 2021 08:49:52 -0400
> > From: Boruch Baum <boruch_baum@gmx.com>
> > Cc: kevin.legouguec@gmail.com, 48072@debbugs.gnu.org
> >
> > On 2021-04-28 14:58, Eli Zaretskii wrote:
> > > > Date: Wed, 28 Apr 2021 05:50:54 -0400
> > > > From: Boruch Baum <boruch_baum@gmx.com>
> > > > Cc: Eli Zaretskii <eliz@gnu.org>, 48072@debbugs.gnu.org
> > > >
> > > > I could restrict the check to the preparation of list of completion
> > > > candidates for the defaults put into the mini-buffer history (already
> > > > done in diredc, as an advice around function dired-guess-default), and
> > > > give dired users feedback when a command returns an error condition (on
> > > > this week's plan anyway).
> > >
> > > I'm not sure I understand what you are suggesting. Do you mean set up
> > > the completion candidates so that they would only include executable
> > > files found on the system, but allow users also to type commands that
> > > are not among the completion candidates? I think this could be
> > > confusing, and I don't think we have a precedent for such a behavior
> > > elsewhere.
> >
> > I don't understand what your point of confusion is, but it's your call,
> > of course. Your position has emacs offering users impossible choices,
> > choices guaranteed to fail.
>
> I'm asking you to help me understand the details of restricting the
> check that you are proposing. Once I understand that, I could make up
> my mind about the proposal. Right now I simply don't understand it.
You had that idea correct in your prior paragraph, where your wrote:
"set up the completion candidates so that they would only include
executable files found on the system, but allow users also to type
commands that are not among the completion candidates"
What I can add is:
1) the completion candidates would be the subset of elements of the emacs
variables `dired-guess-shell-alist-user' and
`dired-guess-shell-alist-default' (diredc adds `diredc-shell-guess-fallback')
which satisfy function `executable-find';
2) the user would face no constraint whatsoever in what could be entered.
2.1) I have mixed feelings about this, because for asynchronous operations
any typographic error silently fails and yields a misleading message
that can easily be interpreted as a successful completion.
2.1.1) Try the following in a vanilla dired buffer: Navigate POINT to a file,
let's say 'bar', and press '&' for the async command. Then type in some
garbage command, let's say 'foo', and <RET>. The response I get is a
message in the mini-buffer: "foo bar&wait: finished." (BTW, I haven't
figured out where that message is being generated; anyone's help would be
appreciated; I would like to see if it can report errors).
2.1.2) It would be nice to get feedback from dired power users about how they
use the '!' and '&' commands in practice. My experience and observation
is that even power users use those commands for straightforward
operations and use shell built-ins from either a shell buffer or a
shell-script buffer. (note that some built-ins also have corresponding
executables, eg '[').
2.1.3) My gut feeling is that everyone will appreciate getting feedback on an
invalid command, and no-one would mind not being able to use shell
built-ins. Thus, I prefer having the constraint.
2.2) The constraint as written only checks the initial atom of the command line,
so it wouldn't catch "sort ? | uniqqq".
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
next prev parent reply other threads:[~2021-04-28 15:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-27 19:02 bug#48072: 28.0.50: dired-read-shell-command: handle empty input properly [PATCH] Boruch Baum
2021-04-27 19:19 ` Eli Zaretskii
2021-04-27 19:32 ` Boruch Baum
2021-04-28 2:22 ` Eli Zaretskii
2021-04-28 3:00 ` Boruch Baum
2021-04-28 6:19 ` Kévin Le Gouguec
2021-04-28 9:33 ` Boruch Baum
2021-04-28 9:50 ` Boruch Baum
2021-04-28 11:58 ` Eli Zaretskii
2021-04-28 12:49 ` Boruch Baum
2021-04-28 13:03 ` Eli Zaretskii
2021-04-28 15:01 ` Boruch Baum [this message]
2021-04-28 15:13 ` Eli Zaretskii
2021-04-28 15:21 ` Boruch Baum
2021-04-28 15:52 ` Eli Zaretskii
2021-04-28 17:10 ` Michael Albinus
2021-04-28 15:16 ` Boruch Baum
2021-04-28 11:47 ` Eli Zaretskii
2021-04-28 11:03 ` Michael Albinus
2021-04-28 12:00 ` Boruch Baum
2021-04-28 12:13 ` Michael Albinus
2021-04-28 12:46 ` Boruch Baum
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=20210428150144.4uxrcguggkh7vrjx@E15-2016.optimum.net \
--to=boruch_baum@gmx.com \
--cc=48072@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=kevin.legouguec@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).