emacs-devel
[Top][All Lists]
Advanced

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

time.el and display-time-mail-function


From: Jason Bastek
Subject: time.el and display-time-mail-function
Date: Wed, 7 Sep 2005 12:24:27 -0400 (EDT)

Hello,

Recently I tried to write a custom display-time-mail-function, as
provided for in time.el (my mail system was being converted from mbox
to maildir++ format, so I had to check for the existence of files in a
directory, rather than for the existence of a single file).

However I think there's a problem in the logic in time.el.  In
function display-time-update, it has the following:

         (mail (or (and display-time-mail-function
                        (funcall display-time-mail-function))
                   (and (stringp mail-spool-file)

where display-time-mail-function is a user-definable function, which
seems like the perfect thing for my situation.  The problem is the
"or" -- if my display-time-mail-function returns nil (to indicate that
there is no new mail), instead of stopping there, it will continue
with the standard mail-spool-file check.

I believe this logic is wrong, and it could be fixed by changing the
"or" to a "cond"/"if", e.g.:

         (mail (if display-time-mail-function
                   (funcall display-time-mail-function)
                 (and (stringp mail-spool-file)

Does this seem like a reasonable change to make?  It seems that,
without this change, display-time-mail-function is useless.  But maybe
I'm missing some aspect.

Thanks,

-Jason




reply via email to

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