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 B0521414894 for ; Sun, 8 Jan 2012 17:14:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 38hwOktIDa0R for ; Sun, 8 Jan 2012 17:14:53 -0800 (PST) Received: from mail-gx0-f181.google.com (mail-gx0-f181.google.com [209.85.161.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 96A09414893 for ; Sun, 8 Jan 2012 17:14:53 -0800 (PST) Received: by ggnq2 with SMTP id q2so1905896ggn.26 for ; Sun, 08 Jan 2012 17:14:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:content-transfer-encoding; bh=HThKk9TfWtuR151CuVdOx0fMW3ZwQMfMh37wiMDhfxA=; b=r0Ogzz5LiPQyBbb1xr7CjhIm1xZ8eFCJJwDPW2KSJKWJ9Pjcf2bCyVZFwE9eRJWlYt 0w6FzjeEc3bHZxXg1cpWUyi2SJKTCBKsM0GutSL34YhHLW70OLb8Nm2U5Wp1ljNO6wYz h8HcbelqsGjT3vnvdNPjgnqqPrCE3UICzbv3Q= Received: by 10.100.214.2 with SMTP id m2mr5889959ang.46.1326071693099; Sun, 08 Jan 2012 17:14:53 -0800 (PST) Received: from localhost (c-68-80-94-73.hsd1.pa.comcast.net. [68.80.94.73]) by mx.google.com with ESMTPS id 31sm68739092ant.14.2012.01.08.17.14.51 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 17:14:51 -0800 (PST) From: Aaron Ecay To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 1/4] emacs: new customization variable to exclude "deleted" messages from search In-Reply-To: <1325975294-646-2-git-send-email-jrollins@finestructure.net> References: <1325975294-646-1-git-send-email-jrollins@finestructure.net> <1325975294-646-2-git-send-email-jrollins@finestructure.net> User-Agent: Notmuch/0.10.1+56~gd709fd6 (http://notmuchmail.org) Emacs/24.0.92.3 (i386-apple-darwin10.8.0) Date: Sun, 08 Jan 2012 20:14:49 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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:14:55 -0000 Jameson, One comment On Sat, 7 Jan 2012 14:28:11 -0800, Jameson Graef Rollins wrote: > The new customization variable, notmuch-search-exclude-deleted, when > set to t, will exclude any messages with the "deleted" tag from > searches. >=20 > Additionally, specifying "tag:deleted" in the search directly will > override the exclusion and will included deleted messages in the > search results. > --- > emacs/notmuch.el | 8 ++++ > test/emacs | 42 ++++++++++++++= ++++++ > .../notmuch-search-tag-inbox-deleted-excluded | 24 +++++++++++ > 3 files changed, 74 insertions(+), 0 deletions(-) > create mode 100644 test/emacs.expected-output/notmuch-search-tag-inbox-d= eleted-excluded >=20 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index fde2377..c519687 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -905,6 +905,11 @@ PROMPT is the string to prompt with." > (read-from-minibuffer prompt nil keymap nil > 'notmuch-query-history nil nil)))) >=20=20 > +(defcustom notmuch-search-exclude-deleted nil > + "Exclude deleted messages (with \"deleted\" tag) from search results." > + :group 'notmuch > + :type 'boolean) > + > ;;;###autoload > (defun notmuch-search (query &optional oldest-first target-thread target= -line continuation) > "Run \"notmuch search\" with the given query string and display result= s. > @@ -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))) =E2=80=9Cis:=E2=80=9D is a synonym for =E2=80=9Ctag:=E2=80=9D in searches = =E2=80=93 so this section of the code should look for it too. --=20 Aaron Ecay