GNU bug report logs -
#76028
31; completing-read-multiple: Add prompt indicator
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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 76028 <at> debbugs.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>
> 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.
[Message part 3 (message/rfc822, inline)]
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.
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.