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: Wed, 29 Jun 2022 15:42:30 +0200 Message-ID: <87r1371t89.fsf@web.de> References: <87v8smt9lp.fsf@web.de> <87mtdw4v6h.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="38715"; 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:OPn9WDb7Q7xUguXrznneexfK6Hg= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 29 15:57:39 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 1o6YCJ-0009q5-57 for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Jun 2022 15:57:39 +0200 Original-Received: from localhost ([::1]:42376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6YCH-0005J3-VQ for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Jun 2022 09:57:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Xxp-0001QW-N9 for emacs-devel@gnu.org; Wed, 29 Jun 2022 09:42:44 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:34120) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Xxn-0002LT-Un for emacs-devel@gnu.org; Wed, 29 Jun 2022 09:42:41 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1o6Xxl-0009zG-2N for emacs-devel@gnu.org; Wed, 29 Jun 2022 15:42:37 +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:291715 Archived-At: --=-=-= Content-Type: text/plain Drew Adams writes: > Suggestion: > > Don't use this argument to insert a default value -- > use DEF for that. You can use INITIAL-INPUT, for > example, to insert a prefix common to all completion > candidates. Ok, thanks - I went with your version. > 5. The doc already says that users can yank DEF with `M-n'. > (Or if it doesn't then that should be said where DEF > is described, not where INIT is described. It didn't, so I added that, along with a hint mentioning `minibuffer-with-setup-hook'. Updated patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-completing-read-Clarify-why-to-avoid-INITIAL-INPUT.patch >From 60a2579134d33975e6739651a06e79f0cf944533 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 some cases. Mention M-n and M-p as well as `minibuffer-with-setup-hook'. Co-authored-by: Drew Adams --- src/minibuf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/minibuf.c b/src/minibuf.c index 85d6ec4434..9b84bc49da 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 value -- + use DEF for that. You can use INITIAL-INPUT, for example, to insert + a prefix common to all completion candidates. See + `minibuffer-with-setup-hook' for a general method to prepare the + minibuffer. 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 @@ -2043,6 +2044,9 @@ DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0, of a history list. If HIST is t, history is not recorded. DEF, if non-nil, is the default value or the list of default values. + These can be yanked into the minibuffer using \ +\\\\[next-history-element] and \ +\\[previous-history-element]. If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits the current input method and the setting of `enable-multibyte-characters'. -- 2.30.2 --=-=-= Content-Type: text/plain Thanks, Michael. --=-=-=--