mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
emacs: Fix search filtering of a global search ("*")
With the recent addition of "*" being a special case for a search matching all messages, we have to take care when doing a filter operation. In this case it's not legal to simply append and get: * and <some-new-search-terms> Instead we carefully construct a new search string of only: <some-new-search-terms> This could all be avoided if we had a parser that could understand "*" with the meaning we want.
This commit is contained in:
parent
75cfd0d906
commit
b4459b8a4d
1 changed files with 6 additions and 2 deletions
|
@ -773,8 +773,12 @@ search."
|
|||
Runs a new search matching only messages that match both the
|
||||
current search results AND the additional query string provided."
|
||||
(interactive "sFilter search: ")
|
||||
(let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query) (concat "( " query " )") query)))
|
||||
(notmuch-search (concat notmuch-search-query-string " and " grouped-query) notmuch-search-oldest-first)))
|
||||
(let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query)
|
||||
(concat "( " query " )")
|
||||
query)))
|
||||
(notmuch-search (if (string= notmuch-search-query-string "*")
|
||||
grouped-query
|
||||
(concat notmuch-search-query-string " and " grouped-query)) notmuch-search-oldest-first)))
|
||||
|
||||
(defun notmuch-search-filter-by-tag (tag)
|
||||
"Filter the current search results based on a single tag.
|
||||
|
|
Loading…
Reference in a new issue