From 9146e7c012213ee8391dbd8515207d7243f4b8e5 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 27 Oct 2017 15:43:33 -0400 Subject: Define notmuch-search variant --- init.el | 2 ++ lisp/km-mail.el | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/init.el b/init.el index d30746a..7cb0d69 100644 --- a/init.el +++ b/init.el @@ -2192,6 +2192,8 @@ :init (define-key km/mail-map "." #'km/notmuch-show-at-point) :config + (define-key notmuch-common-keymap [remap notmuch-search] + #'km/notmuch-search) (define-key notmuch-search-mode-map "R" #'km/notmuch-archive-all) (define-key notmuch-show-part-map "|" #'km/notmuch-show-pipe-part-to-project) diff --git a/lisp/km-mail.el b/lisp/km-mail.el index c9fbe1e..88511a2 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -132,6 +132,20 @@ in the remote's \".git/config\" entry." (magit-call-git "fetch" remote)) (magit-log (list (concat base-ref ".." local-ref))))) +;;;###autoload +(defun km/notmuch-search () + "Call `notmuch-search', bypassing `notmuch-read-query'." + (interactive) + (notmuch-search + (read-string "Notmuch search: " + "date:20d.. " + 'notmuch-search-history + (pcase major-mode + (`notmuch-search-mode (notmuch-search-get-query)) + (`notmuch-show-mode (notmuch-show-get-query)) + (`notmuch-tree-mode (notmuch-tree-get-query)))) + (default-value 'notmuch-search-oldest-first))) + (defmacro km/notmuch-with-raw-message (msg-id &rest body) "Evaluate BODY with temporary buffer containing text for MSG-ID. MSG-ID is evaluated before entering the temporary buffer. See -- cgit v1.2.3