Subject: bug#76028: closed (Re: bug#76028: 31; completing-read-multiple: Add prompt indicator)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 15 Feb 2025 11:41:02 +0000

Your bug report

#76028: 31; completing-read-multiple: Add prompt indicator

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76028: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76028
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#76028: 31; completing-read-multiple: Add prompt indicator
From: Eli Zaretskii <[email-masked]>
To: Daniel Mendler <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 15 Feb 2025 13:40:32 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Daniel Mendler <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 07 Feb 2025 13:24:04 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Daniel Mendler <[email-masked]>
> >> Cc: Juri Linkov <[email-masked]>,  [email-masked],
> >>   [email-masked]
> >> Date: Fri, 07 Feb 2025 10:44:49 +0100
> >> 
> >> Eli Zaretskii <[email-masked]> 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.

Subject: 31; completing-read-multiple: Add prompt indicator
From: Daniel Mendler <[email-masked]>
To: [email-masked]
Date: Mon, 03 Feb 2025 10:27:30 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.