Received: (at 76028) by debbugs.gnu.org; 20 Feb 2025 07:59:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 02:59:48 2025 Received: from localhost ([127.0.0.1]:59275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tl1TH-0007jW-Tg for submit <at> debbugs.gnu.org; Thu, 20 Feb 2025 02:59:48 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:37825) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tl1TF-0007ii-BH for 76028 <at> debbugs.gnu.org; Thu, 20 Feb 2025 02:59:45 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3539F44465; Thu, 20 Feb 2025 07:59:36 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <87frkqw0ku.fsf@HIDDEN> Organization: LINKOV.NET References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> <86y0yi5jeu.fsf@HIDDEN> <87frkqw0ku.fsf@HIDDEN> Date: Thu, 20 Feb 2025 09:58:03 +0200 Message-ID: <87h64pgi9g.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeiieeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledrleekrdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdelkedrhedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeegpdhrtghpthhtohepshhtvghfrghnkhgrnhhgrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeitddvkeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvg X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > Agree. I have attached an updated patch to this mail, where the change > is announced in the NEWS. I noticed that in the packages list '/ k' now shows the prompt: [comma-separated list] Keywords (comma separated): Maybe there are more such prompts that need fixing?
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028-done) by debbugs.gnu.org; 15 Feb 2025 11:40:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 06:40:46 2025 Received: from localhost ([127.0.0.1]:53654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tjGXO-0006LI-4x for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 06:40:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33066) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tjGXL-0006L2-GC for 76028-done <at> debbugs.gnu.org; Sat, 15 Feb 2025 06:40:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tjGXE-0004ki-Q3; Sat, 15 Feb 2025 06:40:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7lAl1XtCu3JerKgDbXgLAoyqZSnCc7RxjJXX6u65OLw=; b=TP6UX7+oe0G6 muIXcbZMcUF5MJquuE1dYBHCWvsaAKialHMzZ3NaJUTlO7KA6C1E6nj4B2IHYkHGSmB+RIY/V8eCR syyyWuaXbv9OGijLAIJHu3VFGzQsbYyEmD3xpDuoEXA8lfFmFHnhFTgsM4RhqlM3WbXZctDrGx2i7 HGeonDui+d58AOpQQrykewr3C0Jj4iBDhUnBHcqJAKhG38FdICBjshBvgw9xLUytCtlSmsCtjjMuM pv8Qh7LJLQ/9o0bos9J5X0oWEYx5DrX0cT6Qw6UPKnUMtefC8SNMbbM2Dhh2Nf1WsDt6NSLYON2cX ozdmGu4o2C4gTCLRqSM7hQ==; Date: Sat, 15 Feb 2025 13:40:32 +0200 Message-Id: <86jz9re8r3.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <874j16hriz.fsf@HIDDEN> (message from Daniel Mendler on Fri, 07 Feb 2025 13:24:04 +0100) Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> <86y0yi5jeu.fsf@HIDDEN> <87frkqw0ku.fsf@HIDDEN> <86a5ay55vy.fsf@HIDDEN> <874j16hriz.fsf@HIDDEN> X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: 76028-done Cc: 76028-done <at> debbugs.gnu.org, stefankangas@HIDDEN, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.6 (--) > From: Daniel Mendler <mail@HIDDEN> > Cc: juri@HIDDEN, 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN > Date: Fri, 07 Feb 2025 13:24:04 +0100 > > Eli Zaretskii <eliz@HIDDEN> writes: > > >> From: Daniel Mendler <mail@HIDDEN> > >> Cc: Juri Linkov <juri@HIDDEN>, 76028 <at> debbugs.gnu.org, > >> stefankangas@HIDDEN > >> Date: Fri, 07 Feb 2025 10:44:49 +0100 > >> > >> Eli Zaretskii <eliz@HIDDEN> writes: > >> > >> > I think this does have to be called out in NEWS, including the new > >> > user option. In a sense, this is an incompatible behavior change, so > >> > we cannot introduce it silently. > >> > >> Agree. I have attached an updated patch to this mail, where the change > >> is announced in the NEWS. > > > > Thanks, I have a few minor comments below. > > Thanks. I have attached an updated patch with an improved NEWS entry to > this mail. Also thank you for the explanation regarding --- and +++. Now installed on master, and closing the bug. Thanks.
Daniel Mendler <mail@HIDDEN>
:Eli Zaretskii <eliz@HIDDEN>
:Received: (at 76028) by debbugs.gnu.org; 7 Feb 2025 12:24:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 07:24:15 2025 Received: from localhost ([127.0.0.1]:33269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tgNP5-0005wJ-3e for submit <at> debbugs.gnu.org; Fri, 07 Feb 2025 07:24:15 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:46147 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tgNP2-0005w1-3Q for 76028 <at> debbugs.gnu.org; Fri, 07 Feb 2025 07:24:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=6hgrIW8UduZq8r3+7IP5l2pFvooSLaljmyrF5vgFMTI=; b=LdyHo2pgIPEQzvfwAlP8zJHj0g RaOS2NY3So1Po1AVPgkhcMnpXrugloeMAmhf9kmnDQtyev9+g0iUbgnLWGojTeERgosbGeY22vodZ Uw2HZaNb+hcOfZ13w/Sqipx7aoTu3HbARQF8r8dR8OrfsfkoB2PgIWPRqe58dvST34Js=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <86a5ay55vy.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 07 Feb 2025 13:52:17 +0200") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> <86y0yi5jeu.fsf@HIDDEN> <87frkqw0ku.fsf@HIDDEN> <86a5ay55vy.fsf@HIDDEN> Date: Fri, 07 Feb 2025 13:24:04 +0100 Message-ID: <874j16hriz.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii <eliz@HIDDEN> writes: >> From: Daniel Mendler <mail@HIDDEN> >> Cc: Juri Linkov <juri@HIDDEN>, 76028 <at> debbugs.gnu.org, >> stefankangas@HIDDEN >> Date: Fri, 07 Feb 2025 10:44:49 +0100 >> >> Eli Zaretskii <eliz@HIDDEN> writes: >> >> > I think this does have to be called out in NEWS, including the new >> > user option. In a sense, this is an incompatible behavior change, so >> > we cannot introduce it silently. >> >> Agree. I have attached an updated patch to this mail, where the change >> is announced in the NEWS. > > Thanks, I have a few minor comments below. Thanks. I have attached an updated patch with an improved NEWS entry to this mail. Also thank you for the explanation regarding --- and +++. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-completing-read-multiple-CRM-indication-and-prompt-c.patch From 46504cf102e110532814f9d31b0d442dacc28037 Mon Sep 17 00:00:00 2001 From: Daniel Mendler <mail@HIDDEN> Date: Mon, 3 Feb 2025 16:39:49 +0100 Subject: [PATCH] completing-read-multiple: CRM indication and prompt customization The `completing-read-multiple' prompt indicates multi completion. The customization option `crm-prompt' configures the formatting of the prompt. The variable can be set to "%p" in order to only display the original prompt, to "[%d] %p" to display the separator description and the prompt, or to "[CRM%s] %p" to display a shorter indicator of only the separator string and the prompt. * lisp/emacs-lisp/crm.el (crm-prompt): New user option. (crm-separator): Update value and docstring. (completing-read-multiple): Use `crm-prompt' to format the prompt. * etc/NEWS: Announce the change. --- etc/NEWS | 8 ++++++++ lisp/emacs-lisp/crm.el | 30 ++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index ade635aa924..1476a471d00 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -176,6 +176,14 @@ will still be on that candidate after "*Completions*" is updated with a new list of completions. The candidate is automatically deselected when the "*Completions*" buffer is hidden. +--- +*** New user option 'crm-prompt' for 'completing-read-multiple'. +This option configures the prompt format of 'completing-read-multiple'. +By default the prompt indicates to the user that the completion command +accepts a comma-separated list. The prompt format can include the +separator description and the separator string, which are both stored as +text properties of the 'crm-separator' regular expression. + ** Windows +++ diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 454c3e85074..e081e66dfe1 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -79,9 +79,25 @@ (define-obsolete-variable-alias 'crm-default-separator 'crm-separator "29.1") -(defvar crm-separator "[ \t]*,[ \t]*" +(defvar crm-separator + (propertize "[ \t]*,[ \t]*" 'separator "," 'description "comma-separated list") "Separator regexp used for separating strings in `completing-read-multiple'. -It should be a regexp that does not match the list of completion candidates.") +It should be a regexp that does not match the list of completion +candidates. The regexp string can carry the text properties `separator' +and `description', which if present `completing-read-multiple' will show +as part of the prompt. See the user option `crm-prompt'.") + +(defcustom crm-prompt "[%d] %p" + "Prompt format for `completing-read-multiple'. +The prompt is formatted by `format-spec' with the keys %d, %s and %p +standing for the separator description, the separator itself and the +original prompt respectively." + :type '(choice (const :tag "Original prompt" "%p") + (const :tag "Description and prompt" "[%d] %p") + (const :tag "Short CRM indication" "[CRM%s] %p") + (string :tag "Custom string")) + :group 'minibuffer + :version "31.1") (defvar-keymap crm-local-completion-map :doc "Local keymap for minibuffer multiple input with completion. @@ -272,8 +288,14 @@ completing-read-multiple (unless (eq require-match t) require-match)) (setq-local crm-completion-table table)) (setq input (read-from-minibuffer - prompt initial-input map - nil hist def inherit-input-method))) + (format-spec + crm-prompt + (let* ((sep (or (get-text-property 0 'separator crm-separator) + (string-replace "[ \t]*" "" crm-separator))) + (desc (or (get-text-property 0 'description crm-separator) + (concat "list separated by " sep)))) + `((?s . ,sep) (?d . ,desc) (?p . ,prompt)))) + initial-input map nil hist def inherit-input-method))) ;; If the user enters empty input, `read-from-minibuffer' ;; returns the empty string, not DEF. (when (and def (string-equal input "")) -- 2.47.2 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 7 Feb 2025 11:52:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 06:52:32 2025 Received: from localhost ([127.0.0.1]:33183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tgMuO-0004Tk-Ac for submit <at> debbugs.gnu.org; Fri, 07 Feb 2025 06:52:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53688) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tgMuL-0004TT-8Q for 76028 <at> debbugs.gnu.org; Fri, 07 Feb 2025 06:52:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tgMuE-00048k-2V; Fri, 07 Feb 2025 06:52:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x72EgNWRnEWyL+sWSWfzLFMtWIgukWEAEKznB3d1VBA=; b=OdS2kcSARamz z+ZpGrlC5xS9UZmE2BcLxf1CA9F9puGNWOfXaCN/1KbsuT3pLMKbwuqX+G+UrpFoLBou1Bj9Xseso DPKHyE5lFitW3bxAISjnqMgTF4uFUirVJ5Ij6rhze3GChHljnEz3I7kKiu2aovW0Vv5nyynTZ/P/p v1waypePg0cY+VAhlgHblJ4e8EprWJp+aGV24+IxjtkZoS6ymmQ/NuyBtrNyjT+Mv7ccizkF/HtAp J7fZ5WYL3qUAOsig9Ya/KYi5yA9A8m6YP2JeTaW/yf1/lGxT/orXFiW5eAwvkbP8Wx0ZYqYh9Mao7 lcTcRFK0x3gm+3lQE4M1BQ==; Date: Fri, 07 Feb 2025 13:52:17 +0200 Message-Id: <86a5ay55vy.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <87frkqw0ku.fsf@HIDDEN> (message from Daniel Mendler on Fri, 07 Feb 2025 10:44:49 +0100) Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> <86y0yi5jeu.fsf@HIDDEN> <87frkqw0ku.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Daniel Mendler <mail@HIDDEN> > Cc: Juri Linkov <juri@HIDDEN>, 76028 <at> debbugs.gnu.org, > stefankangas@HIDDEN > Date: Fri, 07 Feb 2025 10:44:49 +0100 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > I think this does have to be called out in NEWS, including the new > > user option. In a sense, this is an incompatible behavior change, so > > we cannot introduce it silently. > > Agree. I have attached an updated patch to this mail, where the change > is announced in the NEWS. Thanks, I have a few minor comments below. > ++++ The "+++" marker means the manuals weer updated with this information, which is not true in this case. If you think this should be described in the ELisp manual, please include a patch for that. If you think this is too minor to be in the manual, please mark the NEWS entry with "---" instead. > +*** New user option 'crm-prompt'. > +This option configures the prompt of 'completing-read-multiple'. By > +default the prompt indicates to the user that the completion accepts a > +comma-separated list. Two spaces between sentences, please. More importantly, it sounds like you tried to describe both the changes to 'completing-read-multiple' and the new option. I think it would be better to describe them in two separate entries. In any case, the entry for 'crm-prompt' should describe the default value. > The variable 'crm-separator' carries the prompt > +description and the separator string as text properties. I didn't understand this sentence: what do you mean by "carries" here? I guess a more detailed description is needed for this part. Thanks.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 7 Feb 2025 09:45:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 04:45:00 2025 Received: from localhost ([127.0.0.1]:32867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tgKux-0000Zx-Pg for submit <at> debbugs.gnu.org; Fri, 07 Feb 2025 04:45:00 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:42063 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tgKuv-0000Zg-8G for 76028 <at> debbugs.gnu.org; Fri, 07 Feb 2025 04:44:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=Zn1JyNtqjblI5feInFFXgFns0pLi6tY51+kLZRc82fQ=; b=qWuarM2sBK3tgWjYcOiCAuWgbS x1BWOdlRhEc5IxcCO2679Q3NSAh1YUFhBUZxzgmhv+q3+h3Wm4P+Rfmf+5slv1yssyfdT2TPy1jm7 02fwwjgoweuxx0t36Sduj4alXb6Retzq0klUpFBwC8gTDtbgo97s90+vmj8K0dpRq/mY=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <86y0yi5jeu.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 07 Feb 2025 09:00:09 +0200") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> <86y0yi5jeu.fsf@HIDDEN> Date: Fri, 07 Feb 2025 10:44:49 +0100 Message-ID: <87frkqw0ku.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii <eliz@HIDDEN> writes: >> From: Juri Linkov <juri@HIDDEN> >> Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas >> <stefankangas@HIDDEN> >> Date: Thu, 06 Feb 2025 19:24:13 +0200 >> >> >> But anyway it seems text properties are the least intrusive approach. >> > >> > It seems so. The patch gets quite short. I have attached the updated >> > patch to this mail. >> >> Thanks, I could push if there are no more objections, >> and no NEWS required for this change. > > I think this does have to be called out in NEWS, including the new > user option. In a sense, this is an incompatible behavior change, so > we cannot introduce it silently. Agree. I have attached an updated patch to this mail, where the change is announced in the NEWS. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-completing-read-multiple-CRM-indication-and-prompt-c.patch From 3632bfdc280f38a366d93ccdacf99eade7aa94f0 Mon Sep 17 00:00:00 2001 From: Daniel Mendler <mail@HIDDEN> Date: Mon, 3 Feb 2025 16:39:49 +0100 Subject: [PATCH] completing-read-multiple: CRM indication and prompt customization The `completing-read-multiple' prompt indicates multi completion. The customization option `crm-prompt' configures the formatting of the prompt. The variable can be set to "%p" in order to only display the original prompt, to "[%d] %p" to display the separator description and the prompt, or to "[CRM%s] %p" to display a shorter indicator of only the separator string and the prompt. * lisp/emacs-lisp/crm.el (crm-prompt): New user option. (crm-separator): Update value and docstring. (completing-read-multiple): Use `crm-prompt' to format the prompt. * etc/NEWS: Announce the change. --- etc/NEWS | 7 +++++++ lisp/emacs-lisp/crm.el | 30 ++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index ade635aa924..13dfa2008f0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -176,6 +176,13 @@ will still be on that candidate after "*Completions*" is updated with a new list of completions. The candidate is automatically deselected when the "*Completions*" buffer is hidden. ++++ +*** New user option 'crm-prompt'. +This option configures the prompt of 'completing-read-multiple'. By +default the prompt indicates to the user that the completion accepts a +comma-separated list. The variable 'crm-separator' carries the prompt +description and the separator string as text properties. + ** Windows +++ diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 454c3e85074..e081e66dfe1 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -79,9 +79,25 @@ (define-obsolete-variable-alias 'crm-default-separator 'crm-separator "29.1") -(defvar crm-separator "[ \t]*,[ \t]*" +(defvar crm-separator + (propertize "[ \t]*,[ \t]*" 'separator "," 'description "comma-separated list") "Separator regexp used for separating strings in `completing-read-multiple'. -It should be a regexp that does not match the list of completion candidates.") +It should be a regexp that does not match the list of completion +candidates. The regexp string can carry the text properties `separator' +and `description', which if present `completing-read-multiple' will show +as part of the prompt. See the user option `crm-prompt'.") + +(defcustom crm-prompt "[%d] %p" + "Prompt format for `completing-read-multiple'. +The prompt is formatted by `format-spec' with the keys %d, %s and %p +standing for the separator description, the separator itself and the +original prompt respectively." + :type '(choice (const :tag "Original prompt" "%p") + (const :tag "Description and prompt" "[%d] %p") + (const :tag "Short CRM indication" "[CRM%s] %p") + (string :tag "Custom string")) + :group 'minibuffer + :version "31.1") (defvar-keymap crm-local-completion-map :doc "Local keymap for minibuffer multiple input with completion. @@ -272,8 +288,14 @@ completing-read-multiple (unless (eq require-match t) require-match)) (setq-local crm-completion-table table)) (setq input (read-from-minibuffer - prompt initial-input map - nil hist def inherit-input-method))) + (format-spec + crm-prompt + (let* ((sep (or (get-text-property 0 'separator crm-separator) + (string-replace "[ \t]*" "" crm-separator))) + (desc (or (get-text-property 0 'description crm-separator) + (concat "list separated by " sep)))) + `((?s . ,sep) (?d . ,desc) (?p . ,prompt)))) + initial-input map nil hist def inherit-input-method))) ;; If the user enters empty input, `read-from-minibuffer' ;; returns the empty string, not DEF. (when (and def (string-equal input "")) -- 2.47.2 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 7 Feb 2025 07:00:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 02:00:22 2025 Received: from localhost ([127.0.0.1]:60588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tgILe-0000wq-88 for submit <at> debbugs.gnu.org; Fri, 07 Feb 2025 02:00:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53998) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tgILa-0000rb-0m for 76028 <at> debbugs.gnu.org; Fri, 07 Feb 2025 02:00:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tgILT-0004pQ-72; Fri, 07 Feb 2025 02:00:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=bX/f0qI36u6hZy+3KP9KsBhBpBkDgQ7ykqqIrI1VYXI=; b=sHgOAtoR9iCc jzfh/YJZj451TQMukVhaOW1zBaVYaQjao0nZ1MBDgGISdCk9sbtpFrvDXGvGv2DXUOc6Gl0YroX/Q SYnpptaKLN+IxXdFJIOxhHl7L4DPQGMKVHtO/pG4XpMYF3VTo8A1IIHvnNjgcavxIvOsyV/lykbHi yXBxANCv/IAECAQwBX164sGYZypRCYPZ4X1clDq8rJLODYEkI8v0+7xyhsyCUoFR+xJEQqmi3A2Kb OXqmmeVg0JiqM57+WYdj/s73xV18yiOSYmxPst4GEykJhw05dePNVg5uXboLiJIX32C2HFT9TzrSC 5mxsWa2XlclLGuNbTrf0ig==; Date: Fri, 07 Feb 2025 09:00:09 +0200 Message-Id: <86y0yi5jeu.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Juri Linkov <juri@HIDDEN> In-Reply-To: <871pwbt29u.fsf@HIDDEN> (message from Juri Linkov on Thu, 06 Feb 2025 19:24:13 +0200) Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76028 Cc: mail@HIDDEN, 76028 <at> debbugs.gnu.org, stefankangas@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas > <stefankangas@HIDDEN> > Date: Thu, 06 Feb 2025 19:24:13 +0200 > > >> But anyway it seems text properties are the least intrusive approach. > > > > It seems so. The patch gets quite short. I have attached the updated > > patch to this mail. > > Thanks, I could push if there are no more objections, > and no NEWS required for this change. I think this does have to be called out in NEWS, including the new user option. In a sense, this is an incompatible behavior change, so we cannot introduce it silently.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 6 Feb 2025 22:24:50 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 06 17:24:49 2025 Received: from localhost ([127.0.0.1]:59704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tgAIj-0006tM-N4 for submit <at> debbugs.gnu.org; Thu, 06 Feb 2025 17:24:49 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:61911) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tgAIh-0006t8-Fy for 76028 <at> debbugs.gnu.org; Thu, 06 Feb 2025 17:24:48 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5dcdfa7df68so2493029a12.3 for <76028 <at> debbugs.gnu.org>; Thu, 06 Feb 2025 14:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738880681; x=1739485481; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=cRCoaPRyYmxPth7nmG4wImTSnKuViOjlUsMM8IjHt5w=; b=BVykA6Q72qf7NnihAykrS06c8RMtbIp/kN0mTlf1vfrIsZyYGXoXgfUGoYHnqNwiUM g7xfspHLdNnsii1Ta1RxOSLmPpLwqZTXoB9C7ookEByKWyPUA9Pwv2Lw1Wf/ZJu2Qc4j cEKcCN/kCxmJbC9E43CVbGtIXTyYd4mjZz9Dq+04ywbzN/JpN4MUvoU7ce6YIeDvppNm ymZMjomYmek2TV9IiWyuP3iyK5yNWUsyLfocVl1yjIi5bQ9cQtroi9wOz0twKO1eO42Y 86VLBHTdWF6lU7wvBJHxKFmr49/e9ehAVxzm5BsvrqkoMiT9s00cnTH2oMQfOBV3KJBn 8AFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738880681; x=1739485481; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cRCoaPRyYmxPth7nmG4wImTSnKuViOjlUsMM8IjHt5w=; b=tf2Zc62OddmXKO0oMnm3wh5gFnQ5pPe6qUwbBi7QwJ0bs9XcIujoTHmHW9QGnoLxk8 7tqu6TC5pc4ZsS0iul9T7l0+IR/0hKG36clMDVPX7k19cYNr9CH58VXhwbnXlGdrFROR otB792YSxlhmvSoOg0AqKOrjkA/AOBzEHP0emgoZHvj+BIIICciXzKWhrI3gU5QA3rwi i+RaEiJG36teQZQGRWXXk0TOk4UYHV925oMcocA8AtqIiw9eV5A/3/0WI3QmP42TRX1u 0yIAJjhoH9yjQ+ftCJiZ9AIDqyB2A7f16mrIBQ/ZwGwAJr6zpyuIAKAbTBmAsOeclzhq RUbA== X-Forwarded-Encrypted: i=1; AJvYcCVrAIbcXHe27UMClSEVhyZ8FTNg6Az82oUDvYlKQOa/1nJdGgTZxA2FCSO9IRwApSYsMfSzEw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw5fvqiTWFZpPaYCDy1dJsr4pcsqiTZSJXhdmB47vEPaPFihJr/ Kg9AYayvpMN6C+A1u/Y9pCVq9m1TqzBkJ4NeNjzwiK+6iguJqWXhPCSABaIi49+UfPoeEkFEq9A 62lY2MppmvaECukMGTMMIQywniHw= X-Gm-Gg: ASbGncsLO/ITkM1KJ4lXsn3Q86L5LGGATEx6YEk17H8w0CyQZIPeAsrKC5XWszy0Rit UjuKBhZbTzHeGYZV5yFhhM8EYBoErFjA1X2PHT5GW7Ozlw/9uwuXOmQ3CKWb/0jEvWC28hA== X-Google-Smtp-Source: AGHT+IH3Lnc4CyBpt6fclEbclPl8eimOCtRdZr0VDj7dQgxD9TYXh+Kj9QWCGMS0U/FQOnnjHftnas1rd3hxZjzGg60= X-Received: by 2002:a05:6402:a00f:b0:5dc:8845:69fc with SMTP id 4fb4d7f45d1cf-5de450881b8mr1209381a12.28.1738880681225; Thu, 06 Feb 2025 14:24:41 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 6 Feb 2025 14:24:40 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <871pwbt29u.fsf@HIDDEN> References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> <871pwbt29u.fsf@HIDDEN> MIME-Version: 1.0 Date: Thu, 6 Feb 2025 14:24:40 -0800 X-Gm-Features: AWEUYZk4nNf1pEmJwmChHwlB-z70BqMLNHo1VeokgwJCgEdDNoz_x2-xGM9_OSQ Message-ID: <CADwFkmnJ+jxTCooHz_Y120wdvjAMXqdBqwqpLsRo4LYFLi9FUQ@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator To: Juri Linkov <juri@HIDDEN>, Daniel Mendler <mail@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Juri Linkov <juri@HIDDEN> writes: >>> But anyway it seems text properties are the least intrusive approach. >> >> It seems so. The patch gets quite short. I have attached the updated >> patch to this mail. > > Thanks, I could push if there are no more objections, > and no NEWS required for this change. LGTM.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 6 Feb 2025 17:25:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 06 12:25:16 2025 Received: from localhost ([127.0.0.1]:59335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tg5cp-0001O2-NO for submit <at> debbugs.gnu.org; Thu, 06 Feb 2025 12:25:15 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:54429) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tg5cm-0001JN-Nc for 76028 <at> debbugs.gnu.org; Thu, 06 Feb 2025 12:25:13 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5A7144441D; Thu, 6 Feb 2025 17:25:04 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <87a5b1zgf8.fsf@HIDDEN> Organization: LINKOV.NET References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> <87a5b1zgf8.fsf@HIDDEN> Date: Thu, 06 Feb 2025 19:24:13 +0200 Message-ID: <871pwbt29u.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieelkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledrleeirdeltdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledrleeirdeltddphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeegpdhrtghpthhtohepshhtvghfrghnkhgrnhhgrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeitddvkeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvg X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> But anyway it seems text properties are the least intrusive approach. > > It seems so. The patch gets quite short. I have attached the updated > patch to this mail. Thanks, I could push if there are no more objections, and no NEWS required for this change.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 4 Feb 2025 18:57:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 13:57:43 2025 Received: from localhost ([127.0.0.1]:46662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tfO7D-0005jp-2R for submit <at> debbugs.gnu.org; Tue, 04 Feb 2025 13:57:43 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:32795 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tfO79-0005jW-Og for 76028 <at> debbugs.gnu.org; Tue, 04 Feb 2025 13:57:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=uKDbn1p7KofsOgbRDvbL7aofXF6q1+K46hnRru0YYmE=; b=lbuNIOUTjyygnm3yQ/vIF5KFoe 43DNk78jBtzaGuXGOKnUsT5xSbG/3QHfmJsxZgx7m9VKlJpT1jMGHhjbJ5t7iCck2d4boon72pmYu d9q2IdKS5gZfsad+spvdfm4xlRJBz7hItno5vNwc611xkN1FQJ2pg/9ALDuDV0b+Eoak=; From: Daniel Mendler <mail@HIDDEN> To: Juri Linkov <juri@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <87r04d7exz.fsf@HIDDEN> (Juri Linkov's message of "Tue, 04 Feb 2025 20:16:56 +0200") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> <87r04d7exz.fsf@HIDDEN> Date: Tue, 04 Feb 2025 19:57:31 +0100 Message-ID: <87a5b1zgf8.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Juri Linkov <juri@HIDDEN> writes: >> Another more tricky approach would be to attach text properties to >> crm-separator which carry the additional data. This would be backward- >> and forward-compatible also for third-party code, but maybe not very >> elegant. What do you think? > > Although text properties are not customizable, this should not be > a problem for third-party packages. And crm-separator is a variable, > not a defcustom. > >>>> Another possibility might be to use the completion category and the >>>> separator string and convert that to an example, e.g., category face >>>> would yield the prompt "Describe face (face1,face2,...):". >>> >>> Maybe then it's possible to provide the separator and its description >>> in the metadata? >> >> This would be more intrusive. Also the question is if the crm-separator >> is truly bound to the completion table, or if it should be possible to >> reuse the same table with different separators. > > Then it's possible to override the separator. But anyway it seems > text properties are the least intrusive approach. It seems so. The patch gets quite short. I have attached the updated patch to this mail. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-completing-read-multiple-CRM-indication-and-prompt-c.patch From 0bc194f982a7fa74ab66f0449a5a3bd651a4b300 Mon Sep 17 00:00:00 2001 From: Daniel Mendler <mail@HIDDEN> Date: Mon, 3 Feb 2025 16:39:49 +0100 Subject: [PATCH] completing-read-multiple: CRM indication and prompt customization The `completing-read-multiple' prompt indicates multi completion. The customization option `crm-prompt' configures the formatting of the prompt. The variable can be set to "%p" in order to only display the original prompt, to "[%d] %p" to display the separator description and the prompt, or to "[CRM %s] %p" to display a shorter indicator of only the separator string and the prompt. * lisp/emacs-lisp/crm.el (crm-prompt): New user option. (crm-separator): Update value and docstring. (completing-read-multiple): Use `crm-prompt' to format the prompt. --- lisp/emacs-lisp/crm.el | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 454c3e85074..3a4e5a944ae 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -79,9 +79,22 @@ (define-obsolete-variable-alias 'crm-default-separator 'crm-separator "29.1") -(defvar crm-separator "[ \t]*,[ \t]*" +(defvar crm-separator + (propertize "[ \t]*,[ \t]*" 'separator "," 'description "comma-separated list") "Separator regexp used for separating strings in `completing-read-multiple'. -It should be a regexp that does not match the list of completion candidates.") +It should be a regexp that does not match the list of completion +candidates. The regexp string can carry the text properties `separator' +and `description', which if present `completing-read-multiple' will show +as part of the prompt. See the variable `crm-prompt'.") + +(defcustom crm-prompt "[%d] %p" + "Prompt format for `completing-read-multiple'. +The prompt is formatted by `format-spec' with the keys %d, %s and %p +standing for the separator description, the separator itself and the +original prompt respectively." + :type 'string + :group 'minibuffer + :version "31.1") (defvar-keymap crm-local-completion-map :doc "Local keymap for minibuffer multiple input with completion. @@ -272,7 +285,14 @@ completing-read-multiple (unless (eq require-match t) require-match)) (setq-local crm-completion-table table)) (setq input (read-from-minibuffer - prompt initial-input map + (format-spec + crm-prompt + (let* ((sep (or (get-text-property 0 'separator crm-separator) + (string-replace "[ \t]*" "" crm-separator))) + (desc (or (get-text-property 0 'description crm-separator) + (concat "list separated by " sep)))) + `((?s . ,sep) (?d . ,desc) (?p . ,prompt)))) + initial-input map nil hist def inherit-input-method))) ;; If the user enters empty input, `read-from-minibuffer' ;; returns the empty string, not DEF. -- 2.47.2 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 4 Feb 2025 18:26:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 13:26:04 2025 Received: from localhost ([127.0.0.1]:46594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tfNca-0004Fc-Jw for submit <at> debbugs.gnu.org; Tue, 04 Feb 2025 13:26:04 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50917) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tfNcZ-0004F2-3I for 76028 <at> debbugs.gnu.org; Tue, 04 Feb 2025 13:26:03 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 09B824417C; Tue, 4 Feb 2025 18:25:52 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <87seounmf4.fsf@HIDDEN> (Daniel Mendler's message of "Tue, 04 Feb 2025 09:28:47 +0100") Organization: LINKOV.NET References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> <87seounmf4.fsf@HIDDEN> Date: Tue, 04 Feb 2025 20:16:56 +0200 Message-ID: <87r04d7exz.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvuddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledrleeirdeltdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledrleeirdeltddphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopeegpdhrtghpthhtohepshhtvghfrghnkhgrnhhgrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeitddvkeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehmrghilhesuggrnhhivghlqdhmvghnughlvghrrdguvg X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > Another more tricky approach would be to attach text properties to > crm-separator which carry the additional data. This would be backward- > and forward-compatible also for third-party code, but maybe not very > elegant. What do you think? Although text properties are not customizable, this should not be a problem for third-party packages. And crm-separator is a variable, not a defcustom. >>> Another possibility might be to use the completion category and the >>> separator string and convert that to an example, e.g., category face >>> would yield the prompt "Describe face (face1,face2,...):". >> >> Maybe then it's possible to provide the separator and its description >> in the metadata? > > This would be more intrusive. Also the question is if the crm-separator > is truly bound to the completion table, or if it should be possible to > reuse the same table with different separators. Then it's possible to override the separator. But anyway it seems text properties are the least intrusive approach.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 4 Feb 2025 08:29:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 03:29:00 2025 Received: from localhost ([127.0.0.1]:42518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tfEIl-00070a-Lz for submit <at> debbugs.gnu.org; Tue, 04 Feb 2025 03:29:00 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:38889 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tfEIj-00070J-3b for 76028 <at> debbugs.gnu.org; Tue, 04 Feb 2025 03:28:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To: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=dEs1KK+79nE0IWSr3f0Nbg0dbr2FdMoPkpRkvjKY1BE=; b=iZ4D3+me9CxGLgqYGdZqx97xmW +76/W7Ol+lLDOOUwkj4r/cUNUp69uBj1jl0p/p6zpwO/wKKFdQmwBDlrnurAa3jRDYV47PihDjmDp 5riJUNpd/c7wb/F5fiziy+Rez0nRazpKhDjaXP66fPN9Ps76+6T2fa6dF5JRYJmqHknM=; From: Daniel Mendler <mail@HIDDEN> To: Juri Linkov <juri@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <874j1auoe6.fsf@HIDDEN> (Juri Linkov's message of "Tue, 04 Feb 2025 09:54:17 +0200") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> <874j1auoe6.fsf@HIDDEN> Date: Tue, 04 Feb 2025 09:28:47 +0100 Message-ID: <87seounmf4.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Juri Linkov <juri@HIDDEN> writes: >>> Describe face (face1,face2,...): >>> >>> A more generalized prompt would make this less clear, e.g. >>> >>> Describe face (separator =E2=80=98,=E2=80=99): >> >> Giving an example does not solve the general issue of a uniform CRM >> indication for all `completing-read-multiple' calls. In the Emacs code >> base `completing-read-multiple' is not used widely but it is used in >> other packages, which we cannot update at once. > > Wouldn't addition of more text to the prompt break these packages > in some way? Maybe only those that rely on the fixed format > like minibuf-eldef.el that is quite rare. I have not seen many such packages which rely on the prompt format, but yes, one should check the ones like minibuf-eldef.el. I have used my [CRM,] indicator advice for a long time without big problems. >> I find Stefan's suggestion of [comma-separated list] quite nice. See the >> patch I have sent in the other mail. Maybe we could use the >> [comma-separated list] indicator as fallback if a >> `completing-read-multiple' call does not provide examples on its own? > > The only problem with the patch is that it would be better > to leave the existing format of the variable 'crm-separator' > to avoid possible backward-compatibility problems, > and then add a new variable or two for the separator > and its description. Yes, the change of format could be a problem. However if one uses multiple variables one can easily forget to bind or configure them together, which leads to bugs or an inconsistency. Currently there is code, also third-party code, which let-binds a custom crm-separator but of course not the other variables, such that there would be an inconsistency immediately if we introduce the new variables. Therefore I would stick to a single variable. We could also introduce a new variable crm-config with the proposed list format which is used if crm-separator is nil. crm-separator will be nil by default and marked obsolete. Another more tricky approach would be to attach text properties to crm-separator which carry the additional data. This would be backward- and forward-compatible also for third-party code, but maybe not very elegant. What do you think? >> Another possibility might be to use the completion category and the >> separator string and convert that to an example, e.g., category face >> would yield the prompt "Describe face (face1,face2,...):". > > Maybe then it's possible to provide the separator and its description > in the metadata? This would be more intrusive. Also the question is if the crm-separator is truly bound to the completion table, or if it should be possible to reuse the same table with different separators. Daniel
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 4 Feb 2025 08:06:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 04 03:06:21 2025 Received: from localhost ([127.0.0.1]:42484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tfDwr-00060K-GU for submit <at> debbugs.gnu.org; Tue, 04 Feb 2025 03:06:21 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:48047) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tfDwo-000603-SG for 76028 <at> debbugs.gnu.org; Tue, 04 Feb 2025 03:06:19 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9E1BC44369; Tue, 4 Feb 2025 08:06:10 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <878qqmg9ik.fsf@HIDDEN> (Daniel Mendler's message of "Mon, 03 Feb 2025 19:37:07 +0100") Organization: LINKOV.NET References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> <878qqmg9ik.fsf@HIDDEN> Date: Tue, 04 Feb 2025 09:54:17 +0200 Message-ID: <874j1auoe6.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleeljecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeeiffetjeegheffjeeutdeihfdukeegjeetkeeigfevueehtedvfeegkeekveekudenucfkphepledurdduvdelrdeliedrledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdeliedrledtpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopehsthgvfhgrnhhkrghnghgrshesghhmrghilhdrtghomhdprhgtphhtthhopeejiedtvdekseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggv X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> Describe face (face1,face2,...): >> >> A more generalized prompt would make this less clear, e.g. >> >> Describe face (separator ‘,’): > > Giving an example does not solve the general issue of a uniform CRM > indication for all `completing-read-multiple' calls. In the Emacs code > base `completing-read-multiple' is not used widely but it is used in > other packages, which we cannot update at once. Wouldn't addition of more text to the prompt break these packages in some way? Maybe only those that rely on the fixed format like minibuf-eldef.el that is quite rare. > I find Stefan's suggestion of [comma-separated list] quite nice. See the > patch I have sent in the other mail. Maybe we could use the > [comma-separated list] indicator as fallback if a > `completing-read-multiple' call does not provide examples on its own? The only problem with the patch is that it would be better to leave the existing format of the variable 'crm-separator' to avoid possible backward-compatibility problems, and then add a new variable or two for the separator and its description. > Another possibility might be to use the completion category and the > separator string and convert that to an example, e.g., category face > would yield the prompt "Describe face (face1,face2,...):". Maybe then it's possible to provide the separator and its description in the metadata?
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 18:37:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 13:37:18 2025 Received: from localhost ([127.0.0.1]:41202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tf1Ju-0006tE-6E for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 13:37:18 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:53943 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tf1Js-0006sx-Ic for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 13:37:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To: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=RRqCLg0NvK+jLgxV0D9xWaZELaot80CQCWgmxlCU4oY=; b=IRO8uScocRYvpcKmJQTueb3ATf lPrMduNXuiF+071gaKRgo+YMBJpkYodmWUhJVFM/0FTUJHvaBafas5h6XL/+cwdo/opzhbG3gRM33 NVWCjxUsO83Nmr6w7CHpo+23mzPcmfiDDAFz8yvNZK8yzXaOIbTk2QYesOa5D9H07dNs=; From: Daniel Mendler <mail@HIDDEN> To: Juri Linkov <juri@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <878qqm52vb.fsf@HIDDEN> (Juri Linkov's message of "Mon, 03 Feb 2025 19:56:08 +0200") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> <878qqm52vb.fsf@HIDDEN> Date: Mon, 03 Feb 2025 19:37:07 +0100 Message-ID: <878qqmg9ik.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Juri Linkov <juri@HIDDEN> writes: >>> > I propose to add such an indicator to CRM by default. Above I have >>> > chosen the tag "CRM" for its shortness, but a more user friendly >>> > solution might require a longer more descriptive name. Furthermore the >>> > code above extracts the separator from the regular expression >>> > `crm-separator', which is not robust for all separators. >>>=20 >>> How about " [comma-separated list] "? >> >> Or maybe "Describe face (FACE1[,FACE2[,...]]): " > > I see no more descriptive prompt that providing an example, > maybe with lower-case like all faces: > > Describe face (face1,face2,...): > > A more generalized prompt would make this less clear, e.g. > > Describe face (separator =E2=80=98,=E2=80=99): Giving an example does not solve the general issue of a uniform CRM indication for all `completing-read-multiple' calls. In the Emacs code base `completing-read-multiple' is not used widely but it is used in other packages, which we cannot update at once. I find Stefan's suggestion of [comma-separated list] quite nice. See the patch I have sent in the other mail. Maybe we could use the [comma-separated list] indicator as fallback if a `completing-read-multiple' call does not provide examples on its own? Another possibility might be to use the completion category and the separator string and convert that to an example, e.g., category face would yield the prompt "Describe face (face1,face2,...):". Daniel
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 18:05:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 13:05:54 2025 Received: from localhost ([127.0.0.1]:41111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tf0pW-0005I2-0p for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 13:05:54 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:33695) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tf0pT-0005Hl-Pv for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 13:05:52 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 116664440E; Mon, 3 Feb 2025 18:05:42 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <86seovb23s.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 03 Feb 2025 15:16:07 +0200") Organization: LINKOV.NET References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <86seovb23s.fsf@HIDDEN> Date: Mon, 03 Feb 2025 19:56:08 +0200 Message-ID: <878qqm52vb.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeeiffetjeegheffjeeutdeihfdukeegjeetkeeigfevueehtedvfeegkeekveekudenucfkphepledurdduvdelrdeliedrledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdeliedrledtpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejiedtvdekseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepmhgrihhlsegurghnihgvlhdqmhgvnhgulhgvrhdruggvpdhrtghpthhtohepshhtvghfrghnkhgrnhhgrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg X-GND-Sasl: juri@HIDDEN X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: mail@HIDDEN, 76028 <at> debbugs.gnu.org, Stefan Kangas <stefankangas@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> > I propose to add such an indicator to CRM by default. Above I have >> > chosen the tag "CRM" for its shortness, but a more user friendly >> > solution might require a longer more descriptive name. Furthermore the >> > code above extracts the separator from the regular expression >> > `crm-separator', which is not robust for all separators. >> >> How about " [comma-separated list] "? > > Or maybe "Describe face (FACE1[,FACE2[,...]]): " I see no more descriptive prompt that providing an example, maybe with lower-case like all faces: Describe face (face1,face2,...): A more generalized prompt would make this less clear, e.g. Describe face (separator ‘,’):
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 15:51:28 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 10:51:28 2025 Received: from localhost ([127.0.0.1]:40844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1teyjQ-0006eb-7a for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 10:51:28 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:44665 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1teyjN-0006eJ-3B for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 10:51:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=iK6DWPfGsjLIPC0oETEQClcb2Akm5nOIQzUr6UXwsUY=; b=G5Hy2BXqoqTutYhGA+Ej/fzSiv 2OYAYxkKB8g9T5153/R7ALmD9napLly4rkgru4Q++YkrtVJtn6UqotfldLhqUYGEK7H1yQlefEJMV 0lg7Uu0zA0W3+yXRSvB9VWV+TOCBAEMjxO9UrEjtWRvzDxiZC6Ctd/sgrpfrsAewrCzc=; From: Daniel Mendler <mail@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN>, 76028 <at> debbugs.gnu.org Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <87frkvfa3z.fsf@HIDDEN> (Daniel Mendler's message of "Mon, 03 Feb 2025 14:09:36 +0100") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> <87frkvfa3z.fsf@HIDDEN> Date: Mon, 03 Feb 2025 16:51:15 +0100 Message-ID: <87bjvjf2mk.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: Eli Zaretskii <eliz@HIDDEN>, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Daniel Mendler <mail@HIDDEN> writes: > Stefan Kangas <stefankangas@HIDDEN> writes: > >> Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of >> text editors" <bug-gnu-emacs@HIDDEN> writes: >> >>> I propose to add such an indicator to CRM by default. Above I have >>> chosen the tag "CRM" for its shortness, but a more user friendly >>> solution might require a longer more descriptive name. Furthermore the >>> code above extracts the separator from the regular expression >>> `crm-separator', which is not robust for all separators. >> >> How about " [comma-separated list] "? >> >> I'd also propose we should have a defcustom for it, allowing users to >> set it to something shorter if they want. > > Yes, this would look good. Note that `crm-separator' can be set to an > arbitrary regular expression. How can we turn `crm-separator' into a > string like "comma-separated list"? Maybe `crm-separator' should be > generalized? One could set it to a cons ("," . "comma-separated list") > with the regexp in the car and the description in the cdr. In cases > where `crm-separator' is a string, we could use a generic string like > "[multi list]". I have attached a patch to this mail which implements this proposal. Daniel --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-completing-read-multiple-CRM-indication-and-prompt-c.patch Content-Transfer-Encoding: quoted-printable From 72f3b3890d138c7a5cd1b4da9f1918d5cf170a74 Mon Sep 17 00:00:00 2001 From: Daniel Mendler <mail@HIDDEN> Date: Mon, 3 Feb 2025 16:39:49 +0100 Subject: [PATCH] completing-read-multiple: CRM indication and prompt customization The `completing-read-multiple' prompt indicates multi completion. The customization option `crm-prompt' configures the formatting of the prompt. The variable can be set for example to "%p" in order to only display the original prompt, to "[%d] %p" to display the separator description and the prompt, or to "[CRM %s] %p" to display a shorter indicator of only the separator string and the prompt. * lisp/emacs-lisp/crm.el (crm-prompt): New user option. (crm-separator): Make customizable, update value and docstring. (crm--regexp): New helper function. (crm--collection-fn, crm--current-element, crm-complete-and-exit) (completing-read-multiple): Use it. --- lisp/emacs-lisp/crm.el | 50 ++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 454c3e85074..fcaef6cc476 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -79,9 +79,23 @@ =20 (define-obsolete-variable-alias 'crm-default-separator 'crm-separator "29.= 1") =20 -(defvar crm-separator "[ \t]*,[ \t]*" - "Separator regexp used for separating strings in `completing-read-multip= le'. -It should be a regexp that does not match the list of completion candidate= s.") +(defcustom crm-separator '("[ \t]*,[ \t]*" "," "comma-separated list") + "Separator used for separating strings in `completing-read-multiple'. +It should be a regexp or a list of three strings of the form (regexp +separator description). The regexp must not match the list of +completion candidates, the separator string and the description can be +shown in the prompt, see `crm-prompt'." + :type '(choice regexp (list regexp string string)) + :group 'minibuffer) + +(defcustom crm-prompt "[%d] %p" + "Prompt format for `completing-read-multiple'. +The prompt is formatted by `format-spec' with the keys %d, %s and %p +which stand for the separator description, the separator string and the +original prompt respectively." + :type 'string + :group 'minibuffer + :version "31.1") =20 (defvar-keymap crm-local-completion-map :doc "Local keymap for minibuffer multiple input with completion. @@ -106,6 +120,10 @@ crm-completion-table This is a table used for completion by `completing-read-multiple' and its supporting functions.") =20 +(defun crm--regexp () + "Separator regexp." + (or (car-safe crm-separator) crm-separator)) + ;; this function evolved from a posting by Stefan Monnier (defun crm--collection-fn (string predicate flag) "Function used by `completing-read-multiple' to compute completion value= s. @@ -122,7 +140,7 @@ crm--collection-fn Reference sections on =E2=80=9CProgrammed Completion=E2=80=9D and =E2=80= =9CBasic Completion Functions=E2=80=9D." (let ((beg 0)) - (while (string-match crm-separator string beg) + (while (string-match (crm--regexp) string beg) (setq beg (match-end 0))) (completion-table-with-context (substring string 0 beg) crm-completion-table @@ -135,11 +153,11 @@ crm--current-element Return the element's boundaries as (START . END)." (let ((bob (minibuffer-prompt-end))) (cons (save-excursion - (if (re-search-backward crm-separator bob t) + (if (re-search-backward (crm--regexp) bob t) (match-end 0) bob)) (save-excursion - (if (re-search-forward crm-separator nil t) + (if (re-search-forward (crm--regexp) nil t) (match-beginning 0) (point-max)))))) =20 @@ -195,7 +213,7 @@ crm-complete-and-exit (lambda () (setq doexit t))) (goto-char end) (not (eobp)))) - (looking-at crm-separator)) + (looking-at (crm--regexp))) ;; Skip to the next element. (goto-char (match-end 0))) (if doexit (exit-minibuffer)))) @@ -256,14 +274,16 @@ completing-read-multiple (let* ((beg (save-excursion (goto-char (minibuffer-prompt-en= d)) (or (search-forward start nil t) - (search-forward-regexp crm-s= eparator nil t) + (search-forward-regexp + (crm--regexp) nil t) (minibuffer-prompt-end)))) (end (save-excursion (goto-char (point-max)) (or (search-backward end nil t) (progn (goto-char beg) - (search-forward-regexp crm= -separator nil t)) + (search-forward-regexp + (crm--regexp) nil t)) (point-max))))) (completion--replace beg end choice)) (completion--replace start end choice)))) @@ -272,14 +292,22 @@ completing-read-multiple (unless (eq require-match t) require-match)) (setq-local crm-completion-table table)) (setq input (read-from-minibuffer - prompt initial-input map + (format-spec crm-prompt + (if (consp crm-separator) + `((?s . ,(nth 1 crm-separator)) + (?d . ,(nth 2 crm-separator)) + (?p . ,prompt)) + `((?s . ,crm-separator) + (?d . "multi list") + (?p . ,prompt)))) + initial-input map nil hist def inherit-input-method))) ;; If the user enters empty input, `read-from-minibuffer' ;; returns the empty string, not DEF. (when (and def (string-equal input "")) (setq input (if (consp def) (car def) def))) ;; Remove empty strings in the list of read strings. - (split-string input crm-separator t))) + (split-string input (crm--regexp) t))) =20 ;; testing and debugging ;; (defun crm-init-test-environ () --=20 2.47.2 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 13:16:39 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 08:16:39 2025 Received: from localhost ([127.0.0.1]:38304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tewJa-0006iH-Ns for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:16:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47852) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tewJW-0006hx-SA for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:16:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tewJQ-0001F2-61; Mon, 03 Feb 2025 08:16:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=w33o97nEFVp9jhvu6PfoNnDMnRnoqsVs4lOWPuoBGyg=; b=fRjfDKZEFkiE Y4p0x+mf9U7vLpjYvAFqFIOFPy1D+T+zySNZqiBBZkFU5dFYwzeAJH9lbbnfU8uoWNnQEsAEFF0im Du1Aa/yVBfZYJC9inZ9lXuQaINBSJTImgCtHWqnxAwdBqjdcYaEP9qOORrl8KpT/uTyDsFnAWdV9O D7JRzFhB1ZhPwweLr2GAzhzCuAxEGXj/d7KPO1/a3CjTt5aIfC1/UAbLX6SUYw5UNM4aGcvfbB+T0 uZnYvdr+3jy3UJWDVpUU0QTFfKQ7FjUowmv6ha1wAhfrsGc97ZUjLeaN1UqRwFmP75AOTqliqZylc 3GPy0MBgagByZrStf3inRw==; Date: Mon, 03 Feb 2025 15:16:07 +0200 Message-Id: <86seovb23s.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> (message from Stefan Kangas on Mon, 3 Feb 2025 05:03:12 -0800) Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76028 Cc: mail@HIDDEN, 76028 <at> debbugs.gnu.org, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: Juri Linkov <juri@HIDDEN> > From: Stefan Kangas <stefankangas@HIDDEN> > Date: Mon, 3 Feb 2025 05:03:12 -0800 > > Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" <bug-gnu-emacs@HIDDEN> writes: > > > I propose to add such an indicator to CRM by default. Above I have > > chosen the tag "CRM" for its shortness, but a more user friendly > > solution might require a longer more descriptive name. Furthermore the > > code above extracts the separator from the regular expression > > `crm-separator', which is not robust for all separators. > > How about " [comma-separated list] "? Or maybe "Describe face (FACE1[,FACE2[,...]]): "
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 13:09:47 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 08:09:47 2025 Received: from localhost ([127.0.0.1]:38281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tewCw-0003Jx-OC for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:09:47 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:41709 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tewCu-0003Jh-Az for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=nCLWTtzvRQOEiym8wlGPpkQODRlnc6YD/+LAQGj7/IM=; b=bFUXgyDPeFi20hkDVViDxPycz6 1xLBTHodey7aKGOTOlZVrU5UxsJpYR1N4o9fyglcRzT/taEDUFas5Qp2LsSvhYiwJ7Cwqrggi87TK VlFPecOcPWt+/naHBg1lpB7iYyk7qToOKmIBfw1lMnfMS3EyJAh5qWZX24wwPxgwGmdI=; From: Daniel Mendler <mail@HIDDEN> To: Stefan Kangas <stefankangas@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> (Stefan Kangas's message of "Mon, 3 Feb 2025 05:03:12 -0800") References: <87r04f5qf1.fsf@HIDDEN> <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> Date: Mon, 03 Feb 2025 14:09:36 +0100 Message-ID: <87frkvfa3z.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Stefan Kangas <stefankangas@HIDDEN> writes: > Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" <bug-gnu-emacs@HIDDEN> writes: > >> I propose to add such an indicator to CRM by default. Above I have >> chosen the tag "CRM" for its shortness, but a more user friendly >> solution might require a longer more descriptive name. Furthermore the >> code above extracts the separator from the regular expression >> `crm-separator', which is not robust for all separators. > > How about " [comma-separated list] "? > > I'd also propose we should have a defcustom for it, allowing users to > set it to something shorter if they want. Yes, this would look good. Note that `crm-separator' can be set to an arbitrary regular expression. How can we turn `crm-separator' into a string like "comma-separated list"? Maybe `crm-separator' should be generalized? One could set it to a cons ("," . "comma-separated list") with the regexp in the car and the description in the cdr. In cases where `crm-separator' is a string, we could use a generic string like "[multi list]". Daniel
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 13:03:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 08:03:22 2025 Received: from localhost ([127.0.0.1]:38263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tew6j-00033B-Lr for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:03:21 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:44198) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1tew6h-00032u-9B for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:03:19 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5d3e6274015so7443111a12.0 for <76028 <at> debbugs.gnu.org>; Mon, 03 Feb 2025 05:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738587793; x=1739192593; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=dhyjZHpOIhNCq5v4wU0M8ugYIjxWAyGeu6vmItrdGcY=; b=ADikgSEfFh7MSAckaYEb2V6d4AZlt9NpnB1zyX+u4jhwcmqc3+XP3C8xPM+R2d/ORh sRHg0cfM4KMKDIuoJFaEjQ8NzYyrpvzBwoRxOZAV5ktH4LYMo16ozO2IsDnzUwVV5lxX 4bLIS94/5IPGhQU4PprrTDM5Vkoz2TFJM2At8OEDA+H5M468R9LywPVCyqZL2lWdgC9s hPkQCfBp2kP37GywVLKBcfvzEZh9e3cQ/s05Z+p6AxuOzFfiJ7tSXEwUCu4cFjAyXfsb ZUjc13y5t8RiAAzl3QTTO9tTJ9icycxWZBedYlkpAk0pLyGzGGVOsB7la/no4k9Qhiw9 2mRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738587793; x=1739192593; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dhyjZHpOIhNCq5v4wU0M8ugYIjxWAyGeu6vmItrdGcY=; b=Pyuxt2Dyq0+7sjskfijYAhbzbGoLsQ5IqijpeJ6d/6WHiWi41rmyKfzPB/oA20rKQK KrwdXHqZMcrqdB5MzFKJ2eVVo1jwGi3nGvfIyiw9nq9RI1fl3wJM3D50vlfczGIimhda Dx59mgoEEM29qJP0hlqT0pqwEKden8QfnC4MQWHxIt0G+utH0fKyZGUza/0rum6iXzIB ney0sabPQYYLMfYbPU3sg3n4rcXlXEvGK4K3byD1xC9QXhK5huOBWbpHFv0QJmalQJM9 TJ27bpz911IW7Aa5p7qfxdpHAClycq6LK6QqJTmqn2Z0/jChB8NsTksq+VTXZyeb+aGD +0ww== X-Forwarded-Encrypted: i=1; AJvYcCUR1TEqlHuJXGsuhizaVWx3Bj4FbEiGxWRE5x/4SVUdTg5E6011khjympw/PnhjAx4qhX7tUg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwBRDGRt/Wbtv/QDLDEqI/rQZBHJnW+aFltvtZ7dWqZjmWsuVkc Oo2mc+6EgXgP2sGe4fMgcBy9SQF76jscT+LP/oMN8G4nYmvmko8T+rHBBc+9SAqU1Z2bGz8F9je kc15gUmlnehInGaa0xF7jEyflK/w= X-Gm-Gg: ASbGncuJnI0w4ZkHGVZqwVUbsWHj6O6YiAwtaZsdGm1MQEgLdeo91DaNwvIsp8fitnS JHOqja18kw3RFlQhpAnwz/C0V59dipptcPoZAbixieArgpgrblTnU+pxjhC3pBM2njTXl5gqlcQ == X-Google-Smtp-Source: AGHT+IEP0WVuCOxZ8nn7eSUGSL9iX9gHzqSBlHnn7Rc4SyIg/uiWyG+z6+Mt+AhGAAAIgKsHIPROvEP2VxmOusQOq9o= X-Received: by 2002:a05:6402:239b:b0:5dc:7374:2638 with SMTP id 4fb4d7f45d1cf-5dc73742737mr15810092a12.7.1738587792706; Mon, 03 Feb 2025 05:03:12 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 3 Feb 2025 05:03:12 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <87r04f5qf1.fsf@HIDDEN> References: <87r04f5qf1.fsf@HIDDEN> MIME-Version: 1.0 Date: Mon, 3 Feb 2025 05:03:12 -0800 X-Gm-Features: AWEUYZmkHdN5hQLyjJ6ztxWGhT5G_2kElpi1Nhb_BI7i6G0lAH6kuE-HSJFwfmQ Message-ID: <CADwFkmkFQvyjJ7tQCeVJfcX6s3c6p5W2ZZ1toNbLcS9TQ-wJug@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator To: Daniel Mendler <mail@HIDDEN>, 76028 <at> debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76028 Cc: Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes: > I propose to add such an indicator to CRM by default. Above I have > chosen the tag "CRM" for its shortness, but a more user friendly > solution might require a longer more descriptive name. Furthermore the > code above extracts the separator from the regular expression > `crm-separator', which is not robust for all separators. How about " [comma-separated list] "? I'd also propose we should have a defcustom for it, allowing users to set it to something shorter if they want.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 13:02:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 08:02:46 2025 Received: from localhost ([127.0.0.1]:38259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tew6A-00031p-2U for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:02:46 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:56457 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tew68-00031U-4s for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 08:02:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; 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=nsrPrC2KTMJpccUHMRG0ciYDAktlom7JenUxEk/i8gI=; b=zFhPSvvypnmE7sW5+AEj0Gu+Ve prhD6SZhjjZjJ29OPGNW+3665q5OSizIT9Gu/ypcF2STwDeq+ZM+eKU8jYM0yPDquxoA8SZ5PP5EZ 8G9Thqy/8Qgza5vBc5OqovO5RVBXf6qN/+2lbSTgzeEb2pE+SZyfnDJnGG2K9+DiwvTY=; From: Daniel Mendler <mail@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator In-Reply-To: <86wme7b3da.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 03 Feb 2025 14:48:49 +0200") References: <87r04f5qf1.fsf@HIDDEN> <86wme7b3da.fsf@HIDDEN> Date: Mon, 03 Feb 2025 14:02:35 +0100 Message-ID: <87ikprfafo.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> Cc: Juri Linkov <juri@HIDDEN> >> Date: Mon, 03 Feb 2025 10:27:30 +0100 >> From: Daniel Mendler via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> >> >> The function `completing-read-multiple' (CRM) can be used to read >> multiple candidates, separated by comma (see the variable >> `crm-separator'). Besides that it acts similarly to `completing-read'. >> To the user it is no obvious if CRM is used. >> >> For years I have used an advice in my configuration which adds a CRM >> indicator to the prompt. For example, the advice turns the >> `describe-face' prompt from "Describe face: " into "[CRM ,] Describe >> face: ", which tells the user that multiple face names are read, >> separated by comma: >> >> #+begin_src emacs-lisp >> (defun crm-indicator (args) >> (defvar crm-separator) >> (cons (format "[%s %s] %s" >> (propertize "CRM" 'face 'error) >> (propertize >> (replace-regexp-in-string >> "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" >> crm-separator) >> 'face 'success) >> (car args)) >> (cdr args))) >> (advice-add #'completing-read-multiple :filter-args #'crm-indicator) >> #+end_src >> >> I propose to add such an indicator to CRM by default. Above I have >> chosen the tag "CRM" for its shortness, but a more user friendly >> solution might require a longer more descriptive name. Furthermore the >> code above extracts the separator from the regular expression >> `crm-separator', which is not robust for all separators. > > Isn't that too cryptic? Yes. For my purposes the cryptic text is sufficient but I would prefer something more readable if we add such an indicator to `completing-read-multiple'. > A prompt "Describe face: " which expects one or more faces is not the > best prompt text, and should preferably be improved by implying > multiple faces separated by a comma. Or maybe we need some > specialized help key there, which would spell that out. Or something > else which would be explicit even to users who are using CRM for the > first time in their lives. Improving every `completing-read-multiple' prompt is an option too. However I would prefer if we uniformly add an indicator to `completing-read-multiple' such that multi completion becomes clearly recognizable. Other options could be a help text in the mode line or a `minibuffer-message' telling the user about multi completion. In any case the indicator should be guarded by a customization options such that it can be disabled or customized. Daniel
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at 76028) by debbugs.gnu.org; 3 Feb 2025 12:49:09 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 07:49:09 2025 Received: from localhost ([127.0.0.1]:38242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tevsy-0002MJ-Nn for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 07:49:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39276) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tevsv-0002Lj-SE for 76028 <at> debbugs.gnu.org; Mon, 03 Feb 2025 07:49:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1tevsl-0005wl-89; Mon, 03 Feb 2025 07:48:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UrOIav/FoATKIQUihCqpoWCzB8zjeO6N8+M8dUoRPHM=; b=RBAQ0ocSJCOL y8Q+E4o8cvAf66bT8YPN7mLsbBykAEbNKJbEbr53+lCpicP8sAaLIj9sy5FgYU72lsAlNs+HZDVNt uon3kPbCOR3gafgNcQMAjj48E/aA81b3KSC3NrcxXJAe9125TZjbH5ZFhX33U8IgGccR/eSH67zIX JRS36bLZ88WOkGPOyxF9jvITcbVSHHm0lh4DmSSJr9/rbvYxcEKU9Hdc5Qm5sL8CGdEUypDXpHKrn zLFrsUeCdb78I+m4b7UVWWAH+Q67rmRSODoWC2xp15E/jjdsqX0FY6EYlYHHZSZNWpW40H070ryGO v0HTt/9Z4m+XiDyZjfEN/Q==; Date: Mon, 03 Feb 2025 14:48:49 +0200 Message-Id: <86wme7b3da.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Daniel Mendler <mail@HIDDEN> In-Reply-To: <87r04f5qf1.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN) Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator References: <87r04f5qf1.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76028 Cc: 76028 <at> debbugs.gnu.org, juri@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: Juri Linkov <juri@HIDDEN> > Date: Mon, 03 Feb 2025 10:27:30 +0100 > From: Daniel Mendler via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> > > The function `completing-read-multiple' (CRM) can be used to read > multiple candidates, separated by comma (see the variable > `crm-separator'). Besides that it acts similarly to `completing-read'. > To the user it is no obvious if CRM is used. > > For years I have used an advice in my configuration which adds a CRM > indicator to the prompt. For example, the advice turns the > `describe-face' prompt from "Describe face: " into "[CRM ,] Describe > face: ", which tells the user that multiple face names are read, > separated by comma: > > #+begin_src emacs-lisp > (defun crm-indicator (args) > (defvar crm-separator) > (cons (format "[%s %s] %s" > (propertize "CRM" 'face 'error) > (propertize > (replace-regexp-in-string > "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" > crm-separator) > 'face 'success) > (car args)) > (cdr args))) > (advice-add #'completing-read-multiple :filter-args #'crm-indicator) > #+end_src > > I propose to add such an indicator to CRM by default. Above I have > chosen the tag "CRM" for its shortness, but a more user friendly > solution might require a longer more descriptive name. Furthermore the > code above extracts the separator from the regular expression > `crm-separator', which is not robust for all separators. Isn't that too cryptic? A prompt "Describe face: " which expects one or more faces is not the best prompt text, and should preferably be improved by implying multiple faces separated by a comma. Or maybe we need some specialized help key there, which would spell that out. Or something else which would be explicit even to users who are using CRM for the first time in their lives.
bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 3 Feb 2025 09:27:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 03 04:27:46 2025 Received: from localhost ([127.0.0.1]:37781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tesk6-0003Rc-Fg for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 04:27:46 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37412) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1tesk4-0003RK-H6 for submit <at> debbugs.gnu.org; Mon, 03 Feb 2025 04:27:45 -0500 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 <mail@HIDDEN>) id 1tesjy-000703-GU for bug-gnu-emacs@HIDDEN; Mon, 03 Feb 2025 04:27:38 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1tesjv-0000QY-Um for bug-gnu-emacs@HIDDEN; Mon, 03 Feb 2025 04:27:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4mgMXPy/Yu8cZts9zJ7rPDtrgt1QkuDmXto29x16VdE=; b=Yb+j6AEOXxL3cXuHpddbR6tHLp h42AdjIlVi2fos/POLSttvfkkvU4IazKYm48+QHwgFhnh/P6k3uB40PYrS2PNhkaq8cdr92KXPaK9 1VotIoacnL0vqLlQS0j/HXqVmMWmjZOirrkI0Rnt8FvX2JOh/1Z75QAUT0z0XBXFDZC0=; From: Daniel Mendler <mail@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 31; completing-read-multiple: Add prompt indicator X-Debbugs-Cc: Juri Linkov <juri@HIDDEN> Date: Mon, 03 Feb 2025 10:27:30 +0100 Message-ID: <87r04f5qf1.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@HIDDEN; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) The function `completing-read-multiple' (CRM) can be used to read multiple candidates, separated by comma (see the variable `crm-separator'). Besides that it acts similarly to `completing-read'. To the user it is no obvious if CRM is used. For years I have used an advice in my configuration which adds a CRM indicator to the prompt. For example, the advice turns the `describe-face' prompt from "Describe face: " into "[CRM ,] Describe face: ", which tells the user that multiple face names are read, separated by comma: #+begin_src emacs-lisp (defun crm-indicator (args) (defvar crm-separator) (cons (format "[%s %s] %s" (propertize "CRM" 'face 'error) (propertize (replace-regexp-in-string "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" crm-separator) 'face 'success) (car args)) (cdr args))) (advice-add #'completing-read-multiple :filter-args #'crm-indicator) #+end_src I propose to add such an indicator to CRM by default. Above I have chosen the tag "CRM" for its shortness, but a more user friendly solution might require a longer more descriptive name. Furthermore the code above extracts the separator from the regular expression `crm-separator', which is not robust for all separators.
Daniel Mendler <mail@HIDDEN>
:juri@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.juri@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#76028
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.