"*File name of mail inbox file, for indicating existence of new mail.
Default is system-dependent, and is the same as used by Rmail.")
+;;;###autoload
+(defconst display-time-day-and-date nil "\
+*Non-nil means \\[display-time] should display day and date as well as time.")
+
(defvar display-time-process nil)
(defvar display-time-interval 60
(defvar display-time-hook nil
"* List of functions to be called when the time is updated on the mode line.")
+;;;###autoload
(defun display-time ()
"Display current time and load level in mode line of each buffer.
Updates automatically every minute.
(setq display-time-string "")
(setq display-time-process
(start-process "display-time" nil
- "wakeup"
+ (concat exec-directory "wakeup")
(int-to-string display-time-interval)))
(process-kill-without-query display-time-process)
(set-process-sentinel display-time-process 'display-time-sentinel)
(defun display-time-filter (proc string)
(let ((time (current-time-string))
- (load (format "%03d" (car (load-average))))
+ (load (condition-case ()
+ (if (zerop (car (load-average))) ""
+ (format "%03d" (car (load-average))))
+ (error "")))
(mail-spool-file (or display-time-mail-file
(getenv "MAIL")
(concat rmail-spool-directory
(substring load 0 -2) "." (substring load -2)
(if (and (file-exists-p mail-spool-file)
;; file not empty?
- (> (nth 7 (file-attributes mail-spool-file)) 0))
+ (display-time-file-nonempty-p mail-spool-file))
" Mail"
"")))
;; Append the date if desired.
(set-buffer-modified-p (buffer-modified-p))
;; Do redisplay right now, if no input pending.
(sit-for 0))
+
+(defun display-time-file-nonempty-p (file)
+ (while (file-symlink-p file)
+ (setq file (file-symlink-p file)))
+ (> (nth 7 (file-attributes file)) 0))