Re: [PATCH] emacs: wrap current search in parens when filtering
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 3 Sep 2015 07:32:53 +0000 (10:32 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:30 +0000 (14:49 -0700)
90/c5b6ee79898dbafd2aed73734157d84b994213 [new file with mode: 0644]

diff --git a/90/c5b6ee79898dbafd2aed73734157d84b994213 b/90/c5b6ee79898dbafd2aed73734157d84b994213
new file mode 100644 (file)
index 0000000..74dafc5
--- /dev/null
@@ -0,0 +1,91 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 369AE6DE1B5D\r
+ for <notmuch@notmuchmail.org>; Thu,  3 Sep 2015 00:34:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.814\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.814 tagged_above=-999 required=5 tests=[AWL=0.162, \r
+ SPF_NEUTRAL=0.652] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id G6-sWVTc8hUG for <notmuch@notmuchmail.org>;\r
+ Thu,  3 Sep 2015 00:34:24 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 7F7106DE1B5B\r
+ for <notmuch@notmuchmail.org>; Thu,  3 Sep 2015 00:34:24 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 6A80F1000E6;\r
+ Thu,  3 Sep 2015 10:32:53 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Uli Scholler <uli@scholler.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: wrap current search in parens when filtering\r
+In-Reply-To: <1441231034-9413-1-git-send-email-uli@scholler.net>\r
+References: <1441231034-9413-1-git-send-email-uli@scholler.net>\r
+User-Agent: Notmuch/0.20.2+68~g0c35549 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 03 Sep 2015 10:32:53 +0300\r
+Message-ID: <m2zj142c0q.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 03 Sep 2015 07:34:27 -0000\r
+\r
+On Thu, Sep 03 2015, Uli Scholler <uli@scholler.net> wrote:\r
+\r
+> When filtering the current search further with notmuch-search-filter,\r
+> wrap the current search in parens.\r
+>\r
+> This fixes unexpected behavior when the current search is\r
+> complex (like "(tag:this and date:one_week_ago..) or tag:that").\r
+> ---\r
+\r
+Looks like a fix! \r
+\r
+But should this do the same "notmuch-search-disjunctive-regexp" check \r
+which is done when building up `grouped-query' ?\r
+\r
+Tomi\r
+\r
+\r
+>  emacs/notmuch.el | 2 +-\r
+>  1 file changed, 1 insertion(+), 1 deletion(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index 5284e77..a98ec96 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -989,7 +989,7 @@ current search results AND the additional query string provided."\r
+>                       query)))\r
+>      (notmuch-search (if (string= notmuch-search-query-string "*")\r
+>                      grouped-query\r
+> -                  (concat notmuch-search-query-string " and " grouped-query)) notmuch-search-oldest-first)))\r
+> +                  (concat "(" notmuch-search-query-string ") and " grouped-query)) notmuch-search-oldest-first)))\r
+>  \r
+>  (defun notmuch-search-filter-by-tag (tag)\r
+>    "Filter the current search results based on a single tag.\r
+> -- \r
+> 2.1.4\r
+>\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r