discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH 1/6] lei q: Allow initial input for query to be customized
Date: Mon, 27 Dec 2021 21:20:32 -0500	[thread overview]
Message-ID: <20211228022037.206597-2-kyle@kyleam.com> (raw)
In-Reply-To: <20211228022037.206597-1-kyle@kyleam.com>

piem-lei-query reads with initial input of "d:20.days.ago.. ", which I
find useful because this time restriction works well with what I'm
most often searching for.  (This is a value I've long used with
Notmuch.)  However, what value of "recent" is most reasonable is
likely to vary across users, and some users may not want the
restriction at all.

Add an option so that the initial input can be easily configured.
---
 piem-lei.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/piem-lei.el b/piem-lei.el
index ffd72f39..4485dcdf 100644
--- a/piem-lei.el
+++ b/piem-lei.el
@@ -37,6 +37,12 @@ (defcustom piem-lei-lei-executable "lei"
   "Which lei executable to use."
   :type 'string)
 
+(defcustom piem-lei-query-initial-input "d:20.days.ago.. "
+  "Initial input when reading `lei q' queries."
+  :package-version '(piem . "0.4.0")
+  :type '(choice (const :tag "None" nil)
+                 (string :tag "Query")))
+
 \f
 ;;;; Helpers
 
@@ -233,7 +239,9 @@ (defun piem-lei-query (query &optional args)
 QUERY is split according to `split-string-and-unquote'."
   (interactive
    (list (split-string-and-unquote
-          (read-string "Query: " "d:20.days.ago.. " 'piem-lei-query-history))
+          (read-string "Query: "
+                       piem-lei-query-initial-input
+                       'piem-lei-query-history))
          (transient-args 'piem-lei-q)))
   (with-current-buffer (get-buffer-create "*lei-query*")
     (let ((inhibit-read-only t))
-- 
2.34.0


  reply	other threads:[~2021-12-28  2:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28  2:20 [PATCH 0/6] lei q: Support displaying multiple threads Kyle Meyer
2021-12-28  2:20 ` Kyle Meyer [this message]
2021-12-28  2:20 ` [PATCH 2/6] lei q: Extract buffer names to variables Kyle Meyer
2021-12-28  2:20 ` [PATCH 3/6] lei q: Support displaying multiple threads Kyle Meyer
2021-12-28 16:03   ` Xinglu Chen
2021-12-28 17:26     ` Kyle Meyer
2021-12-28  2:20 ` [PATCH 4/6] lei q: Add date placeholder for ghost messages Kyle Meyer
2021-12-28  2:20 ` [PATCH 5/6] lei q: Separate different threads with newline Kyle Meyer
2021-12-28  2:20 ` [PATCH 6/6] lei q: Sort threads by date of initial message Kyle Meyer
2021-12-28 17:24   ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211228022037.206597-2-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.kyleam.com/piem/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).