[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct 342b6b3 3/3: Refine switching to top/bottom of Comp
[elpa] externals/mct 342b6b3 3/3: Refine switching to top/bottom of Completions
Tue, 16 Nov 2021 14:57:20 -0500 (EST)
Author: Protesilaos Stavrou <firstname.lastname@example.org>
Commit: Protesilaos Stavrou <email@example.com>
Refine switching to top/bottom of Completions
Now the candidate should be highlighted right away. Before it would
fail to do so for a new Completions' buffer.
Also, now it works properly when completions-detailed is non-nil and we
are switching to the bottom of the results produced by
describe-symbol (or related). Before it would go to the first character
which is just an annotation character.
mct.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mct.el b/mct.el
index 1242edb..33df024 100644
@@ -516,7 +516,9 @@ a `one-column' value."
(setq old-point (window-old-point window)
old-line (line-number-at-pos old-point))
(when (= (line-number-at-pos line) old-line)
- (goto-char old-point))))))
+ (if (eq old-point (point-min))
+ (goto-char (mct--first-completion-point))
+ (goto-char old-point)))))))
(defun mct-switch-to-completions-top ()
"Switch to the top of the completions' buffer."
@@ -532,6 +534,8 @@ a `one-column' value."
+ (unless (get-text-property (point) 'completion--string)
+ (next-completion 1))