Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (61 sloc) 2.4 KB
;;; wg-gnus-biff.el --- Dead simple Gnus biff
;; Copyright (C) 2012 William Gardella
;; Author: William Gardella <wgg2 at pitt dot edu>;
;; Keywords: comm, mail
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <>.
;;; Commentary:
;;; Code:
(defvar wg/gnus-biff-groups nil
"List of Gnus groups whose unread articles should be tracked
by `wg/gnus-biff'.
Each element of the list should be a string containing the name
of a Gnus group to be tracked. The group names should be spelled
out just as they are in your *Group* buffer when Gnus is
(defun wg/gnus-biff
"Check `wg/gnus-biff-groups' for unread articles.
If used programmatically, return a number if there are unread
articles; otherwise return nil. If used as a command, also print
a nice message for the user in the echo area. This function can
be used as `display-time-mail-function' for putting a mail
notification in the mode line.
TODO/Caveat: Nicer error handling, instead of just wrapping all
Gnus interaction in (ignore-errors)! At the moment, this
function silently ignores all Gnus-related errors (Gnus not
running, `wg/gnus-biff-groups' contains an invalid group, etc.)
and returns nil."
(mapcar 'gnus-list-of-unread-articles wg/gnus-biff-groups)))
(mapcar 'length notreadyet))
(apply '+ notreadyet-subtotal)))
(called-interactively-p 'interactive)
((zerop notreadyet-total)
(message "No unread articles."))
((= 1 notreadyet-total)
(message "You have 1 unread article."))
(message "You have %s unread articles." notreadyet-total)))
(zerop notreadyet-total)
(provide 'wg-gnus-biff)
;;; wg-gnus-biff.el ends here
Jump to Line
Something went wrong with that request. Please try again.