Notmuch-tree add/remove/toggle tag

'Mash subscribe at toshine.net
Tue May 6 04:18:19 PDT 2014


Quoting Mark Walters <markwalters1009 at gmail.com>:

> '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

Excellent!

Many thanks for your quick response.

I am attempting to move from > 8 years of using Mutt in an Emacs Term  
to Notmuch. Slow going so far, especially trying to get the workflow  
sorted. (The reason for the move is Mutt in Emacs24 Term is  
horrifically sluggish for some reason I am yet to discover.)

I need to investigate a keybinding to go straight to notmuch-tree now.

Thanks again,



More information about the notmuch mailing list