GNU bug report logs - #49776
28.0.50; Incorrect username completion results reported by `read-file-name-interal`

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Thu, 29 Jul 2021 22:19:02 UTC

Severity: normal

Merged with 49777

Found in version 28.0.50

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 49776 <at> debbugs.gnu.org
Subject: Re: bug#49776: 28.0.50; Incorrect username completion results
 reported by `read-file-name-interal`
Date: Fri, 30 Jul 2021 14:50:03 +0200
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> On 7/30/21 1:47 PM, Lars Ingebrigtsen wrote:
>>> `(all-completions "~/.config/~man" #'read-file-name-internal)` returns
>>> the list `("/.config/~man")`. The file completion table incorrectly
>>> recognizes "/.config/~man" as the username instead of only "~man".
>> 
>> I'm unable to reproduce this problem, and you haven't used `M-x
>> report-emacs-bug', so I don't know what system you're seeing this on.
>> I'm getting the expected on Debian/bullseye:
>> 
>> (all-completions "~/.config/~man" #'read-file-name-internal)
>> => (#("/.config/~man/" 0 13 (face completions-common-part)))
>
> No, this is exactly the problem I meant (You reproduced it).

But you said it returned "/.config/~man" for you (while it returns
"/.config/~man/" for me) (note trailing slash)...

> "/.config/~man" is an invalid completion string. It is not a valid path
> nor a valid username on my system.

Oh, you don't have a user named "man" on your system?  That explains why
we're getting different results.  And I'm unable to reproduce that here:

(all-completions "~/.config/~notexist" #'read-file-name-internal)
=> nil

So what kind of system are you on?

> The file completion table should not return invalid completion
> candidates.

The confusing bit for me is why there's a "/" at the start of the
returned value, to be honest.  ".config/~man/" should be the correct
value here, I think...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 316 days ago.

Previous Next


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