From: Mark Walters Date: Tue, 6 May 2014 11:08:21 +0000 (+0100) Subject: Re: Notmuch-tree add/remove/toggle tag X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8539928388ecc2b5b9413cf9cc50a2150a2b39f0;p=notmuch-archives.git Re: Notmuch-tree add/remove/toggle tag --- diff --git a/1d/905236f0de753184c9c8490f50f852ed933bc4 b/1d/905236f0de753184c9c8490f50f852ed933bc4 new file mode 100644 index 000000000..090e67e07 --- /dev/null +++ b/1d/905236f0de753184c9c8490f50f852ed933bc4 @@ -0,0 +1,134 @@ +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 14F79431FDC + for ; Tue, 6 May 2014 04:08:37 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.502 +X-Spam-Level: +X-Spam-Status: No, score=0.502 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, 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 7vrP7idlSLw8 for ; + Tue, 6 May 2014 04:08:29 -0700 (PDT) +Received: from mail1.qmul.ac.uk (mail1.qmul.ac.uk [138.37.6.7]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5C5C3431FD6 + for ; Tue, 6 May 2014 04:08:29 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail1.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1WhdEU-00010G-J6; Tue, 06 May 2014 12:08:25 +0100 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1WhdEU-0002Uq-Bq; Tue, 06 May 2014 12:08:22 +0100 +From: Mark Walters +To: 'Mash , notmuch@notmuchmail.org +Subject: Re: Notmuch-tree add/remove/toggle tag +In-Reply-To: <20140506113931.75041t5v5q33pvr4@webmail.tuffmail.net> +References: <20140506113931.75041t5v5q33pvr4@webmail.tuffmail.net> +User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Tue, 06 May 2014 12:08:21 +0100 +Message-ID: <87oazbcggq.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 87.81.223.162 +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: e4f0e751e2b5cce1bca23ace15e3e240 (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +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.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Tue, 06 May 2014 11:08:37 -0000 + +'Mash writes: + +> I am trying to setup a tag toggle to be used in the Notmuch-tree. +> +> I referred to "Add a key binding to add/remove/toggle a tag": +> http://notmuchmail.org/emacstips/#index8h2 +> +> Looking at "notmuch-tree.el" I noticed +> +> (defun notmuch-tree-get-tags () +> "Return the tags of the current message." +> (notmuch-tree-get-prop :tags)) +> +> and +> +> (defun notmuch-tree-tag (tag-changes) +> "Change tags for the current message" +> (interactive +> (list (notmuch-read-tag-changes (notmuch-tree-get-tags) "Tag message"))) +> (notmuch-tag (notmuch-tree-get-message-id) tag-changes) +> (notmuch-tree-tag-update-display tag-changes)) +> +> Which in my mind would be substituted for "notmuch-show-tag-message" +> and "notmuch-show-get-tags" respectively in the "add a toggle +> "deleted" key" example. +> +> (define-key notmuch-tree-mode-map "d" +> (lambda () +> "toggle deleted tag for message" +> (interactive) +> (notmuch-tree-tag +> (if (member "deleted" (notmuch-tree-get-tags)) +> "-deleted" "+deleted")))) + +Hi + +I think you want + + (if (member "deleted" (notmuch-tree-get-tags)) + (list "-deleted") + (list "+deleted"))))) + +at the end. It looks like the wiki could do some tidying, which I will +try and have a look at at some point. + +Best wishes + +Mark + +> +> The problem is that in notmuch-tree when I get the following message: +> "Entering debugger... button-at: Args out of range: 0" and the tag +> fails to be toggled. +> +> Not quite sure where I am going wrong here? +> +> Thanks, +> +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch