all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: michael_heerdegen@web.de, schwab@suse.de, 37883@debbugs.gnu.org
Subject: bug#37883: 27.0.50; read-file-name: Scrambled INITIAL
Date: Fri, 25 Oct 2019 11:45:18 +0300	[thread overview]
Message-ID: <83r231w6w1.fsf@gnu.org> (raw)
In-Reply-To: <87d0enfmzs.fsf@gmx.de> (message from Michael Albinus on Wed, 23 Oct 2019 18:24:55 +0200)

> 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	other threads:[~2019-10-25  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  9:23 bug#37883: 27.0.50; read-file-name: Scrambled INITIAL Michael Heerdegen
2019-10-23  9:40 ` Andreas Schwab
2019-10-23 12:40   ` Michael Heerdegen
2019-10-23 13:20     ` Michael Albinus
2019-10-23 14:53       ` Michael Heerdegen
2019-10-23 16:24         ` Michael Albinus
2019-10-25  8:45           ` Eli Zaretskii [this message]
2022-01-28 16:04             ` Lars Ingebrigtsen
2019-10-23 15:16   ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r231w6w1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37883@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=michael_heerdegen@web.de \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.