i spend most of my time in emacs. i like the idea that i can replicate my emacs environment in xmonad or the console. one feature i have always wanted integrated in to gnus is a "biff"-like notifier. i decided to hack one up myself since i could not find an existing solution.
previously i used an external imap polling script to determine the availability of new mail, but gnus is already doing this, i figured that there had to be some local state it was modifying to display the gnus folder listing itself. oddly enough i was unable to locate a simple emacs environment var to check, so i simply decided to write an elisp function that regexes the Group buffer after gnus has polled my imap server, and check to see of INBOX.ALL (my inbox subfolder) had new mail in it. should this be the case, i simply add a "M" to my status line. code from my .gnus.el file is below:
;; biff
(defvar foundnewmbox "")
(defun fmbiff ()
(interactive)
(save-excursion
(set-buffer "*Group*")
(beginning-of-buffer)
(defvar foundanymbox nil)
(cond ((re-search-forward "INBOX.ALL" nil t)
(setq foundanymbox t))
(t (setq foundanymbox nil)))
(set-buffer "*Group*")
(beginning-of-buffer)
(cond ((re-search-forward "0: INBOX.ALL" nil t)
(setq foundnewmbox ""))
(t (if foundanymbox (setq foundnewmbox "[M]")
(setq foundnewmbox ""))))))
(unless (member 'foundnewmbox global-mode-string)
(setq global-mode-string (append global-mode-string
(list 'foundnewmbox))))
(add-hook 'gnus-after-getting-new-news-hook 'fmbiff)
(add-hook 'gnus-group-mode-hook 'fmbiff)
;; some shortcuts
(global-set-key (kbd "C-c i") 'fmbiff)
last update 08/09/2008