[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct d45cf4ee26 30/64: Handle current buffer of in-regio
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct d45cf4ee26 30/64: Handle current buffer of in-region completion |
Date: |
Thu, 30 Dec 2021 23:57:58 -0500 (EST) |
branch: externals/mct
commit d45cf4ee26ffae0670297cbef2049a003346830b
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Handle current buffer of in-region completion
---
mct.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/mct.el b/mct.el
index 22d4f8b353..476ee9d11d 100644
--- a/mct.el
+++ b/mct.el
@@ -304,13 +304,11 @@ Meant to be added to `after-change-functions'."
(buf (window-buffer win)))
(buffer-local-value 'mct--active buf)))
-;; TODO 2021-12-27: If we want to make a buffer-local variant, then we
-;; need to behave like `mct--active-p', because checking for
-;; `completion-in-region-mode' will always fail while in the
-;; Completions' buffer.
+;; TODO 2021-12-29: If we want to make a buffer-local variant, then we
+;; need to review this.
(defun mct--region-p ()
"Return non-nil if Mct is completing in region."
- (bound-and-true-p mct-region-mode))
+ (and (bound-and-true-p mct-region-mode) mct--region-buf))
(defun mct--display-completion-list-advice (&rest app)
"Prepare advice around `display-completion-list'.
@@ -1117,14 +1115,13 @@ region.")
;;;;;; Live completions
-;; FIXME 2021-12-05: This seems to be called at the wrong time? It
-;; never captures the buffer that started the completion-in-region. We
-;; need to get this right for cycling to work between the buffer and the
-;; Completions.
+(defvar mct--region-buf nil
+ "Current buffer where Mct performs completion in region.")
+
(defun mct--region-current-buffer ()
"Return current buffer of completion in region."
- (and completion-in-region--data
- (marker-buffer (nth 0 completion-in-region--data))))
+ (setq mct--region-buf (and completion-in-region--data
+ (marker-buffer (nth 0
completion-in-region--data)))))
(defun mct--focus-current-buffer ()
"Focus the buffer where `completion-in-region' is active."
@@ -1155,6 +1152,7 @@ Meant to be added to `after-change-functions'."
"Set up Mct for `completion-in-region'."
(if completion-in-region-mode
(progn
+ (mct--region-current-buffer)
;; TODO 2021-12-07: Find built-in command or write new one for
;; TAB to only expand the current input. That should fix the
;; following problem and probably all the others mentioned below
@@ -1218,6 +1216,7 @@ current completion session."
(defun mct--quit-completion-in-region ()
"Bury the Completions and terminate completion in region."
(quit-window nil (mct--get-completion-window))
+ (mct--focus-current-buffer)
;; FIXME 2021-12-27: Ensure that we have exited the
;; completion-in-region.
(keyboard-quit))
- [elpa] externals/mct 90aa42f432 13/64: Style the completions regardless of mct variant, (continued)
- [elpa] externals/mct 90aa42f432 13/64: Style the completions regardless of mct variant, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 236e03fd5e 08/64: Install advice to silence messages in region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 8958528d2e 21/64: Merge branch 'main' into experiment-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 53dc6be137 20/64: Write routines for next/prev/directional motions, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 639add9b8e 25/64: Merge 'main' into experiment-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct eaf0f98d55 26/64: Merge branch 'main' into experiment-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct d48e6baae5 27/64: Minor correction in outline heading, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 6bbad9f046 31/64: Remove outdated FIXME, ELPA Syncer, 2021/12/30
- [elpa] externals/mct ca958cba65 32/64: Remove comments on quirky behaviour, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 29015a1699 37/64: Fix performance issues by avoiding recursion, ELPA Syncer, 2021/12/30
- [elpa] externals/mct d45cf4ee26 30/64: Handle current buffer of in-region completion,
ELPA Syncer <=
- [elpa] externals/mct 95a37bc66d 36/64: Merge 'main' into experiment-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 523f84e9ee 39/64: Remove note on mct-region-mode---it works (?) now, ELPA Syncer, 2021/12/30
- [elpa] externals/mct bb44658a8b 43/64: Inhibit messages directly in mct--show-completions, ELPA Syncer, 2021/12/30
- [elpa] externals/mct f2d2fb0ec7 42/64: Fixes and TODOS, ELPA Syncer, 2021/12/30
- [elpa] externals/mct e617bfd0aa 45/64: Remove mct--quit-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct f1b1a5c76e 46/64: Remove mct-choose-completion-in-region, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 7974ae0450 40/64: Remove needless call to fit completions to window, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 14059afa44 41/64: Make mct-region-mode advice completions window, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 13839537f2 29/64: Remove outdated comment, ELPA Syncer, 2021/12/30
- [elpa] externals/mct 5c8fbb1784 51/64: Simplify mct-choose-completion-no-exit, ELPA Syncer, 2021/12/30