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, 19 Aug 2019 06:55:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Juri Linkov <address@hidden> 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).





reply via email to

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