From 4122fe3c6e350182d40a527d4392edb08e1dcb92 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 23 Oct 2021 16:57:12 -0400 Subject: lei: Prefer "mid:" to "m:" The "m:" prefix is probabilistic and can do partial matches, whereas "mid:" is boolean (see lib/PublicInbox/Search.pm). When "m:" is used in lei, the intention is to get the one and only, so switch to using "mid:". Message-Id: <20211023205712.202126-1-kyle@kyleam.com> --- piem-lei.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/piem-lei.el b/piem-lei.el index cd1dbe0..6bd977d 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -121,7 +121,7 @@ unless DISPLAY is non-nil." (let ((inhibit-read-only t)) (erase-buffer) (call-process "lei" nil '(t nil) nil - "q" "--format=text" (concat "m:" mid)) + "q" "--format=text" (concat "mid:" mid)) (goto-char (point-min)) (when (looking-at-p "# blob:") (delete-region (line-beginning-position) @@ -502,7 +502,7 @@ Return a list with a `piem-lei-msg' object for each root." (list (or (piem-lei-get-mid) (read-string "Message ID: " nil nil (piem-mid))))) (let* ((records (piem-lei-query--slurp - (list "--threads" (concat "m:" mid)))) + (list "--threads" (concat "mid:" mid)))) (msgs (piem-lei-query--thread records)) depths pt-final subject-prev) (with-current-buffer (get-buffer-create "*lei-thread*") @@ -571,7 +571,7 @@ Return a list with a `piem-lei-msg' object for each root." (when-let ((mid (piem-lei-get-mid))) (with-temp-buffer (call-process "lei" nil '(t nil) nil - "q" "--format=mboxrd" (concat "m:" mid)) + "q" "--format=mboxrd" (concat "mid:" mid)) (goto-char (point-min)) (piem-inbox-by-header-match)))) @@ -581,7 +581,7 @@ The message ID should not include have surrounding brackets." (not (string-empty-p (with-temp-buffer (call-process "lei" nil '(t nil) nil - "q" "--format=ldjson" (concat "m:" mid)) + "q" "--format=ldjson" (concat "mid:" mid)) (buffer-string))))) (defun piem-lei-mid-to-thread (mid) @@ -590,7 +590,7 @@ The message ID should not include have surrounding brackets." (lambda () (call-process "lei" nil '(t nil) nil "q" "--format=mboxrd" "--threads" - (concat "m:" mid))))) + (concat "mid:" mid))))) ;;;###autoload (define-minor-mode piem-lei-mode -- cgit v1.2.3