[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct 50d5a8fec4 1/3: Made mct-edit-completion work regar
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct 50d5a8fec4 1/3: Made mct-edit-completion work regardless of window |
Date: |
Thu, 30 Dec 2021 05:57:40 -0500 (EST) |
branch: externals/mct
commit 50d5a8fec4482a7f063b3ce94da57cc4b3ef139a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Made mct-edit-completion work regardless of window
The problem with the old design was that if the Completions were
displayed in (minibuffer-selected-window) then the command would not
switch to the minibuffer but instead stay in the selected window where
the Completions once were.
Thakns to Andrew Tropin for the detailed feedback in a mailing list
thread of the rde project:
<https://lists.sr.ht/~abcdw/rde-devel/%3C87sfunipyn.fsf%40trop.in%3E#%3C874k6qms3m.fsf@trop.in%3E>.
---
mct.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/mct.el b/mct.el
index f8231e5b7f..0d83a704c9 100644
--- a/mct.el
+++ b/mct.el
@@ -805,14 +805,16 @@ determined as follows:
A candidate is recognised for as long as point is not past its
last character."
- (interactive nil mct-mode)
+ (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)))))