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

[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


From: ELPA Syncer
Subject: [elpa] externals/mct 342b6b3 3/3: Refine switching to top/bottom of Completions
Date: Tue, 16 Nov 2021 14:57:20 -0500 (EST)

branch: externals/mct
commit 342b6b3824c759ff07dca48de5821f4ed889dcec
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.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
--- a/mct.el
+++ b/mct.el
@@ -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."
   (goto-char (point-max))
   (next-completion -1)
   (goto-char (point-at-bol))
+  (unless (get-text-property (point) 'completion--string)
+    (next-completion 1))
   (mct--restore-old-point-in-grid (point))
   (recenter
    (- -1



reply via email to

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