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

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

[elpa] externals/mct a6dac17d1c 59/64: Review mct--region-p for buffer-l


From: ELPA Syncer
Subject: [elpa] externals/mct a6dac17d1c 59/64: Review mct--region-p for buffer-local mode
Date: Thu, 30 Dec 2021 23:58:01 -0500 (EST)

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

    Review mct--region-p for buffer-local mode
---
 mct.el | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/mct.el b/mct.el
index d861008c64..75ed91ba7c 100644
--- a/mct.el
+++ b/mct.el
@@ -306,11 +306,10 @@ Meant to be added to `after-change-functions'."
               (buf (window-buffer win)))
       (buffer-local-value 'mct--active buf)))
 
-;; TODO 2021-12-29: If we want to make a buffer-local variant, then we
-;; need to review this.
 (defun mct--region-p ()
   "Return non-nil if Mct is completing in region."
-  (and (bound-and-true-p mct-region-mode) (mct--region-current-buffer)))
+  (with-current-buffer (mct--region-current-buffer)
+    (bound-and-true-p mct-region-mode)))
 
 (defun mct--display-completion-list-advice (&rest app)
   "Prepare advice around `display-completion-list'.
@@ -1219,9 +1218,6 @@ minibuffer)."
 
 (defun mct--region-setup-completion-list ()
   "Set up the completion-list for Mct."
-  ;; TODO 2021-12-30: If we are to make mct-region-mode local, we need
-  ;; to change how this is handled because, e.g., the Completions are
-  ;; not cleaned up and highlighting is not available.
   (when (mct--region-p)
     (setq-local completion-show-help nil
                 truncate-lines t)
@@ -1243,7 +1239,7 @@ minibuffer)."
   ;; nothing is hindering us from offering mct-region-mode as a local mode. In
   ;; contrast, for mct-minibuffer-mode, offering a buffer-local mode does not
   ;; make sense.
-  :global t
+  :global nil
   (if mct-region-mode
       (progn
         (advice-add #'completion--done :around #'mct--region-completion-done)



reply via email to

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