From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: [External] : Doc of deprecated INITIAL-INPUT arg of completing-read Date: Tue, 28 Jun 2022 18:19:50 +0200 Message-ID: <87mtdw4v6h.fsf@web.de> References: <87v8smt9lp.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25350"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:pBZIE+c+OFGLbq3LiZcPYEIxck4= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 28 18:21:05 2022 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 1o6DxY-0006Mf-Q4 for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Jun 2022 18:21:04 +0200 Original-Received: from localhost ([::1]:44818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6DxX-0007sM-DW for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Jun 2022 12:21:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6DwV-000766-Vv for emacs-devel@gnu.org; Tue, 28 Jun 2022 12:20:00 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:37016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6DwU-0007Nl-GC for emacs-devel@gnu.org; Tue, 28 Jun 2022 12:19:59 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1o6DwR-0004gd-Mi for emacs-devel@gnu.org; Tue, 28 Jun 2022 18:19:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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" Xref: news.gmane.io gmane.emacs.devel:291688 Archived-At: --=-=-= Content-Type: text/plain Drew Adams writes: > All that's needed is to make clear that INIT > isn't intended as a _substitute_ for a default > value - and vice versa. That's really the point > (IMO). The use cases of INIT are different from > those of DEF. That's what should be made clear. > Then leave it up to coders to use each as they > see fit. Mostly agreed. But as I said, I only intend to describe the current coding recommendations better, and these don't regard INITIAL-INPUT and DEF as equivalent alternatives. As a compromise, here is a reworded version: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-completing-read-Clarify-why-to-avoid-INITIAL-INPUT.patch >From cb7b80385f74e11d2061e5c5ca31df58711f7665 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Mon, 27 Jun 2022 15:42:58 +0200 Subject: [PATCH] completing-read: Clarify why to avoid INITIAL-INPUT * src/minibuf.c (completing-read): Don't say INITIAL-INPUT is deprecated because it's necessary to use it in few special cases. --- src/minibuf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/minibuf.c b/src/minibuf.c index 85d6ec4434..9808875752 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2025,10 +2025,11 @@ DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, initial input is STRING, but point is placed at _zero-indexed_ position POSITION in STRING. (*Note* that this is different from `read-from-minibuffer' 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 - \\\\[next-history-element]. + for POSITION.) Don't use this argument to insert a default--pass + nil for INITIAL-INPUT and supply the default value DEF except in + cases like inserting a prefix common to all completions or an + initial part of a file name. The user can yank the default value + into the minibuffer easily using \\\\[next-history-element]. HIST, if non-nil, specifies a history list and optionally the initial position in the list. It can be a symbol, which is the history list -- 2.30.2 --=-=-= Content-Type: text/plain For wishes, discussions and feature requests maybe use another (sub-)thread or bug report. Thanks, Michael. --=-=-=--