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 34B636DE1AE1 for ; Sun, 5 Apr 2015 09:23:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -1.932 X-Spam-Level: X-Spam-Status: No, score=-1.932 tagged_above=-999 required=5 tests=[AWL=-0.284, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.55, T_FREEMAIL_FORGED_FROMDOMAIN=0.01, T_HEADER_FROM_DIFFERENT_DOMAINS=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 iWkN1x8WSAIy for ; Sun, 5 Apr 2015 09:23:33 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) by arlo.cworth.org (Postfix) with ESMTPS id E8A696DE1AB2 for ; Sun, 5 Apr 2015 09:23:32 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Yemme-0003mM-D7; Sun, 05 Apr 2015 16:48:27 +0100 Received: from 94.197.113.50.threembb.co.uk ([94.197.113.50] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1Yemmd-000619-2K; Sun, 05 Apr 2015 16:48:24 +0100 From: Mark Walters To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: Added "is:" style completion to notmuch-read-query. In-Reply-To: <1419671907-27170-1-git-send-email-david@tethera.net> References: <1419671907-27170-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Sun, 05 Apr 2015 16:48:18 +0100 Message-ID: <87oan21sql.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.197.113.50 X-QM-Geographic: According to ripencc, this message was delivered by a machine in Britain (UK) (GB). X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 00b8092e82b6d9aa96e143df6b9735b7 (of first 20000 bytes) X-SpamAssassin-Score: -0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain X-QM-Scan-Virus: ClamAV says the message is clean X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 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: Sun, 05 Apr 2015 16:23:36 -0000 Hi > From: Charles Celerier > > The notmuch-search-terms man page states that "tag:" is equivalent > to "is:". Completion for "is:" style searches is now supported > in the Emacs interface. > > Amended by David Bremner: combine lexical-let and let into > lexical-let* This version looks good to me; it works and passes all tests. +1 Note it does not apply to master but only needs a tiny fixup (see below) Best wishes Mark > --- > emacs/notmuch.el | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 218486a..1b6971e 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." > "Read a notmuch-query from the minibuffer with completion. > > PROMPT is the string to prompt with." > - (lexical-let > - ((completions > - (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:" > - "subject:" "attachment:") ^ this line now has a "mimetype:" final option > - (mapcar (lambda (tag) > - (concat "tag:" (notmuch-escape-boolean-term tag))) > - (process-lines notmuch-command "search" "--output=tags" "*"))))) > + (lexical-let* > + ((all-tags > + (mapcar (lambda (tag) (notmuch-escape-boolean-term tag)) > + (process-lines notmuch-command "search" "--output=tags" "*"))) > + (completions > + (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:" > + "subject:" "attachment:") > + (mapcar (lambda (tag) (concat "tag:" tag)) all-tags) > + (mapcar (lambda (tag) (concat "is:" tag)) all-tags)))) > (let ((keymap (copy-keymap minibuffer-local-map)) > (current-query (case major-mode > (notmuch-search-mode (notmuch-search-get-query)) > -- > 2.1.3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch