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

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

[elpa] externals/mct 555b481fe0 03/64: First steps towards Orderless sup


From: ELPA Syncer
Subject: [elpa] externals/mct 555b481fe0 03/64: First steps towards Orderless support
Date: Thu, 30 Dec 2021 23:57:49 -0500 (EST)

branch: externals/mct
commit 555b481fe0706e51f74e06b8a21bb1bf3e067152
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    First steps towards Orderless support
    
    Override the completion predicate such that
    space does not quit the completion.
---
 mct.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/mct.el b/mct.el
index e6bbf67cb6..52c3024478 100644
--- a/mct.el
+++ b/mct.el
@@ -421,9 +421,13 @@ Apply APP by first setting up the minibuffer to work with 
Mct."
     (save-excursion
       ;; FIXME 2021-12-03: same principle as what I wrote above
       ;; `mct--region-or-minibuffer-active-p'.
-      (if completion-in-region-mode
-          (completion-help-at-point)
-        (minibuffer-completion-help))))
+      (pcase (and completion-in-region-mode completion-in-region--data)
+        (`(,start ,end ,collection . ,plist)
+         (let ((minibuffer-completion-table collection)
+               (minibuffer-completion-predicate (plist-get plist :predicate))
+               (completion-extra-properties plist))
+           (minibuffer-completion-help start end)))
+        (_ (minibuffer-completion-help)))))
   (mct--fit-completions-window))
 
 ;;;###autoload
@@ -1140,11 +1144,12 @@ Meant to be added to `after-change-functions'."
 ;; It cannot be `completion-in-region-mode'.
 (defun mct--region-setup-completion-in-region ()
   "Set up Mct for `completion-in-region'."
+  ;; NOTE: Ignore the predicate in order to support orderless style.
+  ;; TODO: This override should be guarded by a customizable variable,
+  ;; since it is intrusive. See also `corfu-quit-at-boundary'.
+  (setq completion-in-region-mode--predicate (lambda () t))
   (mct--region-live-update))
 
-;; FIXME 2021-12-03: We cannot use Orderless.  Neither the
-;; space-separated approach, nor the style dispatchers.
-
 ;; FIXME 2021-12-03: When using a flex style followed by tab, the
 ;; completion-in-region seems to remain active as the echo area has a
 ;; message about "sole completion", "no completion", and the like.



reply via email to

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