Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 13C5B429E21 for ; Sun, 8 Jan 2012 20:30:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pQbwquCJDtAS for ; Sun, 8 Jan 2012 20:30:50 -0800 (PST) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 64329431FB6 for ; Sun, 8 Jan 2012 20:30:50 -0800 (PST) X-AuditID: 12074424-b7fae6d000000906-85-4f0a6d7992d5 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 03.14.02310.97D6A0F4; Sun, 8 Jan 2012 23:30:49 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q094UndH016190; Sun, 8 Jan 2012 23:30:49 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q094UlBf021676 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 8 Jan 2012 23:30:48 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rk6sv-000655-NW; Sun, 08 Jan 2012 23:31:01 -0500 Date: Sun, 8 Jan 2012 23:31:01 -0500 From: Austin Clements To: Jameson Graef Rollins , Aaron Ecay Subject: Re: [PATCH 1/4] emacs: new customization variable to exclude "deleted" messages from search Message-ID: <20120109043101.GH20796@mit.edu> References: <1325975294-646-1-git-send-email-jrollins@finestructure.net> <1325975294-646-2-git-send-email-jrollins@finestructure.net> <20120109014938.GE20796@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120109014938.GE20796@mit.edu> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMKsWRmVeSWpSXmKPExsUixG6noluZy+VvsOSWkcW05V/YLfbs87K4 fnMmswOzx93TXB47Z91l93i26hZzAHMUl01Kak5mWWqRvl0CV8b6Pf3sBT+5Kv49v8rUwHif o4uRk0NCwESi4fMaRghbTOLCvfVsXYxcHEIC+xglXi6fzgaSEBJYzyjx4DY3hH2CSWLHCkaI oiWMEjMO/mEHSbAIqEjc+L2DCcRmE9CQ2LZ/OdhUEYFEiV8v/jCD2MwCWhJbN34AiwsLpElc m7oYrJdXQEdi3Y7pTBBDjzNK3D5wnhUiIShxcuYTFohmdYk/8y4BDeIAsqUllv/jgAjLSzRv nQ02n1NAV2Lj9yaw+aJA90w5uY1tAqPwLCSTZiGZNAth0iwkkxYwsqxilE3JrdLNTczMKU5N 1i1OTszLSy3SNdfLzSzRS00p3cQIjgsXlR2MzYeUDjEKcDAq8fAK2HD5C7EmlhVX5h5ilORg UhLllcwGCvEl5adUZiQWZ8QXleakFh9ilOBgVhLhFTADyvGmJFZWpRblw6SkOViUxHk1tN75 CQmkJ5akZqemFqQWwWRlODiUJHj35wA1ChalpqdWpGXmlCCkmTg4QYbzAA0/BFLDW1yQmFuc mQ6RP8WoKCXOOwEkIQCSyCjNg+uFpa1XjOJArwjzbgep4gGmPLjuV0CDmYAGP/jDDjK4JBEh JdXAOLlX6SB/Z4DjJP+YI/fjgnlrKy3/NO1IatpUbre1dAfD4ti/OSbvXq/J6/yZJx5SEGke otNkpi7AJ/Xup8DSyg+3pr3ckKA56cKpivlLHl55nDr1lvOHdz2WO26vPX3/LFNWgRFHsl5S dtdXX7fP1duPzO2L3FN6nmlFsMOnQ97vE98+z929TYmlOCPRUIu5qDgRAK0TccI2AwAA Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 09 Jan 2012 04:30:51 -0000 Quoth myself on Jan 08 at 8:49 pm: > > > @@ -927,6 +932,9 @@ The optional parameters are used as follows: > > > (set 'notmuch-search-target-thread target-thread) > > > (set 'notmuch-search-target-line target-line) > > > (set 'notmuch-search-continuation continuation) > > > + (when (and notmuch-search-exclude-deleted > > > + (not (string-match "tag:deleted[ )]*" query))) > > > > “is:” is a synonym for “tag:” in searches – so this section of the code > > should look for it too. > > There are several other things that could also trip up this regexp. > xtag:deletedx would be falsely matched, as would a quoted phrase > containing "tag:deleted", while tag:"deleted" and tag:(deleted) would > incorrectly not be matched. Getting this right is hard, though I'd be > happy with > > "\\<\\(tag\\|is\\):deleted\\>" > > or maybe > > "\\<\\(tag\\|is\\):\\(\"?\\)deleted\\>\\2" For the record, here's a More Correct (TM) version "\\(^\\|[-+ ()]\\)\\(tag\\|is\\):\\(\"?\\)deleted\\3\\($\\|[ ()]\\)" However, as we discussed on IRC, it's probably better to fix this in the CLI/library by adding a config option for auto-excluded tags, an API to register these with the library (probably part of the query API), and to iterate over the terms in the parsed query to determine which tag exclusions should be automatically added.