From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:f42::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id UAW/HYx0ymFWRAAAsNZ9tg (envelope-from ); Tue, 28 Dec 2021 02:21:00 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IIGCHYx0ymE4pwAAauVa8A (envelope-from ); Tue, 28 Dec 2021 03:21:00 +0100 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1640658059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GoQf4Kyo/glqK/4f4ItNyOgFHQFSWXndiVtQU7zHun8=; b=Umbt6dnYZI+gDAWAh8JSNu43LBO/E4gRCK4jOUuwDJbft28K1lQPkElCkYorVGpYXginVh d+VFTZJVWBcnG4kMvW9F+YFQ1nPBQXpxvZMm0uevb9RYICG88qEB/40l0GdDIG/dGfHw0q AM531bgVlw7T7f9bPlS+KH2G/qYvpB1xr1Etd/hDeIoswMkSKp0ZQw5hk14eL2cSfmlfie tbZEjPxPdNdkO2m7xhkRhclutaEfod7QGRv/qceF8eu70L4dlXySkZtCZXRBAdU8+dfHwQ CKd+ArlGAtdkG/NgUEhz0Nbi1iG6WE1483jo+Kj9I2Q5poGslxoMr2VUUZxWEQ== From: Kyle Meyer 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 Message-Id: <20211228022037.206597-2-kyle@kyleam.com> In-Reply-To: <20211228022037.206597-1-kyle@kyleam.com> References: <20211228022037.206597-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: 3M41s3x4KYEn 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"))) + ;;;; 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