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

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

[elpa] externals/mct adeddd2dfe 14/64: Write helper for "choose completi


From: ELPA Syncer
Subject: [elpa] externals/mct adeddd2dfe 14/64: Write helper for "choose completion" routine
Date: Thu, 30 Dec 2021 23:57:52 -0500 (EST)

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

    Write helper for "choose completion" routine
---
 mct.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/mct.el b/mct.el
index ed7affa769..47802c14e9 100644
--- a/mct.el
+++ b/mct.el
@@ -693,15 +693,21 @@ If ARG is supplied, move that many completion groups at a 
time."
 
 ;;;;; Candidate selection
 
+;; We need this helper for completion-in-region.  See
+;; `mct-choose-completion-in-region'.
+(defun mct--completions-choose-completion ()
+  "Choose candidate from the Completions' buffer."
+  (when-let* ((window (mct--get-completion-window))
+              (buffer (window-buffer)))
+    (with-current-buffer buffer
+      (choose-completion))))
+
 (defun mct-choose-completion-exit ()
   "Run `choose-completion' in the Completions buffer and exit."
   (interactive nil mct-mode)
   (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))))
+    (mct--completions-choose-completion)
+    (minibuffer-force-complete-and-exit)))
 
 (defun mct-choose-completion-no-exit ()
   "Run `choose-completion' in the Completions without exiting."



reply via email to

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