Re: [PATCH] WIP: regexp matching in subjects
authorDavid Bremner <david@tethera.net>
Tue, 7 Jun 2016 10:16:27 +0000 (07:16 +2100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:00 +0000 (16:22 -0700)
42/274199060caad0a72ab6ffd874b9da125f3629 [new file with mode: 0644]

diff --git a/42/274199060caad0a72ab6ffd874b9da125f3629 b/42/274199060caad0a72ab6ffd874b9da125f3629
new file mode 100644 (file)
index 0000000..0e06cb7
--- /dev/null
@@ -0,0 +1,99 @@
+Return-Path: <david@tethera.net>\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 878306DE00DA\r
+ for <notmuch@notmuchmail.org>; Tue,  7 Jun 2016 03:16:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.011\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5\r
+ tests=[AWL=-0.000, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ 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 q9H0-Ux0xJ0z for <notmuch@notmuchmail.org>;\r
+ Tue,  7 Jun 2016 03:16:41 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id B07C76DE00D3\r
+ for <notmuch@notmuchmail.org>; Tue,  7 Jun 2016 03:16:41 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1bAE3V-00061n-9c; Tue, 07 Jun 2016 06:16:17 -0400\r
+Received: (nullmailer pid 14467 invoked by uid 1000);\r
+ Tue, 07 Jun 2016 10:16:27 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Austin Clements <aclements@csail.mit.edu>\r
+Cc: sfischme@uwaterloo.ca, Gaute Hope <eg@gaute.vetsj.com>,\r
+ notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH] WIP: regexp matching in subjects\r
+In-Reply-To: <1465265149-7174-1-git-send-email-david@tethera.net>\r
+References:\r
+ <CAH-f9WtC6CeVecfg8wFZUVc8K2rUfzsP72xo97sJX2y_mLW6-g@mail.gmail.com>\r
+ <1465265149-7174-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.22+28~gb9bf3f4 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 07 Jun 2016 07:16:27 -0300\r
+Message-ID: <87ziqx9udg.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 07 Jun 2016 10:16:49 -0000\r
+\r
+David Bremner <david@tethera.net> writes:\r
+\r
+> the idea is that you can run\r
+>\r
+> % notmuch search 'subject:rx:<your-favourite-regexp>'\r
+>\r
+> or\r
+>\r
+> % notmuch search subject:"your usual phrase search"\r
+>\r
+> This should also work with bindings.\r
+> ---\r
+>\r
+> Here is Austin's "hack", crammed into the field processor framework.\r
+> I seem to have broken one of the existing subject search tests with my\r
+> recursive query parsing. I didn't have time to figure out why, yet.\r
+\r
+A few hours sleep and I think I understand the issue.\r
+\r
+with\r
+\r
+        subject:"your usual phrase search"\r
+\r
+I believe the phrase-ness (word ordering and proximity) gets lost when\r
+using a field processor. So, since I don't know if/when this issue will\r
+be fixed in Xapian, we should probably use a seperate prefix for regexp\r
+search. This leads to two potential syntaxes\r
+\r
+        subject_re:"^i am first"\r
+\r
+        regexp:subject:"^i am first"\r
+\r
+If we did stick with the current syntax, one could use\r
+\r
+   subject:your-usual-phrase-search\r
+\r
+to preserve phraseness. Note that for regexps with spaces in them, the\r
+required quoting is a bit counterintuitive\r
+\r
+ ./notmuch  count 'subject:"rx:Graduate Committee"'\r
+\r
+That's a consequence of my faking "sub-prefixes". Which seemed clever at\r
+the time, but maybe not.\r
+\r
+d\r