From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37883: 27.0.50; read-file-name: Scrambled INITIAL Date: Fri, 25 Oct 2019 11:45:18 +0300 Message-ID: <83r231w6w1.fsf@gnu.org> References: <87sgnj24t8.fsf@web.de> <87ftjjmy7t.fsf@web.de> <87h83zfviq.fsf@gmx.de> <87a79reco4.fsf@web.de> <87d0enfmzs.fsf@gmx.de> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="130674"; mail-complaints-to="usenet@blaine.gmane.org" Cc: michael_heerdegen@web.de, schwab@suse.de, 37883@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 25 11:10:23 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNvby-000Xlj-Of for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2019 11:10:22 +0200 Original-Received: from localhost ([::1]:57940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvbx-0006Fu-KD for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2019 05:10:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvER-0008Vy-MW for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNvEQ-0003Z3-Jm for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNvEQ-0003Yz-Gm for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNvEQ-0008TT-EI for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Oct 2019 08:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37883 X-GNU-PR-Package: emacs Original-Received: via spool by 37883-submit@debbugs.gnu.org id=B37883.157199314532533 (code B ref 37883); Fri, 25 Oct 2019 08:46:02 +0000 Original-Received: (at 37883) by debbugs.gnu.org; 25 Oct 2019 08:45:45 +0000 Original-Received: from localhost ([127.0.0.1]:37264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNvE9-0008Sf-3D for submit@debbugs.gnu.org; Fri, 25 Oct 2019 04:45:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNvE7-0008SR-8v for 37883@debbugs.gnu.org; Fri, 25 Oct 2019 04:45:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iNvE1-0003Kk-4a; Fri, 25 Oct 2019 04:45:37 -0400 Original-Received: from [176.228.60.248] (port=1484 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iNvDu-0006Cy-Vj; Fri, 25 Oct 2019 04:45:34 -0400 In-reply-to: <87d0enfmzs.fsf@gmx.de> (message from Michael Albinus on Wed, 23 Oct 2019 18:24:55 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170154 Archived-At: > From: Michael Albinus > Date: Wed, 23 Oct 2019 18:24:55 +0200 > Cc: Andreas Schwab , 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?