From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.devel Subject: Re: Doc of deprecated INITIAL-INPUT arg of completing-read Date: Sat, 17 Feb 2024 17:12:51 +0000 Organization: https://www.tim-landscheidt.de/ Message-ID: <87bk8f3tgs.fsf@vagabond.tim-landscheidt.de> References: <87v8smt9lp.fsf@web.de> <87h6ic1l23.fsf@vagabond.tim-landscheidt.de> <87le7owawi.fsf@vagabond.tim-landscheidt.de> <87sf1u5e9c.fsf@vagabond.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18615"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 17 18:13:38 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rbOFt-0004iR-Q2 for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Feb 2024 18:13:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbOFc-00050N-HG; Sat, 17 Feb 2024 12:13:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbOFN-0004zj-4o for emacs-devel@gnu.org; Sat, 17 Feb 2024 12:13:05 -0500 Original-Received: from gavdos.tim-landscheidt.de ([2a01:4f8:1c0c:4bd6::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbOFL-0007Fx-Fy for emacs-devel@gnu.org; Sat, 17 Feb 2024 12:13:04 -0500 Original-Received: from port-62-145-29-194.static.as20676.net ([62.145.29.194]:40102 helo=vagabond) by gavdos.tim-landscheidt.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rbOFA-00DEnY-2k; Sat, 17 Feb 2024 17:12:53 +0000 In-Reply-To: (Stefan Monnier's message of "Thu, 15 Feb 2024 13:39:52 -0500") Received-SPF: pass client-ip=2a01:4f8:1c0c:4bd6::1; envelope-from=tim@tim-landscheidt.de; helo=gavdos.tim-landscheidt.de X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316270 Archived-At: Stefan Monnier wrote: >> The docstring for completing-read (GNU Emacs 28.3) says re- >> garding INITIAL-INPUT: >> | If INITIAL-INPUT is non-nil, insert it in the minibuffer initially, >> | with point positioned at the end. If it is (STRING . POSITION), the >> | initial input is STRING, but point is placed at _zero-indexed_ >> | position POSITION in STRING. (*Note* that this is different from >> | =E2=80=98read-from-minibuffer=E2=80=99 and related functions, which = use one-indexing >> | for POSITION.) This feature is deprecated--it is best to pass nil >> | for INITIAL-INPUT and supply the default value DEF instead. The >> | user can yank the default value into the minibuffer easily using >> | M-n. >> If one follows this recommendation (setting INITIAL-INPUT to >> nil and passing the original value as DEF), the user is not >> made aware of the original INITIAL-INPUT value until he >> presses M-n. > Oh, you mean we should add that the default should be passed to > `format-prompt`? I guess that would help, indeed. Yes. (I doubt, though, that my brain can ever be trained to find it convenient that pressing RET at position B will make Emacs use the text displayed at position A, and this text at position B will not go away if I tell Emacs that I want to enter something different so that I can remember that if I delete all text and press RET, it will use the text at posi- tion A again.) > [=E2=80=A6] >> But even in the basic case of C-x C-f, if I want to find a file >> upwards of default-directory, the two extra keystrokes harmonize >> well with wanting to do something different, so it never occured to me >> that Emacs should protect me from them. > =F0=9F=99=82 > FWIW, it's almost never necessary in `C-x C-f` since you can type `../` > to "go up", `~/` to go home, and you don't need to type anything at all to > go back to the root. I wasn't aware of the latter two until now, and I can't say that the display of "~//etc/passwd" leading to visit "/etc/passwd", but (find-file "~//etc/passwd") not working is intuitive to me. Tim