GNU bug report logs -
#28969
27.0.50; dired: Confirmation prompt for wildcard not surrounded by whitespace
Previous Next
Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Tue, 24 Oct 2017 16:42:02 UTC
Severity: normal
Tags: fixed, moreinfo, patch
Merged with 35564
Found in version 27.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Finally got around to try out rmc.el.
A brief recap of the issue: dired-do-shell-command looks out for any
non-isolated metacharacters[1], and prompts the user when it finds some.
The problem is that the prompt is downright misleading under some
circumstances. E.g. after marking some files in a Dired buffer:
! sed 's/?/!/g' RET
=> Confirm--do you mean to use `?' as a wildcard?
The answer a user must input to proceed is "yes", despite '?' not being
a wildcard in this situation; the answer some users may give intuitively
is "no" (or, in my case, "whaaa?").
This patch series initially tried to shove the command in the prompt,
highlight the non-isolated characters, and re-phrase the prompt to be
more accurate (i.e. not talk about wildcards).
It went through a several iterations for a few reasons[2]; most recently
Michael suggested using read-multiple-choice [bug#35564#136]; I looked
at how nsm.el uses it, saw that is was good, and got distracted for two
months.
Here is the new series:
[0001-Tweak-dired-warning-about-wildcard-characters.patch (text/x-patch, attachment)]
[0002-Dedup-dired-aux-isolated-char-searching-Bug-35564.patch (text/x-patch, attachment)]
[0003-Add-markers-below-non-isolated-chars-in-dired-prompt.patch (text/x-patch, attachment)]
[0004-Simplify-highlighting-assertions.patch (text/x-patch, attachment)]
[0005-Hide-detailed-explanations-in-a-togglable-help-buffe.patch (text/x-patch, attachment)]
[Message part 7 (text/plain, inline)]
Highlights:
- removed the patch for y-or-n-p, since we don't need it anymore,
- (squashed Noam's patch with my fixups,)
- the last patch contains the new stuff:
- the default prompt is now as concise as the old one,
- pressing 'd' toggles a help buffer which highlights occurrences
using the warning face,
- when the help buffer is enabled, pressing 'm' toggles the '^'
markers.
Squashed patch for convenience:
[0001-Tweak-dired-warning-about-wildcard-characters.patch (text/x-patch, attachment)]
[Message part 9 (text/plain, inline)]
To try the changes out, it's enough to reload dired-aux.el, mark a few
files in Dired, type e.g.
! sed 's/?/!/g' RET
… and play with the new prompt.
Let me know if this UI looks OK, and how the implementation may be
improved. Thank you for your patience.
Not addressed in this patch series:
- letting the user iterate over non-isolated occurrences and
selectively substitute them,
- allowing '*' to be substituted when surrounded by backquotes, just
like '?'.
I do find these features valuable (or at least worthy of discussion),
however the current bug reports were motivated merely by an inaccurate
warning; I'd like to close this first before considering further
changes.
[1] '?' when not surrounded by whitespace or backquotes,
'*' when not surrounded by whitespace.
[2] Trying to find the right balance between concision and accurate
explanation, considering that some users may not know about the
file-substitution feature; also trying to make the highlighting
"accessible", i.e. not just relying on colored faces.
This bug report was last modified 4 years and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.