[PATCH] custom search prefix

Sebastian Fischmeister sfischme at uwaterloo.ca
Sun Apr 5 18:13:29 PDT 2015


---
 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


More information about the notmuch mailing list