Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 369AE6DE1B5D for ; Thu, 3 Sep 2015 00:34:27 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.814 X-Spam-Level: X-Spam-Status: No, score=0.814 tagged_above=-999 required=5 tests=[AWL=0.162, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G6-sWVTc8hUG for ; Thu, 3 Sep 2015 00:34:24 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 7F7106DE1B5B for ; Thu, 3 Sep 2015 00:34:24 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 6A80F1000E6; Thu, 3 Sep 2015 10:32:53 +0300 (EEST) From: Tomi Ollila To: Uli Scholler , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: wrap current search in parens when filtering In-Reply-To: <1441231034-9413-1-git-send-email-uli@scholler.net> References: <1441231034-9413-1-git-send-email-uli@scholler.net> User-Agent: Notmuch/0.20.2+68~g0c35549 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2015 07:34:27 -0000 On Thu, Sep 03 2015, Uli Scholler 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@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch