From unknown Tue Jun 17 01:42:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#56380 <56380@debbugs.gnu.org> To: bug#56380 <56380@debbugs.gnu.org> Subject: Status: 29.0.50; completing-read: INITIAL-INPUT arg Reply-To: bug#56380 <56380@debbugs.gnu.org> Date: Tue, 17 Jun 2025 08:42:01 +0000 retitle 56380 29.0.50; completing-read: INITIAL-INPUT arg reassign 56380 emacs submitter 56380 Michael Heerdegen severity 56380 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 04 08:19:17 2022 Received: (at submit) by debbugs.gnu.org; 4 Jul 2022 12:19:17 +0000 Received: from localhost ([127.0.0.1]:46380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8L2q-0001ka-Kc for submit@debbugs.gnu.org; Mon, 04 Jul 2022 08:19:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:49044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8L2o-0001kQ-32 for submit@debbugs.gnu.org; Mon, 04 Jul 2022 08:19:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8L2m-0006p0-Vg for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 08:19:13 -0400 Received: from mout.web.de ([212.227.17.11]:59041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8L2h-0008Ic-L7; Mon, 04 Jul 2022 08:19:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1656937137; bh=LFjjamDwI5fflqmiNzneHunfq4S2uIY6DdfjE8Jb/7I=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=dDgtSr6QGTgRCD/r2nB7vegkUk1ZRs6268wUbHK5rq8w+A+7h6iU7kKcX5lOjTDL7 A8qY/0UkSfYUpJPh51j0P4I4SLz3nCXvmHuzrX7sg1ROtnw6J8oTvyp6Eplfoe1mva ijk2mXv4O1meO/UWobGhXPZmK9TaIwzKcB5iyshI= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mv3Yg-1nHKqW3vKS-00rKku; Mon, 04 Jul 2022 14:18:57 +0200 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 29.0.50; completing-read: INITIAL-INPUT arg Date: Mon, 04 Jul 2022 14:18:55 +0200 Message-ID: <878rp9840g.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:bjtN2CusgdyEvGPtGfDcwvp/lrnNXQ2ie3G61Eg2KO5EePp4grP n7bM0/Dx+reihDb3uIeeeOP13jgD7/1m1hqv8JInGcoAbIqMXAQ/VXQE8E6Oa8N1ELIoVfs dcVu1eh0mjxAW9c+9N6iiZ4gETwUkMUqXwBydrVNAHqzLSzovgzNoWWXkJl7oG7Yv8BrkjP xeGuWtaPv8a6t+cW3iFLw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VJ4iZ4DIQOQ=:1m98gEE/wp+Xfr6Y3Ah5G8 Lzc7mY4j8h4Djui72GyG0NhlnmEmNrIh67oQU50OV0WsVoIYjgCWzVvx6GCR9vVrlC618I+7u jBTh7QAuuUs9/xBDeQw4/dTqNC4hy5FY/R+r3zuBJDi+U6TzGBAp87P3X9/MiFE/U8/kWrjwg oHfXVrTms4CUPDQx6WXcfesu26GRHmHDUyWIaPXty2zPGbu8r3ZXa5QYr9AjW47tunsWgGEL2 5LkLwteb/l/YitksUKdMPWuwjd+6r7c+xQi0NtPsBJBSnlUl9UDzAPHqXPqx2WXDQAl8ndLDZ I5FeVoH2ZcJ/Qzx+NQyNiIygAaMi9DbYJCwf3b7B+XFgAOzT5tk+fl4yg6EyvWKgXlWJRhlmy 4wZf2NGVLTYg2HxtOoRdLhZQVmdf2cABAiwGvLZFvyMTo6ry9ucID0Ut+9YxEQXteuvRBGk90 RxXoXDKCIj5PhgqvTXXz1nkYfEGY9VepUuuAVQS4MILcR3wUV4XdsKFSUFKrspLsHhw69sM34 plkNusfCZXXObq2Sxn8TZAQUybLuyk0A1khBSUPiin++1nVCZW20JGtKxhA7CDYSf0SpqlO+V /egkGqgG2gkgn9PusEgLXfaX9YMh2CbAi8ElxVI1wUGhaQMtLV4X759WTK/kAropeP8ErbA7s nD6Ee6QIVRta5nobbC3o3Ou6yvEOGfvQ0m471E3/Z/ye39gZQ4IVaVrOjEQNlDFhxNW+waFJI qsFsD9RcC8Sf1kl/w6NTzOPsGIrAPS6dSbp0MgrL+V6g7JcaGlTdi0QIqKHUHRnZiioTRJ+hV a8+TxHaxxcgDwzGZeBRMaNu/89OOhN1YtCRILksC7pSDSgVv+zt6nFiB1acBpKbivyZs/c0kt vIFp9lUdin8vP/IPV1N/zQuNuZxXmj+Clg+Cp/3pAUu1JbiburZ/lT7E3y90cicXzW5Wjmaj7 vi0NqvHPTo2IMRjEpqubkqidthFa3iHkdu/nOIoAEjAJdJuAnZN8YjIv75+FofROWFHlTTvm7 TgFdF3weTGQ/fjctz34wNMHxtequuHu9zbbkKfAAkvwmVuDKV48CNTSRKY+Iia88iEG5i3iZv L8qTMeg1N6mbIyU8vbcVNFIy1BB7yloIXXFe/jfagY+0z5+aSFyk7mVNg== Received-SPF: pass client-ip=212.227.17.11; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: Arash Esbati , Stefan Monnier , Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hello, The docstring of `completing-read' says the argument INITIAL-INPUT is deprecated - yet there are over 30 nontrivial uses in Emacs' own Elisp sources. So, although we currently don't want that this argument is used just to insert a default input, it's sometimes not possible to avoid using it. Here is an attempt to improve the documentation: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-completing-read-Clarify-why-to-avoid-INITIAL-INPUT.patch Content-Transfer-Encoding: quoted-printable =46rom e2a4e843c262416b7b866203a7e636265beb4673 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 =2D-- src/minibuf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/minibuf.c b/src/minibuf.c index c2e270a450..2ad74e4d38 100644 =2D-- a/src/minibuf.c +++ b/src/minibuf.c @@ -2026,10 +2026,11 @@ DEFUN ("completing-read", Fcompleting_read, Scompl= eting_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 @@ -2044,6 +2045,9 @@ DEFUN ("completing-read", Fcompleting_read, Scomplet= ing_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'. =2D- 2.30.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable This patch is the result of a discussion in emacs dev: https://yhetil.org/emacs-devel/87v8smt9lp.fsf@web.de/ Further things mentioned in that discussion: 1. Likewise we want to improve the docstrings of `read-string' and `read-from-minibuffer'. And as well (Arash Esbati): Emacs Lisp reference the text/descriptions in @node Text from Minibuffer @section Reading Text Strings with the Minibuffer @node Initial Input @section Initial Input @node Minibuffer Completion @subsection Completion and the Minibuffer 2. Add a minor mode that automatically inserts a DEF into the minibuffer, and add a defcustom to allow users to enable that mode in their configuration. Some people simply prefer that behavior. This would allow people to avoid using INITIAL-INPUT to get what they want. 3. Stefan Monnier: [...] the `initial-input` arg should be changed into `setup-function` (so we don't have to use the hideous `minibuffer-with-setup-function` hack) and using a string there should be deprecated (the rare places where inserting an initial string makes sense can use a setup-function instead). Also the prompt handling should be changed so that it automatically inserts the default into the prompt. Doing that in a reliable and backward compatible way is not completely straightforward, tho, so maybe a simpler solution is to introduce a whole new function instead. Then a user-customization could also be used to choose between the current default (where the default is added to the prompt) or the other option of always inserting the default as initial value (pre-selected so it can be deleted with a quick DEL). TIA, Michael. In GNU Emacs 29.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.24.24,= cairo version 1.16.0) of 2022-07-03 built on drachen Repository revision: 0de355d8ee729ed6fec3ea379258d4a1f1d49021 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 04 12:27:25 2022 Received: (at control) by debbugs.gnu.org; 4 Jul 2022 16:27:25 +0000 Received: from localhost ([127.0.0.1]:48543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8Ouz-0000Pk-4r for submit@debbugs.gnu.org; Mon, 04 Jul 2022 12:27:25 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:40827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8Oux-0000PH-P3 for control@debbugs.gnu.org; Mon, 04 Jul 2022 12:27:24 -0400 Received: by mail-pl1-f174.google.com with SMTP id b2so8930416plx.7 for ; Mon, 04 Jul 2022 09:27:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=X4VH8OoEy+L8dVQ2oLt/X7QE2dig50RrPFsWzVu4tyQ=; b=SD0kGyoBOde9w07VYFc7UsNLo3TKAGiqc4awolMgBLHvw4i7+vwRfuj8pfS56tpsPD 0fFYHX0OI4OPbv0msY4H09chYBvXRyFLJmA5oY1VkuPBWzu90K78tmPhkxKRY67F7VUa Nzu1YUx+uLubj1L/LL1FGG2+E/umGawq9CKp2CBYMBBy/l/ZlFIJcDntN2pxbgp/2fvu OSjVwS6d+p5zWYKxvECs2ponltPWUBpzrVq8WYrZuZ3MQB8ZhwVWVayvCvxYqc040Lmb omF+WebcDHgSlIm2isdCCbQQhvObQVYtJjlX+5o0nK7sEbqnHNf9M8aL6460duMPBw0X dWVw== X-Gm-Message-State: AJIora+TEz0qIGti8amL7HjLvYIh+BKG2nIdzHQmI0AtOUiCC3R9IOQO 5fU/5HNwPdgGk8xn/SMAFq556my/6FEnRLpT3TmqANsr X-Google-Smtp-Source: AGRyM1uyiv2Du/2y46IuBJLx7ZodX6iq4G9d2i/46FSsdubdITxW6iMp46rn0+4xgClTbjX6f5YpXBc4aNlV7fcf6sA= X-Received: by 2002:a17:902:7c0d:b0:16b:7dd2:626c with SMTP id x13-20020a1709027c0d00b0016b7dd2626cmr36577050pll.152.1656952038251; Mon, 04 Jul 2022 09:27:18 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Jul 2022 09:27:17 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 4 Jul 2022 09:27:17 -0700 Message-ID: Subject: control message for bug #56380 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) severity 56380 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 05 07:33:32 2022 Received: (at 56380) by debbugs.gnu.org; 5 Jul 2022 11:33:32 +0000 Received: from localhost ([127.0.0.1]:49456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8go7-0003pC-OE for submit@debbugs.gnu.org; Tue, 05 Jul 2022 07:33:31 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8go5-0003oy-Fp for 56380@debbugs.gnu.org; Tue, 05 Jul 2022 07:33:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MZcPvccKnfA1XVC2v2K0wYVEy1x6iP6fVLYWKlS99nA=; b=KXZAzXepPhfhH4Vhy4AaZGFUhr JN3avVI8qurlB3yAdTkmhznKqz7gwkZgOzSKR0wnfPdF84uH1bIo9l4J7lI2bV0ixqtWG2fzPFGBD bV3aMTZzRg/ucoAET+nm4InkiClOaijP+sexUIwCsQNTVClN4B6MWfFYE/WeV6nnForc=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8gnq-00015x-3R; Tue, 05 Jul 2022 13:33:16 +0200 From: Lars Ingebrigtsen To: Michael Heerdegen Subject: Re: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg In-Reply-To: <878rp9840g.fsf@web.de> (Michael Heerdegen's message of "Mon, 04 Jul 2022 14:18:55 +0200") References: <878rp9840g.fsf@web.de> X-Now-Playing: Eurythmics's _In The Garden_: "Belinda" Date: Tue, 05 Jul 2022 13:33:12 +0200 Message-ID: <87v8sb4ww7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Michael Heerdegen writes: > The docstring of `completing-read' says the argument INITIAL-INPUT is > deprecated - yet there are over 30 nontrivial uses in Emacs' own Elisp > sources. So, although we currently don't want that th [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56380 Cc: Arash Esbati , Stefan Monnier , Drew Adams , 56380@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Michael Heerdegen writes: > The docstring of `completing-read' says the argument INITIAL-INPUT is > deprecated - yet there are over 30 nontrivial uses in Emacs' own Elisp > sources. So, although we currently don't want that this argument is > used just to insert a default input, it's sometimes not possible to > avoid using it. [...] > + 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. It's an improvement on the original text, but this makes it sound like inserting a common prefix is something callers are expected to do. (But instead it's a super rare special case that virtually nobody would actually do in practice.) So I'd rather just remove that sentence about what you can use INITIAL-INPUT for. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 05 08:50:32 2022 Received: (at 56380) by debbugs.gnu.org; 5 Jul 2022 12:50:32 +0000 Received: from localhost ([127.0.0.1]:49632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8i0d-0003x0-QD for submit@debbugs.gnu.org; Tue, 05 Jul 2022 08:50:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8i0c-0003wj-RK for 56380@debbugs.gnu.org; Tue, 05 Jul 2022 08:50:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8i0V-0004WU-Hi; Tue, 05 Jul 2022 08:50:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=yh1W/jS4vMTz6SJdvGgbA3gHxstoBzqihtLSYXwYNr4=; b=avZz7YQrQxrGWY84tWqq DhHZbp4EPN56egPcizR0l2ZmSTLx2UASu5rVdiL3lvAP0p31Hg03Ceyu3Mz9rt4IqAN/q+8Zzgrjc ZKltpSuJjDnelruXnmpdNqBdle03epBz5GLrCeLeBiCEgZGv6T0Q5ruezYiAtbzSYyazldO1vVoPx Y3OvU0v7BoZ5gnmu2rw+t2LJw5BBDGaGEVa+dFqgo76rQbhbziGL//BR1lM9YZn0VWkhX/cvb3JGx aN+I5qmw+cVgdxOq7zuC+pdjV7Q41jb0nBvPPyUhNowVNeLkrPGnKdYKP/RNh+yD0C47u8PEm42mD o42JgsM3qwDykA==; Received: from p4fe3ee56.dip0.t-ipconnect.de ([79.227.238.86]:52504 helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8i0G-00063v-4V; Tue, 05 Jul 2022 08:50:22 -0400 From: Arash Esbati To: Lars Ingebrigtsen Subject: Re: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg In-Reply-To: <87v8sb4ww7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 05 Jul 2022 13:33:12 +0200") References: <878rp9840g.fsf@web.de> <87v8sb4ww7.fsf@gnus.org> Date: Tue, 05 Jul 2022 14:49:58 +0200 Message-ID: <86edyzg1vt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56380 Cc: Michael Heerdegen , Stefan Monnier , Drew Adams , 56380@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Michael Heerdegen writes: > >> The docstring of `completing-read' says the argument INITIAL-INPUT is >> deprecated - yet there are over 30 nontrivial uses in Emacs' own Elisp >> sources. So, although we currently don't want that this argument is >> used just to insert a default input, it's sometimes not possible to >> avoid using it. > > [...] > >> + 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. > > It's an improvement on the original text, but this makes it sound like > inserting a common prefix is something callers are expected to do. (But > instead it's a super rare special case that virtually nobody would > actually do in practice.) So I'd rather just remove that sentence about > what you can use INITIAL-INPUT for. Or say that it should be used in rare cases like a common prefix or a cons cell for the history argument. The docstring would be then more in line with the reference manual (the common prefix part has be to be added to the reference manual, but that is doable.) https://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Input.html Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 05 10:50:18 2022 Received: (at 56380) by debbugs.gnu.org; 5 Jul 2022 14:50:18 +0000 Received: from localhost ([127.0.0.1]:51220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jsX-0007Lp-PH for submit@debbugs.gnu.org; Tue, 05 Jul 2022 10:50:18 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jsT-0007Ld-4i for 56380@debbugs.gnu.org; Tue, 05 Jul 2022 10:50:16 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 265CmYrp003152; Tue, 5 Jul 2022 14:50:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=zuh5eO8wp7mR5Rgvf1WYDR/8ZskdVwvDheHX/VpudOgxvKcaKkDM9AuuyAQ+K5ubA02p rM/1fYJ9bsJodnXLKFE7WX4ZpOQmVHlNXwd4cTYU3PLwwnH4EfL4mE4aUcRBLshBdJfq OuLvjx78ROGZz5PktrOIIRHQwQbrUUlETfLnEngb3kUzydqoTtTbMNqK5T19OIpHK0CP Iq6EA8+Zx3MFq4LuDirxQoaChbOvQvS6qymkv2MLaXB+FM57rMziiIKnZcXOndViNUxw OMRcypzF26GsZwNAMZPq+HzM4ZdxEOIQ/d2U5imwVBJZ+Cdsp5CaBBkqKQrrw0xsxbGg Wg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3h2dwap64r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jul 2022 14:50:10 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 265EfFxJ040374; Tue, 5 Jul 2022 14:50:09 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3h2cf8gaw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jul 2022 14:50:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cI13TGM4pkjx+1pLb4joFLY6KzC5B7rhufI4f7LJvuXY1sM6mhFUCBUUNgTKeoVUCZFo1KpeyPpC0KwvzCNAL2VSwjB4dyAyeLU0RwyYMuN/SfEqvaU6imD3hmcngTUbzdmL5GtsgblOrJBE1sEBUPQ3MVBbuSeSePUwGFa6wGLD2lEmDrc5fR8xGc6yG6XQEomup1btbTFHkSUf09nkrYauTt7j5m4H17B1w4+VTwZseknmIwjN3dFszqX7zs4L6SoJvOfyNIZEoym94SJEO9c1r+Q4zVR24kT11W+Pc//DXRzVDrDE6SVRIzpMFAY0c5/DLheSAOVXPTIXuRBN8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=lJDWvmpoL+VCXLF4PUZqxD1ZI9dH8KJf6u818bSIbo8vPUQ0R4yHm8UzZ1zEVmy2nUIcNZS1aJtxeJrOLvswjB8qG7tRrb2elQKMw9HlnyF+42r82A6wDrZdLnS2nXam0WoHdB/zz+XUhqrtkvJbQll0yd6sLM3FsOegj+4lXRB/qKtOzutXVyuQ8uDHymmIRzXIrZLyCyLGOy/Ia4f9AXOEuAjCXgPFuI9hf/NxEJufPul7l8kCT0DfuvX+Hs063/JLG4acB0D98bPy+Bp+OnTAJN9KzRBZu5s2gNQ4fj1UVzXuF5Gl7F3Ut3wXxUSOk7Y2vd1JMm8DCsewYl10mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=I2XPkTYDog7YYb0se6ViLMokLymnF+4tIg7KycoY57FCws1yWJO+v5iRSYSqHtv/9eTVYbmChxvJ7m597E7CAI7NUPFxpHVwOo9D1ziw5Yx+Bu6PuQPmh3IFp3zJRHZywIRhWEAKINNlu4LGVwj8EDOQsYI1ZSCBxdwbFR008VM= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN6PR10MB1779.namprd10.prod.outlook.com (2603:10b6:405:c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Tue, 5 Jul 2022 14:50:07 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb%7]) with mapi id 15.20.5395.022; Tue, 5 Jul 2022 14:50:07 +0000 From: Drew Adams To: Arash Esbati , Lars Ingebrigtsen Subject: RE: [External] : Re: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg Thread-Topic: [External] : Re: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg Thread-Index: AQHYkG3P7/rTkB+zaUakdocT70WD+61v0gzQ Date: Tue, 5 Jul 2022 14:50:07 +0000 Message-ID: References: <878rp9840g.fsf@web.de> <87v8sb4ww7.fsf@gnus.org> <86edyzg1vt.fsf@gnu.org> In-Reply-To: <86edyzg1vt.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d666848-dd7b-4d01-b062-08da5e95a733 x-ms-traffictypediagnostic: BN6PR10MB1779:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PR2gfxf3AhCRHcAtduL46Ose+E/T5SZkXsb1I73EMPZvbhvtp1HGr4O8muKbWVGWZYVn2qNQeGkw0nGnXpyZh7IiSciCcFAJ6cL2xmF+CjIm6TFoGHvkHhfON2k/fYj+vTodgy1vGSq5c1dt2eF5oxf2pqLdGBZUeOzWceewvBx9ktO49zw8ZmD+QZzzTfOMGwTp4z1o70nU4T2rtRIGKgvjmUzdS3e7V7mxyq+vaF2GpKUp1e4wD9xNLJECz/20k5jRaBGF7QPRgoO9EdTezKG2nw9qibhTOt7q9TIfJswhu7/0+ccd1H7n+g8RJr0Yjhgo63R7cvwIrdkPBahAud+aU9n/oH+v87vmnW3SRp6iPCJuKcpSqGrcMDiGlUUQM6oKj+B5FpMpdhKc/NP4Irxw9Z/ZYRpSWPmN5ZAEmAMOMVcBs3p+v5Z1Ba3DJ5okTNGBJ3rqKHOKd4mI7LnOHEVzOLTDOeQvkomnJ0sXVkXAFbqDUYWqTjeEnVOFoESJft5sPbtZWlWvfi8b4PXRkHgQv1fJrqHi7/YO/d3MTO1Q+pykMnw1z3YAcsYZdu07kZU4gcfZ/Tp3W1xlUytrvHVrrA7SFU44dF2cHYsVIH1UgnJP66yVvOsoCqUh6gaFaI1hc9P0UDnpnMq+AWWJ2uy7BbxlzNFGO3yVbVmYKUEp7jXltCcxDlMErRgPFP+GIUeKrhTglS9AL8u9eGRcorHm8vUDEQ6xrHSBQSnxrzFL3yAX307ER6iN4SPzqJ3jM8fMQLWzpN4CbF9nnW/e1RRx6JpJYFh1ofZLRcfGy+Z5TCLr8d+94WMf96DsIZWj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(136003)(396003)(346002)(376002)(39860400002)(122000001)(38100700002)(110136005)(54906003)(44832011)(316002)(71200400001)(38070700005)(4326008)(5660300002)(8676002)(8936002)(66556008)(66476007)(64756008)(66946007)(9686003)(66446008)(76116006)(186003)(2906002)(26005)(41300700001)(6506007)(478600001)(86362001)(7696005)(55016003)(52536014)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ZJHwnxNQ97CzUZfvjr+s53SJla9g7KspfBulnKFbyEiQ7VKRGoFlQlD29o6k?= =?us-ascii?Q?Uf2q5EuHFvqLtCPWPMym4eJgBu/CzPTymU8p9CefA15ocNWmZjMN9up0wYeW?= =?us-ascii?Q?bOdijNb8yVZjtTTgWjNXEkQz7FUwbg0DiGegcmQ59AJjD6Xov5dqtA5IMtT4?= =?us-ascii?Q?xsQ1t2L1NMtvc7E7MJGqDJNZ/DxxitpGadTatblmsaMjNMzdMM2/3H8/Rv0X?= =?us-ascii?Q?4JaMS+vgUhO7WuSxQd+k4p2HhKB/FlRZxcCq8IpfQr4RPzli+Ly4DR1Kp2kW?= =?us-ascii?Q?eOA4MLDe4MXHiPt6Qxr7CQ/JbDq66jt0s0iu9sRZafAMpjo+iBg7Dm46xVYu?= =?us-ascii?Q?ybox3OK4gpTZ7BRaDyrO/PUrsxLR3le+qDg52hYn3zakBeCOwiryUfv+f3wq?= =?us-ascii?Q?QTlHui/hdDEEQU7Lfg/lggHPzWqHH1u4bI7+jRYtlAR8+lBDxw7QK+aIKQAd?= =?us-ascii?Q?6v3GjSMMpyJ59zxhdOR/KmWcO7mFcSxsZlOnfMJpRI3rH4vu5QhxCDkn3lnP?= =?us-ascii?Q?pPG7CDtD12yCNTpctWH+kMZuYjU55SvaDrN2uj3vE6eKoqy6vukoAC5twOBP?= =?us-ascii?Q?U2vHYnL8BHdMFOkdXCEM2W6NgP5gFj9aLrQjukGA/ctpfEFSiNLQj3xHHaUA?= =?us-ascii?Q?4XRTKH5hIsNAW+KOr7C6IJ5u/56QUbhLZudA+/f9jrKeyKXolIHrj+KEHuPz?= =?us-ascii?Q?s2vf/yGQgwA/Jr6AdDbRFi0XfqHlCPWtdDgDt3rntbJUjFCD3Hy1/JhwU9VG?= =?us-ascii?Q?kyXyaPQuKyCoF6fpwdtVfTmEZ8DaKOZJBkmg3JkavVRiM8apEJDgZVDEovwK?= =?us-ascii?Q?ZUD+xUNnAXT2MMXwyuPYZT4SgreOwwzl/0o4DRIlDW4zChHOJ6nX99U5VqbI?= =?us-ascii?Q?XZMNz3YDPRMwZ64kkdawVAeQMIiv99pzXDWWsGOgvzZGwmxpHtoZyCvXwWtc?= =?us-ascii?Q?sVvMQxa8aCV+su6Eok5L7l+xTl61/l+3uK4RcHG93/ih8ff6i+aISERxu0cR?= =?us-ascii?Q?bEPWUfIyjbJtz/HJ1vUMRx/tv1E3z7AwUj4zmgfCTzoUF6cWx+rfIeyXk3KA?= =?us-ascii?Q?HQGVVI3vp5sdoMJ2qBH1zrRCwgA0rGbCJGXcVdMRVILOEy7IHqy2sBOqp3en?= =?us-ascii?Q?VO78gD+gIMS3nKwBIZ5gCwKIRcOHvcj69eOLZXIoxYYi1HQWoq8WdTBd+9Cv?= =?us-ascii?Q?uhuMtq4WPJHe1Y+/9+ova1H+O5yJd85JfnaEIa69UhFMgpGOAnwvW8xIaQwB?= =?us-ascii?Q?7hNaZ0Omvldhf6Ky6iQKzSpjlp4Wj3x3s76NwVq0zybb8MkIuLvXB1ljb3xF?= =?us-ascii?Q?dPf3sPeBDQQV7CsqpIdnFfleXjBk7O8IBiS/yO+5X9Tw/vcqT5KF/+018y85?= =?us-ascii?Q?6AkxMPQeEYiQEvUNmMHNA5rStn1AkgSnld+XIt/7cZwlPN9Pka9Fv76OcLHP?= =?us-ascii?Q?nmLoSlxDovGXErzLT30KR6Z1XyqEvMH1xCx8Jfx/wGQXaC0p29XeKXzptOiW?= =?us-ascii?Q?cthJtgfksE4Euh4QFeeMlrfYbQH7aAueFdv5u+te+Clrp0spaLX5geHuE0ag?= =?us-ascii?Q?YJ2F4ubMS9tIq1DZBFIhim4memEwcfPGwd9d+rlM?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d666848-dd7b-4d01-b062-08da5e95a733 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2022 14:50:07.4198 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nP74jvf3ZUr5Vb01QfwXeI1P6eHhpbVhNyIP/GPt0gaabwfJyri9Ov2qhnU/B+UkPPmjEigMR+4zTIEgbLxlEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1779 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-07-05_11:2022-06-28, 2022-07-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207050063 X-Proofpoint-ORIG-GUID: Y-caWLgDTZlAPrMgGcKgBNCNBCiMjtV1 X-Proofpoint-GUID: Y-caWLgDTZlAPrMgGcKgBNCNBCiMjtV1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 56380 Cc: Michael Heerdegen , Stefan Monnier , "56380@debbugs.gnu.org" <56380@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > >> The docstring of `completing-read' says the argument INITIAL-INPUT > >> is deprecated - yet there are over 30 nontrivial uses in Emacs' > >> own Elisp sources. So, although we currently don't want that this > >> argument is used just to insert a default input, it's sometimes > >> not possible to avoid using it. > > > >> + 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. > > > > It's an improvement on the original text, but this makes it sound like > > inserting a common prefix is something callers are expected to do No, it doesn't. Or rather, why do you think so? > > (But instead it's a super rare special case that virtually nobody > > would actually do in practice.) No, it isn't. Or rather, why do you think so? > > So I'd rather just remove that sentence about what you can > > use INITIAL-INPUT for. Uh, the point of the bug report is to document better what INITIAL-INPUT does, in such a way that users can understand what it's for. > Or say that it should be used in rare cases like a common prefix or a > cons cell for the history argument. The docstring would be then more > in line with the reference manual (the common prefix part has be to be > added to the reference manual, but that is doable.) I disagree that you should be claiming that its use is or should be rare. Just leave it alone, please. I disagree that it's only about a common prefix. And I disagree that, even for just that particular use case, the case is only about a common _prefix_. And I disagree that it's even about _any_ common bit of literal text. What that use case is about is text that _can be useful as initial input_. That's all. Text that users can edit easily, to put to use in the current _completion context_ (which includes use it by completing it). With _prefix_ completion, yes, insertion of a prefix is useful. But even then, the most useful position of point isn't necessarily _after_ that prefix. With other kinds of completion, other "common" text can be appropriate - a common substring, for example. It's not that the text to be inserted is necessarily, literally "common" to all or many of the candidates. It can be that its _completion_, in the current context, is common to some or all candidates. And even that's not necessary. It's only about some usefulness of having the particular text inserted. In general, that means usefulness in _editing_ it, in the broadest sense -- doing with it -- to some advantage. The uses of `completing-read' are many - it contains multitudes. The text suggested is fine. It doesn't go into all of this. It just says "for example", and the example of common-prefix insertion is sufficient. But if you can't see why/when/how what it does can be useful then just say what the INIT arg _does_. And make clear that it's _not_ about INIT being a substitute for DEF. The two are different and independent, though they can also cooperate -- be used together to advantage. Please don't spread a prejudice that INIT is only for some bizarre, "rare" use. Plenty of optional args in Emacs are _truly_ used only rarely, but their doc rightfully doesn't try to steer users away from using them. There's nothing bad or dangerous about using an INIT arg with `completing-read'. It's high time for Emacs to relax and get over it.