bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Zaretskii
Subject: bug#37883: 27.0.50; read-file-name: Scrambled INITIAL
Date: Fri, 25 Oct 2019 11:45:18 +0300

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Wed, 23 Oct 2019 18:24:55 +0200
> Cc: Andreas Schwab <schwab@suse.de>, 37883@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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]