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

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

[elpa] externals/mct d3dbb61e89 56/64: Merge 'main' into experiment-comp


From: ELPA Syncer
Subject: [elpa] externals/mct d3dbb61e89 56/64: Merge 'main' into experiment-completion-in-region
Date: Thu, 30 Dec 2021 23:58:01 -0500 (EST)

branch: externals/mct
commit d3dbb61e8915645b1072268f3b2aca3e5e418f6e
Merge: 8d02ae3a6c 6279fa3e7d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Merge 'main' into experiment-completion-in-region
---
 README.org |  6 +++---
 mct.el     | 28 +++++++++++++---------------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/README.org b/README.org
index 5c8ef67e56..fdd4c91b6c 100644
--- a/README.org
+++ b/README.org
@@ -774,9 +774,9 @@ MCT is meant to be a collective effort.  Every bit of help 
matters.
   Vladimir Cash, José Antonio Ortega Ruiz, Juri Linkov, Philip
   Kaludercic.
 
-+ Ideas and user feedback :: Benjamin (@zealotrush), Case Duckworth,
-  Jonathan Irving, José Antonio Ortega Ruiz, Kostadin Ninev, Manuel
-  Uberti, Philip Kaludercic, Theodor Thornhill.
++ Ideas and user feedback :: Andrew Tropin, Benjamin (@zealotrush), Case
+  Duckworth, Jonathan Irving, José Antonio Ortega Ruiz, Kostadin Ninev,
+  Manuel Uberti, Philip Kaludercic, Theodor Thornhill.
 
 + Inspiration for certain features :: =icomplete.el= (built-in---multiple
   authors), Daniel Mendler (=vertico=), Omar Antolín Camarena (=embark=,
diff --git a/mct.el b/mct.el
index 3c679710a5..81d9b7e06f 100644
--- a/mct.el
+++ b/mct.el
@@ -698,25 +698,21 @@ If ARG is supplied, move that many completion groups at a 
time."
 
 ;;;;; Candidate selection
 
-;; TODO review, is this not almost the same as choose-completion?
+;; The difference between this and choose-completion is that it will
+;; exit even if a directory is selected in find-file, whereas
+;; choose-completion expands the directory and continues the session.
 (defun mct-choose-completion-exit ()
   "Run `choose-completion' in the Completions buffer and exit."
   (interactive nil mct-minibuffer-mode)
+  (choose-completion)
   (when (active-minibuffer-window)
-    (when-let* ((window (mct--get-completion-window))
-              (buffer (window-buffer)))
-    ;; TODO review, are we not always in the *Completions* buffer here?
-    (with-current-buffer buffer
-      (choose-completion)))
     (minibuffer-force-complete-and-exit)))
 
 (defun mct-choose-completion-no-exit ()
   "Run `choose-completion' in the Completions without exiting."
   (interactive nil mct-minibuffer-mode)
-  (when-let ((mini (active-minibuffer-window)))
-    (let ((completion-no-auto-exit t))
-      (choose-completion))
-    (select-window mini nil)))
+  (let ((completion-no-auto-exit t))
+    (choose-completion)))
 
 (defvar display-line-numbers-mode)
 
@@ -834,11 +830,13 @@ last character."
   (interactive nil mct-minibuffer-mode)
   (when-let ((window (mct--get-completion-window))
              ((active-minibuffer-window)))
-    (with-selected-window window
-      (when-let* ((old-point (window-old-point window))
-                  (pos (if (= old-point (point-min))
-                           (mct--first-completion-point)
-                         old-point)))
+    (with-current-buffer (window-buffer window)
+      (let* ((old-point (save-excursion
+                          (select-window window)
+                          (window-old-point)))
+             (pos (if (= old-point (point-min))
+                      (mct--first-completion-point)
+                    old-point)))
         (goto-char pos)
         (mct-choose-completion-no-exit)))))
 



reply via email to

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