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

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

[elpa] externals/mct c72eb363ba 35/64: Add fn to terminate region comple


From: ELPA Syncer
Subject: [elpa] externals/mct c72eb363ba 35/64: Add fn to terminate region completion (hopefully)
Date: Thu, 30 Dec 2021 23:57:58 -0500 (EST)

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

    Add fn to terminate region completion (hopefully)
---
 mct.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/mct.el b/mct.el
index fb4a6ccf1e..1723c48f6b 100644
--- a/mct.el
+++ b/mct.el
@@ -1121,6 +1121,13 @@ region.")
   (setq mct--region-buf (and completion-in-region--data
                              (marker-buffer (nth 0 
completion-in-region--data)))))
 
+(defun mct--region-terminate-completion ()
+  "Terminate completion in region."
+  (when-let ((buf mct--region-buf))
+    (with-current-buffer buf
+      (completion-in-region-mode -1)
+      (keyboard-quit))))
+
 (defun mct--region-focus-current-buffer ()
   "Focus the buffer where `completion-in-region' is active."
   (interactive nil mct-region-mode)
@@ -1183,9 +1190,7 @@ current completion session."
   "Bury the Completions and terminate completion in region."
   (quit-window nil (mct--get-completion-window))
   (mct--region-focus-current-buffer)
-  ;; FIXME 2021-12-27: Ensure that we have exited the
-  ;; completion-in-region.
-  (keyboard-quit))
+  (mct--region-terminate-completion))
 
 (defun mct-next-completion-or-quit (&optional arg)
   "Move to next completion or bury the Completions' buffer.



reply via email to

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