From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Doc of deprecated INITIAL-INPUT arg of completing-read Date: Sat, 17 Feb 2024 12:41:00 -0500 Message-ID: References: <87v8smt9lp.fsf@web.de> <87h6ic1l23.fsf@vagabond.tim-landscheidt.de> <87le7owawi.fsf@vagabond.tim-landscheidt.de> <87sf1u5e9c.fsf@vagabond.tim-landscheidt.de> <87bk8f3tgs.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="36135"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Tim Landscheidt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 17 18:41:53 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 1rbOhE-0009EN-RM for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Feb 2024 18:41:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbOgU-0004BB-3b; Sat, 17 Feb 2024 12:41:06 -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 1rbOgS-0004Au-N8 for emacs-devel@gnu.org; Sat, 17 Feb 2024 12:41:04 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbOgR-0003Z7-81 for emacs-devel@gnu.org; Sat, 17 Feb 2024 12:41:04 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3356B441E50; Sat, 17 Feb 2024 12:41:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1708191660; bh=xJ5CVmEmucfBPhMJ+8d8EcaCYMsBpwbNaCAqpb2wn8c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=inTJvvWDGwfAXhObOwgRxQh0k8nrbM5tdfnswXo4Wg6UdPD7G5wA71eVQW3pyyITP brhCgBs2dyju0Jwl57iwYU03uclgln3KBhOz2xZ4PlNHVpgaP2pVHjw8+Z+h7/Gf18 vhSyjf7ApVBAp/lTzCa4OUPsEk/ZoE8JL/caedh9T1rB8zZoxCKG/+rDrQZ4T2CYf0 bp3UMIWxrdYgjoj/T7rKFChL/XbYUKeRG7VNuB54zF0IYO3gubG8cuttk1yBkrxMaF mJSBJc5ZoOfw4QYj1I9lyHNOU8Vdvvk04D89pwF5TW2yHySNpdImt2CFPmtoPFjPQK QPc+5hOx1NBVA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D350A441D7D; Sat, 17 Feb 2024 12:41:00 -0500 (EST) Original-Received: from pastel (unknown [45.72.205.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AD8E41202D7; Sat, 17 Feb 2024 12:41:00 -0500 (EST) In-Reply-To: <87bk8f3tgs.fsf@vagabond.tim-landscheidt.de> (Tim Landscheidt's message of "Sat, 17 Feb 2024 17:12:51 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:316272 Archived-At: >>> 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.) But that's a UI issue. Whereas we're discussing an API issue. The API's design should allow for several UI choices. > 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. That's been a feature of `C-x C-f` since for ever :-) At some point the (find-file "~//etc/passwd") also worked. I think this was changed around Emacs-21 or maybe even Emacs-19. Then in Emacs-22 we added the `file-name-shadow-mode` to give some visual feedback about the feature. Stefan