aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-01-07 14:19:23 +0000
committerDave Love2000-01-07 14:19:23 +0000
commitf6e556e9b38e6bd905f4765b09012fa2016cfb63 (patch)
tree6e16d4bf2bfb0a398c31560f5121a4436cf8675a
parentdfdabcf9df0113511cecbeb04c3694da815753ab (diff)
downloademacs-f6e556e9b38e6bd905f4765b09012fa2016cfb63.tar.gz
emacs-f6e556e9b38e6bd905f4765b09012fa2016cfb63.zip
(display-time-string-forms): Make the Mail string active.
(display-time-update): Provide help-echo for load average.
-rw-r--r--lisp/time.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/time.el b/lisp/time.el
index 17a215b30ca..5b293f295ef 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -1,6 +1,6 @@
1;;; time.el --- display time and load in mode line of Emacs. 1;;; time.el --- display time and load in mode line of Emacs.
2 2
3;; Copyright (C) 1985, 86, 87, 93, 94, 1996 Free Software Foundation, Inc. 3;; Copyright (C) 1985, 86, 87, 93, 94, 96, 2000 Free Software Foundation, Inc.
4 4
5;; Maintainer: FSF 5;; Maintainer: FSF
6 6
@@ -142,14 +142,20 @@ depend on `display-time-day-and-date' and `display-time-24hr-format'."
142 :group 'display-time) 142 :group 'display-time)
143 143
144(defcustom display-time-string-forms 144(defcustom display-time-string-forms
145 '((if (and (not display-time-format) display-time-day-and-date) 145 `((if (and (not display-time-format) display-time-day-and-date)
146 (format-time-string "%a %b %e " now) 146 (format-time-string "%a %b %e " now)
147 "") 147 "")
148 (format-time-string (or display-time-format 148 (format-time-string (or display-time-format
149 (if display-time-24hr-format "%H:%M" "%-I:%M%p")) 149 (if display-time-24hr-format "%H:%M" "%-I:%M%p"))
150 now) 150 now)
151 load 151 load
152 (if mail " Mail" "")) 152 (if mail ,(propertize " Mail"
153 'help-echo "mouse-2: Read mail"
154 'local-map (make-mode-line-mouse2-map
155 (lambda (e)
156 (interactive "e")
157 (funcall read-mail-command))))
158 ""))
153 "*A list of expressions governing display of the time in the mode line. 159 "*A list of expressions governing display of the time in the mode line.
154For most purposes, you can control the time format using `display-time-format' 160For most purposes, you can control the time format using `display-time-format'
155which is a more standard interface. 161which is a more standard interface.
@@ -204,8 +210,12 @@ would give mode line times like `94/12/30 21:07:48 (UTC)'."
204 (time (current-time-string now)) 210 (time (current-time-string now))
205 (load (condition-case () 211 (load (condition-case ()
206 (if (zerop (car (load-average))) "" 212 (if (zerop (car (load-average))) ""
213 ;; The load average number is myterious, so
214 ;; propvide some help.
207 (let ((str (format " %03d" (car (load-average))))) 215 (let ((str (format " %03d" (car (load-average)))))
208 (concat (substring str 0 -2) "." (substring str -2)))) 216 (propertize
217 (concat (substring str 0 -2) "." (substring str -2))
218 'help-echo "Load average")))
209 (error ""))) 219 (error "")))
210 (mail-spool-file (or display-time-mail-file 220 (mail-spool-file (or display-time-mail-file
211 (getenv "MAIL") 221 (getenv "MAIL")