From: Gaute Hope Date: Sat, 11 Jun 2016 17:34:18 +0000 (+0000) Subject: Re: [PATCH] WIP: regexp matching in 'subject' and 'from' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7554ecd25a439b06e89119e3f9cdb8d0e31a1651;p=notmuch-archives.git Re: [PATCH] WIP: regexp matching in 'subject' and 'from' --- diff --git a/8e/e30789937cbeb1554741a0f96fe1881e6d1682 b/8e/e30789937cbeb1554741a0f96fe1881e6d1682 new file mode 100644 index 000000000..fce23063c --- /dev/null +++ b/8e/e30789937cbeb1554741a0f96fe1881e6d1682 @@ -0,0 +1,120 @@ +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 C99756DE01C2 + for ; Sat, 11 Jun 2016 10:34:31 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.565 +X-Spam-Level: +X-Spam-Status: No, score=-0.565 tagged_above=-999 required=5 tests=[AWL=0.155, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 p0F5eVkCgjeh for ; + Sat, 11 Jun 2016 10:34:24 -0700 (PDT) +Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com + [74.125.82.45]) by arlo.cworth.org (Postfix) with ESMTPS id 7E4006DE01BE for + ; Sat, 11 Jun 2016 10:34:23 -0700 (PDT) +Received: by mail-wm0-f45.google.com with SMTP id n184so28276863wmn.1 + for ; Sat, 11 Jun 2016 10:34:23 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623; + h=date:from:subject:to:cc:references:in-reply-to:user-agent + :message-id:mime-version:content-transfer-encoding; + bh=3BWrb6KhiigNniko+Rcyy3yVbGdB+pbvHQrHqruAOns=; + b=zRHIhYAcUQOtxWhQtun7X/FAkdr0tzK3sYALumyl4pgsq/IvwDYm2IvQMYn3AcbaCb + JqBtYQQhGX1u5KB0EGttRH+LCgLxmYJb0X7+n8gX9IWFITmr8+Y8zOhxPz+mixl5Vml6 + udnwbMfVqYrTq8mIcA7mxg1/adJVJl0OnegAyirINH+QaLrixzHJNRBjAXvzARFUEJwQ + b4BSl0nIKoj4VQuyyLbqsUnHpB5k3wg8wjmZF++ysxNz3VelblyIbpSvH2Ii1CJ0r/00 + T3Caj8kpDIzS1KxyN4Qfs0d2XhqPEdeeL424e0uaYhUQoLCuHF8uFgwVYLHg0d9jWB7h + 94Kg== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to + :user-agent:message-id:mime-version:content-transfer-encoding; + bh=3BWrb6KhiigNniko+Rcyy3yVbGdB+pbvHQrHqruAOns=; + b=acwYMVNYccWsuL5yJbZ0fbDg565rkJ3UuTpHmj6aRdNHZoYa3aBxDccs13ihySI+4l + kOWYmuPx6J1DFhy4mLs9HrmMpPFlciAK13/1CT4+1G+fIbC/MAkKArGfqzMNRb2DxZhN + XEzz9zTgZqLAOhZb/FoKJxNIDDDOjs2sEAKMwc6tXgSQ541w0DIO4d1Vt/1YaxCwac7h + 03U9bANi2QS3NE/A9CizD6GNk2OpCfMSnFRIF5sUbjSUFTXU2fJmSuRVYx5eOZPC2e3v + PSAEl4EWhKYzPL8FFGZWATeR+WxEPulOEueJJxFiiarIxk9eqNeic8Mj+YQ+8/xwPW8N + Arng== +X-Gm-Message-State: + ALyK8tIi8esYnQP90dAuj8NGH3msAtErAbcRkJZnD8C4HeTmPwJBvJnxjR3Orir+42emNQ== +X-Received: by 10.194.133.135 with SMTP id pc7mr7314542wjb.49.1465666461824; + Sat, 11 Jun 2016 10:34:21 -0700 (PDT) +Received: from localhost (241.89-20-241.enivest.net. [89.20.241.241]) + by smtp.gmail.com with ESMTPSA id k127sm5047077wmf.21.2016.06.11.10.34.20 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sat, 11 Jun 2016 10:34:20 -0700 (PDT) +Date: Sat, 11 Jun 2016 17:34:18 +0000 +From: Gaute Hope +Subject: Re: [PATCH] WIP: regexp matching in 'subject' and 'from' +To: Tomi Ollila , David Bremner , + Austin Clements +Cc: notmuch +References: <1465265149-7174-1-git-send-email-david@tethera.net> + <1465525688-30913-1-git-send-email-david@tethera.net> + <1465547660-astroid-0-nudmv20lbk-1296@strange> + <87a8itxpu7.fsf@zancas.localnet> + <1465662533-astroid-3-6vuqm3zu54-1296@strange> + +In-Reply-To: +User-Agent: astroid/v0.5-221-g4c2c7173 (https://github.com/gauteh/astroid) +Message-Id: <1465666155-astroid-5-8srklogp6e-1296@strange> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Transfer-Encoding: quoted-printable +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Sat, 11 Jun 2016 17:34:31 -0000 + +Tomi Ollila writes on juni 11, 2016 19:09: +> On Sat, Jun 11 2016, Gaute Hope wrote: +>> Maybe we could check if the search string contains a regexp and decide +>> whether to pre-process it on the background of that? I think that would +>> make the interface more user-friendly. You'd just always use search +>> whether you decide that you need to put in some regexp or not. +>=20 +> You probably wanted to suggest that the command line handling in notmuch +> goes through the search terms and potentially modify it before giving +> to xapian to chew for... I think this is deliberately avoided (*) -- this +> would get out of hands so easily (if we could decide syntax)... +>=20 +> (*) there is some optmization done before feeding the query to xapian -- +> but that does not affect interface (i.e. it could be dropped and none of +> the users' expectations would be broken...) +>=20 +> What one can do, is write ones own wrapper around notmuch. I have one +> that was written long before notmuch got date: searches (it mangles +> e.g 5h.. to 1234567890.. (**) and logs search and show queries +> (**) should change that to use date:... instead (i.e. date: queries w/o +> date: prefix). I "suggested" subject:/one's own subject re search w// sla= +shes/ +> which one could pretty easily write to the wrapper... +>=20 + +Yes, that is pretty much what I meant. So that the user only needs +to know about 'search:', if it is 'search:foo' regular queryparser is +used, if it is 'search:/^foo/' it is preprocessed using the regexp +parser. Then the performance will remain the same for normal queries, +but seamlessly switch to the heavier regexp'er if necessary. + +It could be done with a wrapper, but I am mainly using notmuch through +the API and astroid - where it could also be implemented of course. + +-gaute +=