When filtering the current search further with notmuch-search-filter,
wrap the current search in parens.

This fixes unexpected behavior when the current search is
complex (like "(tag:this and date:one_week_ago..) or tag:that").
---
 emacs/notmuch.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5284e77..a98ec96 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -989,7 +989,7 @@ current search results AND the additional query string 
provided."
                         query)))
     (notmuch-search (if (string= notmuch-search-query-string "*")
                        grouped-query
-                     (concat notmuch-search-query-string " and " 
grouped-query)) notmuch-search-oldest-first)))
+                     (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.
-- 
2.1.4


_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to