Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created December 5, 2010 06:43
Show Gist options
  • Save bradclawsie/728882 to your computer and use it in GitHub Desktop.
Save bradclawsie/728882 to your computer and use it in GitHub Desktop.
biff for gnus
;; 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment