From f355e4fc3b9a06e65e1102c073bdf340f06454c2 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 27 Dec 2021 21:20:32 -0500 Subject: lei q: Allow initial input for query to be customized 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. Message-Id: <20211228022037.206597-2-kyle@kyleam.com> --- piem-lei.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/piem-lei.el b/piem-lei.el index ffd72f3..4485dcd 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -37,6 +37,12 @@ "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"))) + ;;;; Helpers @@ -233,7 +239,9 @@ unless DISPLAY is non-nil." 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)) -- cgit v1.2.3