branch: externals/vertico
commit 5b9b80386cfe0e99492432a3e32cd1d2a966070e
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    README: crm-prompt is available on Emacs 31
    
    See Emacs bug#76028
---
 README.org | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index d549335d5c..c453bb2e69 100644
--- a/README.org
+++ b/README.org
@@ -108,16 +108,17 @@ to take advantage of ~use-package~. Here is an example 
configuration:
   ;; Vertico.
   (read-extended-command-predicate #'command-completion-default-include-p)
   :init
-  ;; Emacs bug#76028: Add prompt indicator to `completing-read-multiple'.
-  ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
-  (defun crm-indicator (args)
-    (cons (format "[CRM%s] %s"
-                  (replace-regexp-in-string
-                   "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
-                   crm-separator)
-                  (car args))
-          (cdr args)))
-  (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
+  ;; Prompt indicator for `completing-read-multiple'.  Available out of the box
+  ;; on Emacs 31, see `crm-prompt'.
+  (when (< emacs-major-version 31)
+    (advice-add #'completing-read-multiple :filter-args
+                (lambda (args)
+                  (cons (format "[CRM%s] %s"
+                                (replace-regexp-in-string
+                                 "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
+                                 crm-separator)
+                                (car args))
+                        (cdr args)))))
 
   ;; Do not allow the cursor in the minibuffer prompt
   (setq minibuffer-prompt-properties

Reply via email to