unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Notmuch-tree add/remove/toggle tag
@ 2014-05-06 10:39 'Mash
  2014-05-06 11:08 ` Mark Walters
  0 siblings, 1 reply; 3+ messages in thread
From: 'Mash @ 2014-05-06 10:39 UTC (permalink / raw)
  To: notmuch

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"))))

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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-06 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 10:39 Notmuch-tree add/remove/toggle tag 'Mash
2014-05-06 11:08 ` Mark Walters
2014-05-06 11:18   ` 'Mash

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).