From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#37883: 27.0.50; read-file-name: Scrambled INITIAL Date: Wed, 23 Oct 2019 18:24:55 +0200 Message-ID: <87d0enfmzs.fsf@gmx.de> References: <87sgnj24t8.fsf@web.de> <87ftjjmy7t.fsf@web.de> <87h83zfviq.fsf@gmx.de> <87a79reco4.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="142561"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Andreas Schwab , 37883@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 23 18:47:07 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 1iNJmt-000avw-Gb for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 18:47:07 +0200 Original-Received: from localhost ([::1]:41570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNJmr-00080u-EY for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 12:47:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48928) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNJSV-0001qN-1B for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 12:26:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNJST-0006XJ-Ve for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 12:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54296) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNJST-0006XF-SP for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 12:26:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNJST-00043O-OM for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 12:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Oct 2019 16:26:01 +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.157184790915505 (code B ref 37883); Wed, 23 Oct 2019 16:26:01 +0000 Original-Received: (at 37883) by debbugs.gnu.org; 23 Oct 2019 16:25:09 +0000 Original-Received: from localhost ([127.0.0.1]:34884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNJRd-000420-4m for submit@debbugs.gnu.org; Wed, 23 Oct 2019 12:25:09 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:46525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNJRa-00041P-MO for 37883@debbugs.gnu.org; Wed, 23 Oct 2019 12:25:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1571847897; bh=HEB3MUOkxKiNPI8w0HFZ3ijbmflcSAnKHhUBVJF9a2g=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=LPUmQ/yHLJHJBTm2lrQR8iVtb5k8iKVarp0yJPUUX9RrMZwN1Si3lZDUR/3K6INVV CHqw4tUUhso7Lthw1JEJthSk5qWZEedfR4tgW93DZ4AiuJwtW6Vbwhgb+wc6/26sPs RojKx8/KdY65FWn6zg47My0El8+bSLd3gDilSa9c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.86.45.31]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MjjCF-1hiQvC0GUd-00lG9g; Wed, 23 Oct 2019 18:24:57 +0200 In-Reply-To: <87a79reco4.fsf@web.de> (Michael Heerdegen's message of "Wed, 23 Oct 2019 16:53:15 +0200") X-Provags-ID: V03:K1:eJYprP0kodo9eLn/eDpuPNXq46VmcYh/ty2w15eAfPJU5zTh8UN QZfslkcMJOp3ni7sXe9FhMWoYLKJQc1I2HXTLcktGqEQBiWAcqZSDU3CmYcPyynMknBUdOB +MPGH+gVzvnqSwryvRCJrnauWIn8leE1VAy8fAvPIumiC+etWLrHQD5r752KcxugnlpJslJ s8s4nm8KIixgOnlGlzkHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ajzYAICT3Is=:/iHxzAG3s2CEDBwr1B4TnD 1Rt4rD1yKnd6b0jYMXtQa1Me9dPivSf7S1FWy1vrX0oLpp4ce2fZuUmvFKo9wBWJ6ANzP24JN phZmU0xheaLb9IPIDFGFae46UI/TYvTL7YxvOOBnPJtaPWWpkaQi9LBMFC3BQk6SD+FMlADO+ 33bY9jCpGHjxPo/pzeiYhddTEJjFZC/KBDoMolAvlnecrlcKixbDFN7zrVeJXS/wzmICoctMD lR7SEHZtEfRWmYsJi/qL9eI9lEtTIGBhzifNowzKbg81MMrT0CuoJ+69Fs/X5MDomXbCpZGha uX3oFL6TAsblyDHDnjlHcf5ANrWCKRl3tOlvAz2F+pi4zpu8kv5Kh0qawbdhyM68y3h2nnFbM k/qwKMfV5LWzIexvpEBdRdgObrW2s5s5jJdu5icR3uyvAyaEhJNsHbqVko5HhLzVTxHxkjdc+ 1PuVdjVPHsM3xBvCaqlQRQtjLAnrOPEo1rXI0hC5ZqewySsXUXUyQsJalBa/vdeW7fpv8rYPE peUp6DX9d7tqB2QwX5yafg/5+TxMQcrBjZtuudrtCquqDEXaZmBM25f2VnuwwYm09VfpT692y XcUTtswQRxGW6v4gwft4+n80UncoeLRQK73SKdaUOYkoSIjqJWtjtqyTvb+W/pLfzi/lsQObU bolhSXz4vVMavoCCo3/CVLPBb1qGiGZGwA7sAP/pt48w4gHqoK5WDjVCsrsv+IYoBO8go7diy d8AIZ+QYH8m4RGuhC1f7oVwoOsXZkgkGMdcmCQcS0K0ZXfPERWefZ0sSMt7qYbFogMk4qm+6 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:170081 Archived-At: Michael Heerdegen writes: Hi Michael, >> 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. > What you cite also doesn't explain why this combination happens in the > way it does. The doubled ~/ seems not useful, and the /: is...some > Tramp thing? It isn't Tramp, rather the contrary. "/:" marks quoted file names, i.e. file names which shouldn't be given to a file name handler. > Michael. Best regards, Michael.