summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-10-24 23:56:27 -0400
committerKyle Meyer <kyle@kyleam.com>2021-10-25 22:49:56 -0400
commit5e3002a9245581b3e3a924247707b24a9f21b610 (patch)
treea053342841514fdebf7c6d1ba8d77058e6d73cd9
parent997219b38fc6f14169f646b4000ea2d162d4dad3 (diff)
downloadpiem-5e3002a9245581b3e3a924247707b24a9f21b610.tar.gz
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>
-rw-r--r--piem-lei.el12
1 files 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)))))