Notmuch-tree add/remove/toggle tag
Mark Walters
markwalters1009 at gmail.com
Tue May 6 04:08:21 PDT 2014
'Mash <subscribe at toshine.net> 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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list