From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, Stefan Monnier <monnier@gnu.org>,
71078@debbugs.gnu.org, Dan Jacobson <jidanni@jidanni.org>
Subject: bug#71078: rgrep accepts wildcard, then throws it away
Date: Tue, 21 May 2024 11:30:59 -0400 [thread overview]
Message-ID: <jwvr0dv9oht.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADwFkmkTe+ih9dPEfzHXSEbn4ep+J9p2GSgtxksQfA=d-phCQQ@mail.gmail.com> (Stefan Kangas's message of "Mon, 20 May 2024 17:26:08 +0000")
> (read-directory-name "Base directory: "
> nil default-directory t)
>
> If I give an input like "/tmp* RET" at the prompt, it returns "/tmp/".
>
> What's confusing to me is this part in the docstring of
> `read-directory-name':
>
> Fourth arg MUSTMATCH non-nil means require existing directory’s name.
> Non-nil and non-t means also require confirmation after completion.
>
> I think "require existing directory’s name" should be clarified to say:
> "require the user to input an existing directory's name", if that is
> indeed the intention here.
That's indeed the intention (and the way I read it, that's what it says).
> That it removes the "*" character seems to be undocumented, but if
> that's the intended behaviour perhaps it should be clarified too. Hmm.
It does not remove the *. What you're seeing is the effect of
completion (and `partial-completion` treats the * as a wildcard for
completion purposes) so you can also just type `/tm` and it should
return the same thing (provided `/tmp/` is the sole completion).
> I think this is expected, and not a bug, due to this part in grep.el:
>
> (unless (and dir (file-accessible-directory-p dir))
> (setq dir default-directory))
>
> I'd rather it would signal an error in this case, to be honest, because
Agreed. The above can only make sense when `dir` doesn't matter.
Stefan
prev parent reply other threads:[~2024-05-21 15:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-20 11:48 bug#71078: rgrep accepts wildcard, then throws it away Dan Jacobson
2024-05-20 17:26 ` Stefan Kangas
2024-05-21 15:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvr0dv9oht.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=71078@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jidanni@jidanni.org \
--cc=monnier@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.