[PATCH] custom search prefix

Subject: [PATCH] custom search prefix

Date: Sun, 5 Apr 2015 21:13:29 -0400

To: notmuch

Cc:

From: Sebastian Fischmeister


---
 emacs/notmuch.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index ab00454..c9cd31a 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -851,6 +851,12 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
           (concat "*notmuch-search-" query "*"))
          )))
 
+(defcustom notmuch-query-prefix nil
+  "Add a prefix to the standard query."
+  :type 'string
+  :group 'notmuch-search)
+
+
 (defun notmuch-read-query (prompt)
   "Read a notmuch-query from the minibuffer with completion.
 
@@ -883,7 +889,7 @@ PROMPT is the string to prompt with."
       ;; this was simpler than convincing completing-read to accept spaces:
       (define-key keymap (kbd "TAB") 'minibuffer-complete)
       (let ((history-delete-duplicates t))
-       (read-from-minibuffer prompt nil keymap nil
+       (read-from-minibuffer prompt notmuch-query-prefix keymap nil
                              'notmuch-search-history current-query nil)))))
 
 (defun notmuch-search-get-query ()
-- 
2.3.5

Thread: