unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* time.el and display-time-mail-function
@ 2005-09-07 16:24 Jason Bastek
  2005-09-08 17:00 ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Bastek @ 2005-09-07 16:24 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-09 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-07 16:24 time.el and display-time-mail-function Jason Bastek
2005-09-08 17:00 ` Richard M. Stallman
2005-09-08 20:53   ` Jason Bastek
2005-09-09 12:50     ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).