[PATCH] emacs: wrap current search in parens when filtering

Tomi Ollila tomi.ollila at iki.fi
Thu Sep 3 00:32:53 PDT 2015


On Thu, Sep 03 2015, Uli Scholler <uli at scholler.net> wrote:

> 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").
> ---

Looks like a fix! 

But should this do the same "notmuch-search-disjunctive-regexp" check 
which is done when building up `grouped-query' ?

Tomi


>  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
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list