* add `mu4e-headers-search-refine' (bound to "/"), which lets you filter the

current search results by appending to the current search expression.
This commit is contained in:
djcb
2012-05-06 11:21:12 +03:00
parent aaeb56734d
commit 9e6802993f
2 changed files with 23 additions and 2 deletions

View File

@ -303,6 +303,8 @@ after the end of the search results."
(define-key map "r" 'mu4e-headers-rerun-search)
(define-key map "g" 'mu4e-headers-rerun-search) ;; for compatibility
(define-key map "/" 'mu4e-headers-search-refine)
(define-key map "%" 'mu4e-headers-mark-matches)
(define-key map "t" 'mu4e-headers-mark-subthread)
(define-key map "T" 'mu4e-headers-mark-thread)
@ -752,6 +754,24 @@ the bookmark before starting the search."
(mu4e-headers-search-bookmark nil current-prefix-arg t))
(defun mu4e-headers-search-refine (extra search-all)
"Do a search based on the last search with clause EXTRA
appended. SEARCH-ALL (prefix-argument) determines whether to run
*all* results or only up to `mu4e-search-results-limit'. You can
use this function to 'filter', 'zoom in' to your search results."
(interactive
(let ((extra
(read-string (mu4e-format "Filter result: ")
nil 'mu4e~headers-search-hist nil t))
(search-all current-prefix-arg))
(list extra search-all)))
(unless mu4e~headers-query
(error "There's nothing to filter"))
(mu4e-headers-search
(format "(%s) AND %s" mu4e~headers-query extra) search-all))
(defun mu4e-headers-view-message ()
"View message at point. If there's an existing window for the
view, re-use that one. If not, create a new one, depending on the

View File

@ -311,6 +311,7 @@ is nil, and otherwise open it."
(define-key map "z" 'mu4e-view-kill-buffer-and-window)
(define-key map "s" 'mu4e-headers-search)
(define-key map "/" 'mu4e-headers-search-refine)
(define-key map "b" 'mu4e-headers-search-bookmark)
(define-key map "B" 'mu4e-headers-search-bookmark-edit)