emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/mct a038b4c194 6/6: REMOVE the CRM tag; document it ins


From: ELPA Syncer
Subject: [elpa] externals/mct a038b4c194 6/6: REMOVE the CRM tag; document it instead
Date: Wed, 9 Feb 2022 01:57:43 -0500 (EST)

branch: externals/mct
commit a038b4c194f222ae73287ba945fbd1b7cfaca91f
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    REMOVE the CRM tag; document it instead
    
    Same principle as with commit 624685d: we want to keep MCT focused on
    its core functionality.
---
 README.org | 44 ++++++++++++++++++++++++++++++++++----------
 mct.el     |  8 --------
 2 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/README.org b/README.org
index e4282908d4..25df7a021e 100644
--- a/README.org
+++ b/README.org
@@ -661,16 +661,17 @@ Completions' buffer 
([[#h:97eb5898-1e52-4338-bd55-8c52f9d8ccd3][Cyclic behaviour
 
    #+findex: mct-choose-completion-dwim
 6. In prompts that allow the selection of multiple candidates
-   (internally via the ~completing-read-multiple~ function) a =[CRM]= label
-   is added to the text of the prompt.  The user thus knows that
-   pressing =M-RET= (~mct-choose-completion-dwim~) in the =*Completions*= will
-   append the candidate at point to the list of selections and keep the
-   completions available so that another item may be selected.  Any of
-   the aforementioned applicable methods can confirm the final
-   selection.  If, say, you want to pick a total of three candidates, do
-   =M-RET= for the first two and =RET= (~mct-choose-completion-exit~) for the
-   last one.  In contexts that are not CRM-powered, the =M-RET= has the
-   same effect as =TAB= (~mct-choose-completion-no-exit~).
+   (internally via the ~completing-read-multiple~ function) using =M-RET=
+   (~mct-choose-completion-dwim~) in the =*Completions*= will append the
+   candidate at point to the list of selections and keep the completions
+   available so that another item may be selected.  Any of the
+   aforementioned applicable methods can confirm the final selection.
+   If, say, you want to pick a total of three candidates, do =M-RET= for
+   the first two and =RET= (~mct-choose-completion-exit~) for the last one.
+   In contexts that are not CRM-powered, the =M-RET= has the same effect
+   as =TAB= (~mct-choose-completion-no-exit~).
+
+   [[#h:162f232d-1e9d-4756-90d3-d6bf5bb4d8ef][Indicator for 
completing-read-multiple]].
 
    #+findex: mct-complete-and-exit
 7. When point is at the minibuffer, select the current candidate in
@@ -1108,6 +1109,29 @@ Use `mct-sort-sort-by-alpha-length' if no history is 
available."
 
 [[#h:1f42c4e6-53c1-4e8a-81ef-deab70822fa4][Known completion categories]].
 
+** Indicator for completing-read-multiple
+:PROPERTIES:
+:CUSTOM_ID: h:162f232d-1e9d-4756-90d3-d6bf5bb4d8ef
+:END:
+#+cindex: CRM indicator
+
+[ Part of {{{development-version}}} ]
+
+Previous versions of MCT would prepend a =[CRM]= tag to the minibuffer
+prompt of commands powered by ~completing-read-multiple~.  While this is a
+nice usability enhancement, it is not specific to MCT and thus should
+not be part of =mct.el=.  Use this in your init file instead:
+
+#+begin_src emacs-lisp
+;; Copied from Daniel Mendler's `vertico' library:
+;; <https://github.com/minad/vertico>.
+(defun my-crm-indicator (args)
+  "Add prompt indicator to `completing-read-multiple' filter ARGS."
+  (cons (concat "[CRM] " (car args)) (cdr args)))
+
+(advice-add #'completing-read-multiple :filter-args #'my-crm-indicator)
+#+end_src
+
 ** Ido-style navigation through directories
 :PROPERTIES:
 :CUSTOM_ID: h:9a6746dd-0be9-4e29-ac40-0af9612d05a2
diff --git a/mct.el b/mct.el
index e419cd4683..a7ba82c5d4 100644
--- a/mct.el
+++ b/mct.el
@@ -1033,12 +1033,6 @@ Apply APP while inhibiting modification hooks."
       (mct--add-stripes)
     (mct--remove-stripes)))
 
-;; Copied from Daniel Mendler's `vertico' library:
-;; <https://github.com/minad/vertico>.
-(defun mct--crm-indicator (args)
-  "Add prompt indicator to `completing-read-multiple' filter ARGS."
-  (cons (concat "[CRM] " (car args)) (cdr args)))
-
 ;;;;; Shadowed path
 
 ;; Adapted from icomplete.el
@@ -1219,13 +1213,11 @@ region.")
         (advice-add #'completing-read-default :around 
#'mct--completing-read-advice)
         (advice-add #'completing-read-multiple :around 
#'mct--completing-read-advice)
         (advice-add #'minibuffer-completion-help :around 
#'mct--minibuffer-completion-help-advice)
-        (advice-add #'completing-read-multiple :filter-args 
#'mct--crm-indicator)
         (advice-add #'minibuf-eldef-setup-minibuffer :around 
#'mct--stealthily))
     (remove-hook 'completion-list-mode-hook #'mct--setup-completion-list)
     (advice-remove #'completing-read-default #'mct--completing-read-advice)
     (advice-remove #'completing-read-multiple #'mct--completing-read-advice)
     (advice-remove #'minibuffer-completion-help 
#'mct--minibuffer-completion-help-advice)
-    (advice-remove #'completing-read-multiple #'mct--crm-indicator)
     (advice-remove #'minibuf-eldef-setup-minibuffer #'mct--stealthily))
   (mct--setup-dynamic-completion-persist)
   (mct--setup-shared))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]