info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Gnus Biff


From: William Gardella
Subject: A Gnus Biff
Date: Fri, 28 Sep 2012 17:58:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Hey,

I'm in the process of writing a simple "biff" for Gnus, to notify me if
one or more of a list of designated Gnus groups has unread messages in
it (see below).  So far it crudely works, and is suitable for use
interactively or by `display-time-mail-function' if you want "Mail" to
appear in the mode line for Gnus messages instead of mails in your local
mailspool.  What it doesn't have as yet, as you'll see, is very good
error handling.

I get my data from the function `gnus-list-of-unread-articles' which
I've just ham-fistedly wrapped in an (ignore-errors ...) form.  This
makes it silent enough to be suitable for use on a timer, e.g. with
display-time, but it means that if a group name is invalid, the whole
thing just returns nil as though there was no message in any group.
Also, the way I've done it, if this is loaded by display-time in your
initialization file, it will try to check (of course!).  But in doing
so, it doesn't fully start up Gnus.  It enters some sort of nether
state, where it checks my ~/.authinfo.gpg and makes some IMAP+NNTP
connections, but there's no *Group* buffer, and the function continues
to return nil until Gnus is actually started.

Is there a function or variable I could use as a condition to determine
whether Gnus is actually "running?"  Eval-after-load is probably not
quite right, because Gnus is not exactly a normal Elisp package, and
it's not that I need some function to be available--it's that the group
data hasn't been populated yet until Gnus is running.  I also considered
using the variable `gnus-demon-timers' as a condition, since the daemon
timers are started when gnus starts/restarts and removed when it exits,
and someone who wants a biff probably does use gnus-demon for periodic
message checking.  Is that a kludge?  Is there a better way to check the
status of Gnus?

Thanks in advance for your thoughts,
WGG

Attachment: wg-gnus-biff.el
Description: application/emacs-lisp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]