GNU bug report logs - #37883
27.0.50; read-file-name: Scrambled INITIAL

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Wed, 23 Oct 2019 09:24:02 UTC

Severity: normal

Found in version 27.0.50

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: michael_heerdegen <at> web.de, schwab <at> suse.de, 37883 <at> debbugs.gnu.org
Subject: Re: bug#37883: 27.0.50; read-file-name: Scrambled INITIAL
Date: Fri, 25 Oct 2019 11:45:18 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Date: Wed, 23 Oct 2019 18:24:55 +0200
> Cc: Andreas Schwab <schwab <at> suse.de>, 37883 <at> debbugs.gnu.org
> 
> >> The docstring of `read-file-name' says
> >>
> >> If DEFAULT-FILENAME is omitted or nil, then if INITIAL is non-nil, the
> >> default is DIR combined with INITIAL
> >
> > But I'm talking about the initial minibuffer contents, not the default.
> > Is it due to historic reasons that the initial contents resemble this
> > default?
> 
> It is not said explicitly, but INITIAL is expected to be a trailing
> string of DEFAULT-FILENAME, where the cursor stays in the minibuffer.
> 
> And yes, in your case (with a nil DIR and a nil DEFAUL-FILENAME), DIR is
> set to "~/", and DEFAUL-FILENAME is set to "~/.bash_history". Finally,
> (minibuffer-maybe-quote-filename (concat dir initial)) is called.
> (concat dir initial) expands to "~/~/.bash_history", and
> (minibuffer-maybe-quote-filename ...) adds the leading "/:".
> 
> You better call (read-file-name-default "File: " "~/" nil nil ".bash_history" nil)
> 
> If read-file-name-default does not satisfy your needs, you might write
> your own read-file-name-function, and bind it to
> read-file-name-function.

Would someone like to suggest a documentation change to clarify these
issues?




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

Previous Next


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