[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct a3e43e2 1/3: Fix mct interference with completion-i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct a3e43e2 1/3: Fix mct interference with completion-in-region |
Date: |
Tue, 30 Nov 2021 03:57:20 -0500 (EST) |
branch: externals/mct
commit a3e43e20dfa8c9f5e289542fb00a1c0becf510d0
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Fix mct interference with completion-in-region
Thanks to Benjamin for the feedback in issue 10:
<https://gitlab.com/protesilaos/mct/-/issues/10>.
---
mct.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mct.el b/mct.el
index a40e9ba..59dec7f 100644
--- a/mct.el
+++ b/mct.el
@@ -204,6 +204,11 @@ NOTE that setting this option with `setq' requires a
restart of
isearch-forward-regexp isearch-backward-regexp)
"List of functions that do not do completion.")
+(defun mct--no-completion-p ()
+ "Check whether it is appropriate to use Mct-mode."
+ (or (memq this-command mct--no-complete-functions)
+ (bound-and-true-p completion-in-region-mode)))
+
(define-obsolete-variable-alias
'mct-hl-line 'mct-highlight-candidate "0.3.0")
@@ -296,7 +301,7 @@ Meant to be added to `after-change-functions'."
(defun mct--setup-completions ()
"Set up the completions' buffer."
- (unless (memq this-command mct--no-complete-functions)
+ (unless (mct--no-completion-p)
(cond
((memq this-command mct-completion-passlist)
(setq-local mct-minimum-input 0)
@@ -1004,14 +1009,14 @@ region.")
(defun mct--completion-list-mode-map ()
"Hook to `completion-setup-hook'."
- (unless (memq this-command mct--no-complete-functions)
+ (unless (mct--no-completion-p)
(use-local-map
(make-composed-keymap mct-completion-list-mode-map
(current-local-map)))))
(defun mct--minibuffer-local-completion-map ()
"Hook to `minibuffer-setup-hook'."
- (unless (memq this-command mct--no-complete-functions)
+ (unless (mct--no-completion-p)
(use-local-map
(make-composed-keymap mct-minibuffer-local-completion-map
(current-local-map)))))