From: 'Mash Date: Tue, 6 May 2014 10:39:31 +0000 (+0100) Subject: Notmuch-tree add/remove/toggle tag X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7359e85d4394b6e7d313f941fc0ad36e8cd1bea1;p=notmuch-archives.git Notmuch-tree add/remove/toggle tag --- diff --git a/32/5a9a48e7a77540d53b04702e1dbeb6c4a48e38 b/32/5a9a48e7a77540d53b04702e1dbeb6c4a48e38 new file mode 100644 index 000000000..aacaaf0ef --- /dev/null +++ b/32/5a9a48e7a77540d53b04702e1dbeb6c4a48e38 @@ -0,0 +1,101 @@ +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 191DB431FDA + for ; Tue, 6 May 2014 03:46:54 -0700 (PDT) +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 hrTEm7sfAABx for ; + Tue, 6 May 2014 03:46:46 -0700 (PDT) +X-Greylist: delayed 433 seconds by postgrey-1.32 at olra; + Tue, 06 May 2014 03:46:45 PDT +Received: from fallback-in2.mxes.net (fallback-out2.mxes.net [216.86.168.191]) + by olra.theworths.org (Postfix) with ESMTP id F0AA2431FD6 + for ; Tue, 6 May 2014 03:46:45 -0700 (PDT) +Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) + by fallback-in1.mxes.net (Postfix) with ESMTP id 2A6892FD7AD + for ; Tue, 6 May 2014 06:39:32 -0400 (EDT) +Received: from wm1.irbs.net (wm1.irbs.net [216.86.168.168]) + by smtp.mxes.net (Postfix) with ESMTP id 72C1250A73 + for ; Tue, 6 May 2014 06:39:31 -0400 (EDT) +Received: from localhost (wm1.irbs.net [216.86.168.168]) + by wm1.irbs.net (Postfix) with ESMTPA id 540634FE2B1 + for ; Tue, 6 May 2014 06:39:31 -0400 (EDT) +Received: from lon.namesco.net (lon.namesco.net [195.7.254.102]) by + webmail.tuffmail.net (Horde Framework) with HTTP; + Tue, 06 May 2014 11:39:31 +0100 +Message-ID: <20140506113931.75041t5v5q33pvr4@webmail.tuffmail.net> +Date: Tue, 06 May 2014 11:39:31 +0100 +From: 'Mash +To: notmuch@notmuchmail.org +Subject: Notmuch-tree add/remove/toggle tag +MIME-Version: 1.0 +Content-Type: text/plain; + charset=ISO-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable +User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.0) +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 10:46:54 -0000 + +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": =20 +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" =20 +and "notmuch-show-get-tags" respectively in the "add a toggle =20 +"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")))) + +The problem is that in notmuch-tree when I get the following message: =20 +"Entering debugger... button-at: Args out of range: 0" and the tag =20 +fails to be toggled. + +Not quite sure where I am going wrong here? + +Thanks, + +