GNU bug report logs - #71078
rgrep accepts wildcard, then throws it away

Previous Next

Package: emacs;

Reported by: Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 20 May 2024 11:50:02 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> gnu.org>,
 71078 <at> debbugs.gnu.org, Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#71078: rgrep accepts wildcard, then throws it away
Date: Tue, 21 May 2024 11:30:59 -0400
>     (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





This bug report was last modified 78 days ago.

Previous Next


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