Improving spam-tagging keybinding function to act on region in emacs
Mark Walters
markwalters1009 at gmail.com
Tue May 6 09:08:24 PDT 2014
Hello
As this section was rather outdated I have updated to modern notmuch. (In
fact the lisp snippets should work back to at least 0.13)
On Tue, 06 May 2014, Olivier Berger <olivier.berger at telecom-sudparis.eu> wrote:
> Hi.
>
> I've tried tu use the tips indicated at
> http://notmuchmail.org/emacstips/#index8h2 so as to add a keybinding to
> tag spam messages, and wonder if there's a possibility to make it apply
> on selected regions, like what notmuch-search-archive-thread does.
I have added a snippet showing how to do this (and noted that is not
possible in notmuch-tree as we don't have a tag region option there).
> I can achieve the same result using a macro to iterate over lines, but a
> single key press to tag results of a search filter would be quite
> convienent.
>
> And... at the moment, it seems to me that with the current suggested
> lambdas, if one presses 'S' after selecting a whole region results in
> tagging all sorts of messages (all ?) with the spam tag ! :-/
>
>
> Btw, I think that the current examples could be improved by adding a (next-line)
> at the end, like :
> (define-key notmuch-search-mode-map "S"
> (lambda ()
> "mark messages in thread as spam"
> (interactive)
> (notmuch-search-tag '("+spam" "-inbox"))
> (next-line)))
I have left this as it is as this works in search mode, but not show
mode and I didn't want to have too many examples. Obviously feel free to
edit the wiki if you like!
Best wishes
Mark
More information about the notmuch
mailing list