Re: notmuch and "mute" -- useful to anyone?

Subject: Re: notmuch and "mute" -- useful to anyone?

Date: Tue, 02 Aug 2016 20:28:38 +0100

To: Matt Armstrong

Cc: notmuch@notmuchmail.org

From: Amadeusz Żołnowski


This seems to be something that https://github.com/teythoon/afew already
does, although it uses tag 'killed' instead. I think that alot e-mail
client uses 'killed' tag as well. Maybe you could consider having that
name instead or make it configurable with 'killed' as default?

Cheers,

-- Amadeusz Żołnowski

Matt Armstrong <marmstrong@google.com> writes:

> Is anyone else interested in Gmail-like "mute" support in notmuch.el?
> If so, I can think about polishing the below off and adding it to
> notmuch.
>
> I've managed to implement Gmail's "mute" in notmuch as follows in my
> notmuch-post-new:
>
> ----------------------------------------------------------------------
> # Unmute all threads with new messages sent to me.
> notmuch search --output=threads tag:new AND tag:me | \
>   xargs --no-run-if-empty notmuch tag -muted --
>
> # Remove all muted threads from the inbox and mark every message in them
> # muted.  Ideally this would be atomic with the above.
> notmuch search --output=threads tag:muted | \
>   xargs --no-run-if-empty notmuch tag -inbox +muted --
> ----------------------------------------------------------------------
>
> Then in .emacs:
>
> ----------------------------------------------------------------------
> (defcustom my-notmuch-mute-tags '("+muted" "-inbox")
>   "List of tag changes to apply to a message or a thread when it is muted.
>
> Tags starting with \"+\" (or not starting with either \"+\" or
> \"-\") in the list will be added, and tags starting with \"-\"
> will be removed from the message or thread being archived.
>
> For example, if you wanted to remove an \"inbox\" tag and add an
> \"archived\" tag, you would set:
>     (\"-inbox\" \"+archived\")"
>   :type '(repeat string)
>   :group 'notmuch-search
>   :group 'notmuch-show)
>
> ;; TODO: consider defadvice?
> (defun my-notmuch-search-mute-thread (&optional unarchive beg end)
>   "Mute the currently selected thread or region.
>
> Mute  each message in the currently selected thread by applying the
> tag changes in `my-notmuch-mute-tags' to each (remove the \"inbox\"
> tag by default). If a prefix argument is given, the messages will
> be \"unarchived\" (i.e. the tag changes in `my-notmuch-mute-tags'
> will be reversed).
>
> This function advances the next thread when finished."
>   (interactive (cons current-prefix-arg (notmuch-search-interactive-region)))
>   (let ((notmuch-archive-tags my-notmuch-mute-tags))
>     (notmuch-search-archive-thread unarchive beg end)))
>
> (defun my-notmuch-show-mute-thread-then-next ()
>   (interactive)
>   "Mute all messages in the current buffer, then show next thread from search."
>   (let ((notmuch-archive-tags my-notmuch-mute-tags))
>     (notmuch-show-archive-thread-then-next)))
>
> (define-key notmuch-search-mode-map "m" 'my-notmuch-search-mute-thread)
> (define-key notmuch-show-mode-map "m" 'my-notmuch-show-mute-thread-then-next)
> ----------------------------------------------------------------------
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
signature.asc (application/pgp-signature)

Thread: