summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-12-27 21:20:32 -0500
committerKyle Meyer <kyle@kyleam.com>2021-12-28 12:08:35 -0500
commitf355e4fc3b9a06e65e1102c073bdf340f06454c2 (patch)
treee4d942d79f79399979c3286bf958be303c9fb59b
parent2b08667d9165da5381e6044b1ffa0bea90241110 (diff)
downloadpiem-f355e4fc3b9a06e65e1102c073bdf340f06454c2.tar.gz
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>
-rw-r--r--piem-lei.el10
1 files changed, 9 insertions, 1 deletions
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))