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: Tue, 13 Feb 2024 14:43:48 +0000 Organization: https://www.tim-landscheidt.de/ Message-ID: <87h6ic1l23.fsf@vagabond.tim-landscheidt.de> References: <87v8smt9lp.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24827"; 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 Tue Feb 13 15:44:50 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 1rZu1h-0006FP-QQ for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Feb 2024 15:44:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZu0t-0005ld-0R; Tue, 13 Feb 2024 09:43:59 -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 1rZu0r-0005lV-FA for emacs-devel@gnu.org; Tue, 13 Feb 2024 09:43:57 -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 1rZu0p-00010L-Ms for emacs-devel@gnu.org; Tue, 13 Feb 2024 09:43:57 -0500 Original-Received: from port-62-145-29-194.static.as20676.net ([62.145.29.194]:53808 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 1rZu0j-00Cscm-3A; Tue, 13 Feb 2024 14:43:50 +0000 In-Reply-To: (Stefan Monnier's message of "Tue, 28 Jun 2022 17:10:47 -0400") 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:316176 Archived-At: Stefan Monnier wrote some time ago: >> For anything there must be reason. What is reason to "strongly warn" >> programmer not to use it? > Because there's a lot of past experience where people want to have the > Windows-style behavior where prompts get prefilled with the (selected) > default, and they don't understand that in order to get that they need > to change `completing-read`. So instead they abuse `initial-content` in > their code (even though it doesn't give quite the same behavior either > but gets the closer). I have not found a clear answer for my use case, so I post it here: In Gnus, I want to set a group parameter ("to-list") when I encounter an article in a Gmane group if that article has an "List-Post" header. In most cases, I want to set the para- meter to the header's value. Sometimes the header's value is "encrypted" in which case I want to set it to another value (which I researched out-of-prompt). So I want to display the value, if it is "correct", one should have to press (just) RET, otherwise one should be able to amend the input. For me (with list-post-in-article being the header's value): | (read-string "to-list value: " list-post-in-article) works just perfectly then. So what is the proposed Emacs way to get this behaviour if INITIAL-INPUT is not to be used? Tim