From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id yGo9Fz/pu2BIbQAAsNZ9tg (envelope-from ); Sat, 05 Jun 2021 21:14:39 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sOlnFzvpu2AeWgAAB5/wlQ (envelope-from ); Sat, 05 Jun 2021 21:14:35 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1622927675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+W6VS/7+iM+8h434MzrP338eVylQT7cdzZzIybQN410=; b=B34vl3Bd/+gBrhfse7VeZVjizPJnfUXEOrswRGMdvBECKYKyX8tjOZ5JPirDnIp6DyJaBG OXnw1hmOT7zi8sfjh6ZVLYAzMcA1oNx3OgcoKhuZ4nsQkEcCrmxjkvtGyy0eqJEGBTEQP+ Y7wt5zEMl5/4WfKbhZdgDTC0EXh0dULcwFIg1kryAwhZzyV6sy6hw/lGti7oiyUHkJ+6Ic 611LAK9SxwkYr3DYpguiX0j6C1z2laeBj5/cEcN8iMaDOPRZ9e2lSXkT5hFqQkNE2aoFm6 7SiHOoQMbVhs06YY/1JI2STcX3szn4NIFiw2cru6Cgq2prb6CzFXSszHqLkhEA== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 08/18] piem-lei-query-thread: Position point on seed message Date: Sat, 5 Jun 2021 17:13:52 -0400 Message-Id: <20210605211402.20304-9-kyle@kyleam.com> In-Reply-To: <20210605211402.20304-1-kyle@kyleam.com> References: <20210605211402.20304-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: /WVB6CvNwJhn 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. --- piem-lei.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piem-lei.el b/piem-lei.el index 2bed43ef..74bf357e 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -370,7 +370,7 @@ (defun piem-lei-query-thread (mid) (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 @@ (defun piem-lei-query-thread (mid) (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))))) -- 2.31.1