GNU bug report logs - #76028
31; completing-read-multiple: Add prompt indicator

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Mon, 3 Feb 2025 09:28:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76028: closed (31; completing-read-multiple: Add prompt
 indicator)
Date: Sat, 15 Feb 2025 11:41:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 15 Feb 2025 13:40:32 +0200
with message-id <86jz9re8r3.fsf <at> gnu.org>
and subject line Re: bug#76028: 31; completing-read-multiple: Add prompt indicator
has caused the debbugs.gnu.org bug report #76028,
regarding 31; completing-read-multiple: Add prompt indicator
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76028: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76028
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Daniel Mendler <mail <at> daniel-mendler.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 31; completing-read-multiple: Add prompt indicator
Date: Mon, 03 Feb 2025 10:27:30 +0100
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.


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 76028-done <at> debbugs.gnu.org, stefankangas <at> gmail.com, juri <at> linkov.net
Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator
Date: Sat, 15 Feb 2025 13:40:32 +0200
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> Cc: juri <at> linkov.net,  76028 <at> debbugs.gnu.org,  stefankangas <at> gmail.com
> Date: Fri, 07 Feb 2025 13:24:04 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Daniel Mendler <mail <at> daniel-mendler.de>
> >> Cc: Juri Linkov <juri <at> linkov.net>,  76028 <at> debbugs.gnu.org,
> >>   stefankangas <at> gmail.com
> >> Date: Fri, 07 Feb 2025 10:44:49 +0100
> >> 
> >> Eli Zaretskii <eliz <at> gnu.org> 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.


This bug report was last modified 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.