On Sat, Jan 16, 2021 at 08:53:57PM +0100, Rene Kita wrote:
From: Rene Kita <g...@rkta.de>-nonotify allows to disable notifications for mailboxes. -notify can be used to re-enable notifications for a previously disabled mailbox. A typical use case are mailboxes for mailing lists. The User may want to get notified about new mail in their work mailbox, but not get disrupted by new mail received from the mailing list. This patch allows individual configuration for all mailboxes.
TLDR: I will commit with the man page formatting issue, but would appreciate help from any man-page gurus here. Rene, I do have a comment below in the patch.
Rene posted this as a personal patch on irc, but I asked him to send it here (along with a few cleanup requests).
At first, it may not be clear why this flag might be wanted, so let me add some explanation. The issue is that 'mailboxes' has multiple uses in Mutt:
1. it controls folders listed in the sidebar and mailbox browser 2. it declares mailboxes that Mutt should scan for new mail (or other stats, if $mail_check_stats is set) 3. it declares mailboxes that Mutt should notify of new mailIn this case, Rene would like some mailboxes to show "N" in the sidebar and mailbox browser, but doesn't want Mutt to actively notify him for *all* of those mailboxes.
The existing -nopoll flag completely disables mail checking, allowing the #1 usage but simultaneously disabling #2 and #3. The new -nonotify flag would allow polling (#2) and turn off #3 for those mailboxes. I think this is generally useful to some folks. I haven't applied and tested yet, so I may have more comments later today:
diff --git a/buffy.c b/buffy.c index cfb163bf..f86443f4 100644 --- a/buffy.c +++ b/buffy.c @@ -421,7 +429,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, union pointer_long_t udata, } else mutt_buffy_add (mutt_b2s (mailbox), label_set ? mutt_b2s (label) : NULL, - nopoll); + nopoll, nonotify); mutt_buffer_clear (mailbox); mutt_buffer_clear (label); @@ -766,6 +774,8 @@ int mutt_buffy_check (int force) if (!tmp->new) tmp->notified = 0; + if (tmp->nonotify) + tmp->notified = 1; else if (!tmp->notified) BuffyNotify++; }
This should be something like: if (!tmp->new) tmp->notified = 0; else { /* pretend we've already notified for the mailbox */ if (tmp->nonotify) tmp->notified = 1; else if (!tmp->notified) BuffyNotify++; }otherwise, (!tmp->new) would end up incrementing BuffyNotify when (!tmp->nonotify && !tmp->notified).
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature