aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-06-05 17:13:52 -0400
committerKyle Meyer <kyle@kyleam.com>2021-06-07 00:12:06 -0400
commit93000654bf06aac64330c285863d4c3db1b495db (patch)
tree005e13fe84bbc0516bff890a1a4635bbd525983d
parent17e1a088537e292ed7c55d44453e93b2fc07601c (diff)
downloadpiem-93000654bf06aac64330c285863d4c3db1b495db.tar.gz
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>
-rw-r--r--piem-lei.el6
1 files 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)))))