From 5e3002a9245581b3e3a924247707b24a9f21b610 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 24 Oct 2021 23:56:27 -0400 Subject: lei: Set piem-lei-buffer-query for mid-based query functions 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. Message-Id: <20211025035630.297598-8-kyle@kyleam.com> --- piem-lei.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/piem-lei.el b/piem-lei.el index 1051bb5..e575f4f 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -142,10 +142,11 @@ unless DISPLAY is non-nil." (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 @@ unless DISPLAY is non-nil." (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 @@ ARGS is passed to the underlying `lei q' call." (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 @@ ARGS is passed to the underlying `lei q' call." (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))))) -- cgit v1.2.3