GNU bug report logs - #35564
27.0.50; [PATCH] Tweak dired-do-shell-command warning about "wildcard" characters

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Sat, 4 May 2019 18:03:02 UTC

Severity: normal

Tags: fixed, moreinfo, patch

Merged with 28969

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


Message #154 received at 35564 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 35564 <at> debbugs.gnu.org,
 monnier <at> iro.umontreal.ca, npostavs <at> gmail.com
Subject: Re: bug#35564: [PATCH v4] Tweak dired warning about "wildcard"
 characters
Date: Mon, 19 Aug 2019 06:55:28 +0200
Juri Linkov <juri <at> linkov.net> writes:

> Now the missing case - how to do the same that ‘cat ./`?`’ does,
> i.e. how to substitute ‘*’ by marked files in such Dired prompt:
>
>   ! cat ./`*`
>     Confirm--do you mean to use ‘*’ as a wildcard? (y or n) y
>   $ cat ./`*` marked
>     /bin/bash: marked: command not found
>     cat: ./: Is a directory
>
> Why can't it run this shell command:
>
>   $ cat ./marked

AFAICT, because dired--star-or-qmark-p does not handle `*`:

> Isolated means that MATCH is surrounded by spaces or at the beginning/end
> of STRING followed/prefixed with an space.  A match to ‘`?`’,
> isolated or not, is also valid.

I've skimmed the docstrings and comments for dired--star-or-qmark-p,
dired-shell-stuff-it and dired-do-shell-command, but I could not find a
rationale for not handling that case.  git log -G'`\*`' hasn't finished
yet but so far it hasn't told me anything either.

If this is something we want[1], we can add it independently of this bug
report.  If no-one has committed it (or created a new bug report for it)
by the time I get back to coding, I might throw in a patch for that in
the series; chances are it might simplify the code somewhat, since ? and
* will then be handled similarly.

Thanks for the survey Juri!


[1] I see no reason not to support it, since otherwise the shell
    translates

        `*`

    into the command

        first-file-according-to-locale other-files…

    which doesn't strike me as very useful behaviour.  Substituting `*`
    for the file list, like we substitute `?` for each file, could make
    sense, e.g. for

        ! some-command "`*`"

    where some-command wants a space-separated file list as a single
    argument (though I can't come up with an actual command off the top
    of my head).




This bug report was last modified 4 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.