GNU bug report logs - #41412
27.0.90; Value of default directory in completions buffer

Previous Next

Package: emacs;

Reported by: Karthik Chikmagalur <karthikchikmagalur <at> gmail.com>

Date: Tue, 19 May 2020 23:20:02 UTC

Severity: minor

Tags: moreinfo

Merged with 41424

Found in versions 26.1, 27.0.90

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Omar AntolĂ­n Camarena <omar <at> matem.unam.mx>,
 41424 <at> debbugs.gnu.org, 41412 <at> debbugs.gnu.org,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#41412: 27.0.90; Value of default directory in completions
 buffer
Date: Sat, 23 Jan 2021 19:47:11 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> I think that sounds likely.  The patch that introduced this code is
>> below, and it indeed changes the `file-name-directory' to
>> `file-name-as-directory' (among other things).
>
> But it also changed a fair bit around it.  And the `substring` is quite different.
> When I look at the history of this code,
> 30c7e54299fc81cd3122a17ef130ab69e9855f99 looks wrong.  In order not to
> change the behavior, I suspect it should have been:
>
>     (buffer-substring (minibuffer-prompt-end)
>                       (+ (minibuffer-prompt-end) (or completion-base-size 0))))))))
>
> and then 326fdb9ec05ab5e4aec0c7064272bb3d223e9875 looks wrong again
> since it presumes that `completion-base-size` is nil whereas it usually
> isn't/wasn't when completing files.

Aha.  But then what would the correct fix now?  I haven't tried the
proposed change (i.e., just change to `file-name-directory'), but it
sounds logical to me.  That is, if the user has typed "~/foo/bar/zo"
then use "~/foo/bar" as the default directory.

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




This bug report was last modified 2 years and 352 days ago.

Previous Next


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