Added ability to exclude gnus groups from unread count

This commit is contained in:
Morgan Smith 2020-04-24 18:55:18 -04:00
parent 96350f6f81
commit 5090426eb2
No known key found for this signature in database
GPG key ID: 52D93416EEAA45A6
2 changed files with 8 additions and 1 deletions

View file

@ -360,6 +360,12 @@ If nil, don't set up a hook."
:type 'integer
:group 'doom-modeline)
(defcustom doom-modeline-gnus-excluded-groups nil
"A list of groups to be excluded from the unread count."
:type '(repeat string)
:group 'doom-modeline)
(defcustom doom-modeline-irc t
"Whether display the irc notifications.

View file

@ -2149,7 +2149,8 @@ mouse-1: Toggle Debug on Quit"
(let* ((group (car g))
;; `gnus-group-unread' is a macro
(unread (car (gethash group gnus-newsrc-hashtb))))
(when (and (numberp unread)
(when (and (not (seq-contains-p doom-modeline-gnus-excluded-groups group))
(numberp unread)
(> unread 0))
(setq total-unread-news-number (+ total-unread-news-number unread)))))
gnus-newsrc-alist)