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 AEEOKQErdmGzRAAAsNZ9tg (envelope-from ); Mon, 25 Oct 2021 03:56:49 +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 aNPvJAErdmHLCwAAB5/wlQ (envelope-from ); Mon, 25 Oct 2021 03:56:49 +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=1635134209; 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=ALlUmJjqmk4Gah/CMBs+1tcJiAkndpF/+g1sTri4p38=; b=WS38rJCT1II9Yx6OUaosKJ8a0lcTOkevuzoNbSksMHpEz0wxISBY44gO3Z3tD7bY+CTYHZ /+0UI0Nqcj9WnVzRrsVkziKXk4gbUPiaqEHzmmwxR45tGsdDPt8lP8OGpegKCEh+REpQ7p gAtsasi9EnUTdZP6r9+0AXkLlD8qLU2rU4zBWlBIh+Fm+qThVvRZNK9RJdmuyQXWYFpzg9 AP6kT5xjuOa3/b4i620WxJmSuRQ1LJnkf7A0w+psFR7Xzhr3cltJiAGV01YKJybpTh06UG jmeXN1Y/xQFLzji6/8r54uTWCxHlXu1ZQ49ypWiqIzKeLYXNa8J8lGGvvJs1Yw== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 07/10] lei: Set piem-lei-buffer-query for mid-based query functions Date: Sun, 24 Oct 2021 23:56:27 -0400 Message-Id: <20211025035630.297598-8-kyle@kyleam.com> In-Reply-To: <20211025035630.297598-1-kyle@kyleam.com> References: <20211025035630.297598-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: hOx5+eL6i+SH piem-lei-query sets piem-lei-buffer-query to the query it's called with. Like piem-lei-query, piem-lei-query-thread produces a piem-lei-query-mode buffer, but it doesn't set this variable. Make piem-lei-query-thread do so for consistency (though I don't have a concrete use in mind). And I guess piem-lei-show might as well set this variable too. --- piem-lei.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/piem-lei.el b/piem-lei.el index 1051bb5c..e575f4f3 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -142,10 +142,11 @@ (defun piem-lei-show (mid &optional args display) (list (read-string "Message ID: " nil nil (piem-mid)) 'display)) (with-current-buffer (get-buffer-create "*lei-show*") - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (query (list (concat "mid:" mid)))) (erase-buffer) (piem-lei-insert-output - (append (list "q" "--format=text") args (list (concat "mid:" mid)))) + (append (list "q" "--format=text") args query)) (goto-char (point-min)) (when (looking-at-p "# blob:") (delete-region (line-beginning-position) @@ -153,6 +154,7 @@ (defun piem-lei-show (mid &optional args display) (piem-lei-show-mode) (setq piem-lei-buffer-args args) (setq piem-lei-show-mid mid) + (setq piem-lei-buffer-query query) (piem-lei-show--fontify-headers)) (if display (pop-to-buffer (current-buffer)) @@ -596,8 +598,9 @@ (defun piem-lei-query-thread (mid &optional args) (if-let ((mid (piem-lei-get-mid))) (list mid piem-lei-buffer-args) (list (read-string "Message ID: " nil nil (piem-mid)) nil))) - (let* ((records (piem-lei-query--slurp - (append args (list "--threads") (list (concat "mid:" mid))))) + (let* ((query (list (concat "mid:" mid))) + (records (piem-lei-query--slurp + (append args (list "--threads") query))) (msgs (piem-lei-query--thread records)) depths pt-final subject-prev) (with-current-buffer (get-buffer-create "*lei-thread*") @@ -651,6 +654,7 @@ (defun piem-lei-query-thread (mid &optional args) (piem-lei-query-mode) (setq piem-lei-buffer-args args) (setq piem-lei-show-mid mid) + (setq piem-lei-buffer-query query) (pop-to-buffer-same-window (current-buffer))))) -- 2.33.1