branch: externals/mct
commit 4f0088b2a2a9775c03bac9226a81d718529896cc
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Make the blocklist take precedence over the passlist
---
README.org | 6 ++++++
mct.el | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index 17fc15f7d7..7b92c4f1d7 100644
--- a/README.org
+++ b/README.org
@@ -234,6 +234,9 @@ the ~mct-minimum-input~. It also bypasses any possible
delay introduced
by ~mct-live-update-delay~. In other words, it immediately displays the
=*Completions*= buffer and instantly updates it to match user input.
+When the ~mct-completion-blocklist~ and the ~mct-completion-passlist~
+are in conflict, the former takes precedence.
+
[[#h:1f42c4e6-53c1-4e8a-81ef-deab70822fa4][Known completion categories]].
*** Blocklist for commands or completion categories
@@ -258,6 +261,9 @@ The Completions' buffer can still be accessed with commands
that place
it in a window (such as ~mct-list-completions-toggle~,
~mct-switch-to-completions-top~).
+When the ~mct-completion-blocklist~ and the ~mct-completion-passlist~
+are in conflict, the former takes precedence.
+
Perhaps a less drastic measure is to set ~mct-minimum-input~ to an
appropriate value. Or better use ~mct-completion-passlist~.
diff --git a/mct.el b/mct.el
index e6687443d5..0ef5cbc1dc 100644
--- a/mct.el
+++ b/mct.el
@@ -166,6 +166,9 @@ The Completions buffer can still be accessed with commands
that
place it in a window (such as `mct-list-completions-toggle',
`mct-switch-to-completions-top').
+When the `mct-completion-blocklist' and the `mct-completion-passlist'
+are in conflict, the former takes precedence.
+
Perhaps a less drastic measure is to set `mct-minimum-input' to
an appropriate value. Or better use `mct-completion-passlist'.
@@ -185,6 +188,9 @@ This means that they ignore the value of
`mct-live-completion'
and the `mct-minimum-input'. They also bypass any possible delay
introduced by `mct-live-update-delay'.
+When the `mct-completion-blocklist' and the `mct-completion-passlist'
+are in conflict, the former takes precedence.
+
Read the manual for known completion categories."
:type '(repeat symbol)
:group 'mct)
@@ -390,7 +396,7 @@ Meant to be added to `after-change-functions'."
(defun mct--setup-live-completions ()
"Set up the Completions buffer."
(cond
- ((null mct-live-completion))
+ ((or (null mct-live-completion) (mct--blocklist-p)))
;; ;; NOTE 2022-02-25: The passlist setup we had here was being
;; ;; called too early in `mct--completing-read-advice'. It would
;; ;; fail to filter out the current candidate from the list
@@ -410,7 +416,7 @@ Meant to be added to `after-change-functions'."
(defun mct--setup-passlist ()
"Set up the minibuffer for `mct-completion-passlist'."
- (when (and (mct--passlist-p) (mct--minibuffer-p))
+ (when (and (mct--passlist-p) (mct--minibuffer-p) (not (mct--blocklist-p)))
(setq-local mct-minimum-input 0)
(setq-local mct-live-update-delay 0)
(mct--show-completions)))