From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id 2FUQNTrpu2BIbQAAsNZ9tg (envelope-from ); Sat, 05 Jun 2021 21:14:34 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4LT5NDbpu2CORgAAbx9fmQ (envelope-from ); Sat, 05 Jun 2021 21:14:30 +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=1622927670; 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=sjNdNTnj3ZSTZJHrKdJ0pV++x8aQ0GOvZ6Unf8wwAKU=; b=f+7Px+U1qD1rYs9gDz2qFNM46sWp52c0XTrnnJdYRcUhgPqHeOTo4OUw1r5VHIvzx+CB12 dSWAfdGYTG6qal4Limo70S+MtLr8Cfa/eM50/B/29v5raR8v0MKiGAAm/A4M2RaOFarNjH mxgyiNxT96jYTalIejANpxWlOWOP1eygXH8XC6se5PPGLLqGyPyhW2STswmF6fdxX4Hj7H Qu3NhPYTbML10yZtWDBh7nZ1WJTvopx8Aq+4pf/ezRUi5OkqDDA/KK7dQszfBrNLdMeRuo 5IkwYZnGVgvYCaWcYHf/0mqZO6stOgIsVnAHf5vzg0oluyQ/LFmstQQ/hBd4qg== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 05/18] lei query: Add piem-lei-show wrapper for displaying line's message Date: Sat, 5 Jun 2021 17:13:49 -0400 Message-Id: <20210605211402.20304-6-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: SmGz97XWCDT/ --- piem-lei.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/piem-lei.el b/piem-lei.el index ed153c26..12ccd870 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -200,6 +200,24 @@ (defun piem-lei-query (query) (piem-lei-query-mode) (pop-to-buffer-same-window (current-buffer)))) +(defun piem-lei-query-get-mid (&optional pos) + "Return message ID for position POS in a `piem-lei-query-mode' buffer. +When POS is nil, use the position at the start of the current +line." + (cdr (assq 'm (get-text-property (or pos (line-beginning-position)) + 'piem-lei-query-result)))) + +(defun piem-lei-query-show () + "Display message for current `piem-lei-query-mode' line." + (interactive) + (display-buffer + (piem-lei-show + (or (piem-lei-query-get-mid) + (user-error "No Message ID associated with current line"))) + '(display-buffer-below-selected + (inhibit-same-window . t) + (window-height . 0.8)))) + (define-derived-mode piem-lei-query-mode special-mode "lei-query" "Major mode for displaying overview of `lei q' results." :group 'piem-lei -- 2.31.1