tags:

views:

467

answers:

1

I am using Gnus within Emacs as my mail client. I have my .gnus.el configured to check for mail periodically [1] but, right now, I have no way of knowing if I have received new mail short of switching to the Group buffer. I would like to receive some type of notification when I have new mail in a specific group or groups. I found gnus-notify.el [2] but I have been unsuccessful in getting it to work (admittedly probably due to my lack of understanding as to how to configure it properly - I am new to Emacs and Gnus). Can anyone provide the steps I need to take to get gnus-notify working correctly or provide another way to get some type of new mail indicator using Gnus?

[1]

(gnus-demon-add-handler 'gnus-group-get-new-news 2 t)
(gnus-demon-init)

[2] http://www.emacswiki.org/cgi-bin/wiki/gnus-notify.el

+2  A: 

There's some extra detail here:

http://www.emacswiki.org/emacs/GnusBiff

If you're on a mac, you can probably just use the growlnotify command to get a nice alert of new mail. The updated mac-biff-update function would probably look something like this:

(defun mac-biff-update ()
  "Read the mail count from Gnus."
  (let ((buffer (get-buffer "*Group*"))
        (count 0))
    (when buffer
      (with-current-buffer buffer
        (goto-char (point-min))
        (while (re-search-forward mac-biff-mail-re nil t)
          (setq count (+ count (string-to-number (match-string 1)))))))
    (if (> count 0)
       (shell-command
      (format "/usr/local/bin/growlnotify -a Emacs.app -m 'You have %d new messages!'" count)))))

The growlnotify command is an optional package that can be installed from the full growl .dmg file.

zpinter
Nice. I was able to get growl notifications working with the above code and some help from the emacswiki page. Thanks.
Ryan E