From 93000654bf06aac64330c285863d4c3db1b495db Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 5 Jun 2021 17:13:52 -0400 Subject: piem-lei-query-thread: Position point on seed message It seems likely that the caller wants to start digesting the thread in the context of the seed message, and that message may be part of a large thread. Move point to help orient the caller. Notmuch nicely distinguishes search hits from other messages when displaying a thread. Something along those lines is worth considering eventually. Message-Id: <20210605211402.20304-9-kyle@kyleam.com> --- piem-lei.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piem-lei.el b/piem-lei.el index 2bed43e..74bf357 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -370,7 +370,7 @@ Return a list with a `piem-lei-msg' object for each root." (let* ((records (piem-lei-query--slurp (list "--threads" (concat "m:" mid)))) (msgs (piem-lei-query--thread records)) - depths) + depths pt-final) (with-current-buffer (get-buffer-create "*lei-thread*") (let ((inhibit-read-only t)) (erase-buffer) @@ -403,9 +403,11 @@ Return a list with a `piem-lei-msg' object for each root." (propertize (concat " <" mid-msg ">") 'font-lock-face 'piem-lei-query-thread-ghost))) + (when (equal mid-msg mid) + (setq pt-final (line-beginning-position))) (insert ?\n))) (insert "End of lei-q results")) - (goto-char (point-min)) + (goto-char (or pt-final (point-min))) (piem-lei-query-mode) (pop-to-buffer-same-window (current-buffer))))) -- cgit v1.2.3