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 38B05431FD0 for ; Sun, 8 Jan 2012 17:49:28 -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 IgZnkpP4tL9a for ; Sun, 8 Jan 2012 17:49:27 -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 BADFB431FB6 for ; Sun, 8 Jan 2012 17:49:27 -0800 (PST) X-AuditID: 12074424-b7fae6d000000906-94-4f0a47a6ecf4 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id A4.3F.02310.6A74A0F4; Sun, 8 Jan 2012 20:49:26 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q091nP4q004806; Sun, 8 Jan 2012 20:49:26 -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 q091nOml006362 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 8 Jan 2012 20:49:25 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rk4Mk-0005xP-SA; Sun, 08 Jan 2012 20:49:38 -0500 Date: Sun, 8 Jan 2012 20:49:38 -0500 From: Austin Clements To: Aaron Ecay Subject: Re: [PATCH 1/4] emacs: new customization variable to exclude "deleted" messages from search Message-ID: <20120109014938.GE20796@mit.edu> References: <1325975294-646-1-git-send-email-jrollins@finestructure.net> <1325975294-646-2-git-send-email-jrollins@finestructure.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsUixG6nrrvMncvf4GGzmsW05V/YLfbs87K4 fnMmswOzx93TXB47Z91l93i26hZzAHMUl01Kak5mWWqRvl0CV8afkzOZCh5wVHyYv4mtgbGN vYuRk0NCwETi/NynULaYxIV769m6GLk4hAT2MUrcWz6HEcJZzyhxpHMnK4Rzgkni75VXUGVL GCU6uv+xgfSzCKhIHH/XxgRiswloSGzbv5wRxBYBis+eNx/MZhZIl7i8fQdYvbBAmsS1qYvB dvMK6Ej8fXWQBW5o29wGRoiEoMTJmU9YIJrVJf7Mu8TcxcgBZEtLLP/HARGWl2jeOpsZxOYE KrnQugrsBlGgvVNObmObwCg8C8mkWUgmzUKYNAvJpAWMLKsYZVNyq3RzEzNzilOTdYuTE/Py Uot0zfVyM0v0UlNKNzGCY8NFZQdj8yGlQ4wCHIxKPLwCNlz+QqyJZcWVuYcYJTmYlER5T7sC hfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwCpgB5XhTEiurUovyYVLSHCxK4rwaWu/8hATSE0tS s1NTC1KLYLIyHBxKErxH3IAaBYtS01Mr0jJzShDSTBycIMN5gIafB6nhLS5IzC3OTIfIn2JU lBLnFQImHyEBkERGaR5cLyx1vWIUB3pFmPcMSDsPMO3Bdb8CGswENPjBH3aQwSWJCCmpBkae 2CM+em/mpFzUf93g/+mlcebWK5O6E07On513msFovYvhPO/wQqmS+PBrUzeFsR4xWpZVuF50 zpm1oW+TLjKfz1xz5e92BeFXltdiH8ld2il3wn3ev7O7uTIulDKV8yVVyazd2LrVXK9Jbom0 +a5+/z25N8v3/ZRZK70pJEhQceEV0R1BSSFKLMUZiYZazEXFiQCJg6x2OAMAAA== 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 01:49:28 -0000 > > @@ -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" Implicit exclusions like this were actually one of my target features for the custom query parser, but I think hacking around that by inspecting the query string is a fine interim solution. (One of these months I'll dust off the query parser, really!)