bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters


From: Kévin Le Gouguec
Subject: bug#35564: [PATCH v4] Tweak dired warning about "wildcard" characters
Date: Mon, 29 Jul 2019 21:01:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I dunno if the double emphasizing in the y-n-prompt (coloring +
> additional underlining with "^") is a bit too much.

The patch series started out with just the coloring, which we figured
might have accessibility issues on its own (we can't assume that the
user can distinguish colors); we added the '^' markers to alleviate
this; then…

> A bit related:
> Maybe the second line could be combined with the first line so that one
> line is saved.

(Assuming the first line you mention is "Confirm" and the second line is
the command, which would make the '^' markers the third line; apologies
if I misunderstood)

… I realized that when the user fails to answer 'y' or 'n', y-or-n-p
prepends "Please answer y or n." to the prompt, i.e. this…

    sed 's/?/!/'
           ^

… becomes this:

    Please answer y or n.  sed 's/?/!/'
           ^

AFAICT, this means that we need a newline *before* the command (unless
we add an optional RETRY-PROMPT argument to y-or-n-p or something).

(I added comments to try to explain this in dired--no-subst-prompt; tell
me if they need more work.)

> I mean, the prompt is four lines high with this change,
> quite a lot.  Dunno what others think about it.

It is fairly more heavyweight than before.

And the irony is, I am still not 100% satisfied with it; I worry that
the user will take "Send 1 occurrence of `*' as-is to shell?" to mean
"Escape 1 occurrence of `*' so that the shell leaves it as-is?".

Tell me if the shed is about to crumble under the weight of paint, but
if we are fine with so many lines, could we perhaps rephrase…

> Confirm
> sed 's/?/!/'
>        ^
> Send 1 occurrence of `?' as-is to shell?

… to:

> Warning: the shell may interpret 1 occurrence of `?' as wildcard:
> sed 's/?/!/'
>        ^
> Proceed anyway?

Attachment: 0001-Tweak-dired-do-shell-command-warning-some-more.patch
Description: Text Data

(Can be applied on top of the patch series or the squashed patch; if the
latter, the commit message can be discarded.  Tests unchanged, since
they only look at the command and the markers.)

If everybody likes the prompt well enough without this umpteenth tweak,
it's fine by me.

Thank you all for your patience.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]