[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct cba122cf2d 2/3: Simplify mct-choose-completion{-no,
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct cba122cf2d 2/3: Simplify mct-choose-completion{-no, }-exit |
Date: |
Thu, 30 Dec 2021 05:57:40 -0500 (EST) |
branch: externals/mct
commit cba122cf2d977403297b6629493a06ad44d3271a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Simplify mct-choose-completion{-no,}-exit
---
mct.el | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/mct.el b/mct.el
index 0d83a704c9..2e9524d57e 100644
--- a/mct.el
+++ b/mct.el
@@ -671,26 +671,21 @@ If ARG is supplied, move that many completion groups at a
time."
;;;;; Candidate selection
+;; 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-mode)
+ (interactive nil mct-minibuffer-mode)
+ (choose-completion)
(when (active-minibuffer-window)
- (when-let* ((window (mct--get-completion-window))
- (buffer (window-buffer)))
- (with-current-buffer buffer
- (choose-completion))
- (minibuffer-force-complete-and-exit))))
+ (minibuffer-force-complete-and-exit)))
(defun mct-choose-completion-no-exit ()
"Run `choose-completion' in the Completions without exiting."
- (interactive nil mct-mode)
- (when-let* ((window (mct--get-completion-window))
- (buffer (window-buffer))
- (mini (active-minibuffer-window)))
- (with-current-buffer buffer
- (let ((completion-no-auto-exit t))
- (choose-completion)))
- (select-window mini nil)))
+ (interactive nil mct-minibuffer-mode)
+ (let ((completion-no-auto-exit t))
+ (choose-completion)))
(defvar display-line-numbers-mode)