aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-05-08 05:11:50 +0000
committerRichard M. Stallman1997-05-08 05:11:50 +0000
commita2185576ed975b626986c3c7b6056d2aa49f1f70 (patch)
treec090207f5fa6b0352c5df45cc99c76af67c2a572
parenta0cd87a4d63f1971311ecf75c146e1ff7a09ade9 (diff)
downloademacs-a2185576ed975b626986c3c7b6056d2aa49f1f70.tar.gz
emacs-a2185576ed975b626986c3c7b6056d2aa49f1f70.zip
Customize.
(display-time-string-forms): Test display-time-day-and-date and display-time-24hr-format here. (display-time-format): Default value is now nil.
-rw-r--r--lisp/time.el50
1 files changed, 36 insertions, 14 deletions
diff --git a/lisp/time.el b/lisp/time.el
index 0da580afd86..2d52ffb33c5 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -28,28 +28,45 @@
28 28
29;;; Code: 29;;; Code:
30 30
31(defvar display-time-mail-file nil 31(defgroup display-time nil
32 "Display time and load in mode line of Emacs."
33 :group 'modeline
34 :group 'mail)
35
36
37(defcustom display-time-mail-file nil
32 "*File name of mail inbox file, for indicating existence of new mail. 38 "*File name of mail inbox file, for indicating existence of new mail.
33Non-nil and not a string means don't check for mail. nil means use 39Non-nil and not a string means don't check for mail. nil means use
34default, which is system-dependent, and is the same as used by Rmail.") 40default, which is system-dependent, and is the same as used by Rmail."
41 :type '(choice (const :tag "Default" nil)
42 (file :format "%v"))
43 :group 'display-time)
35 44
36;;;###autoload 45;;;###autoload
37(defvar display-time-day-and-date nil "\ 46(defcustom display-time-day-and-date nil "\
38*Non-nil means \\[display-time] should display day and date as well as time.") 47*Non-nil means \\[display-time] should display day and date as well as time."
48 :type 'boolean
49 :group 'display-time)
39 50
40(defvar display-time-timer nil) 51(defvar display-time-timer nil)
41 52
42(defvar display-time-interval 60 53(defcustom display-time-interval 60
43 "*Seconds between updates of time in the mode line.") 54 "*Seconds between updates of time in the mode line."
55 :type 'integer
56 :group 'display-time)
44 57
45(defvar display-time-24hr-format nil 58(defcustom display-time-24hr-format nil
46 "*Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23. 59 "*Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
47Nil means 1 <= hh <= 12, and an AM/PM suffix is used.") 60Nil means 1 <= hh <= 12, and an AM/PM suffix is used."
61 :type 'boolean
62 :group 'display-time)
48 63
49(defvar display-time-string nil) 64(defvar display-time-string nil)
50 65
51(defvar display-time-hook nil 66(defcustom display-time-hook nil
52 "* List of functions to be called when the time is updated on the mode line.") 67 "* List of functions to be called when the time is updated on the mode line."
68 :type 'hook
69 :group 'display-time)
53 70
54(defvar display-time-server-down-time nil 71(defvar display-time-server-down-time nil
55 "Time when mail file's file system was recorded to be down. 72 "Time when mail file's file system was recorded to be down.
@@ -100,13 +117,16 @@ This runs the normal hook `display-time-hook' after each update."
100 'display-time-event-handler)))) 117 'display-time-event-handler))))
101 118
102 119
103(defvar display-time-format nil 120(defcustom display-time-format nil
104 "*A string specifying the format for displaying the time in the mode line. 121 "*A string specifying the format for displaying the time in the mode line.
105See the function `format-time-string' for an explanation of 122See the function `format-time-string' for an explanation of
106how to write this string. If this is nil, the defaults 123how to write this string. If this is nil, the defaults
107depend on `display-time-day-and-date' and `display-time-24hr-format'.") 124depend on `display-time-day-and-date' and `display-time-24hr-format'."
125 :type '(choice (const :tag "Default" nil)
126 string)
127 :group 'display-time)
108 128
109(defvar display-time-string-forms 129(defcustom display-time-string-forms
110 '((if (and (not display-time-format) display-time-day-and-date) 130 '((if (and (not display-time-format) display-time-day-and-date)
111 (format-time-string "%a %b %e " now) 131 (format-time-string "%a %b %e " now)
112 "") 132 "")
@@ -131,7 +151,9 @@ For example, the form
131 (if time-zone \" (\") time-zone (if time-zone \")\") 151 (if time-zone \" (\") time-zone (if time-zone \")\")
132 (if mail \" Mail\" \"\")) 152 (if mail \" Mail\" \"\"))
133 153
134would give mode line times like `94/12/30 21:07:48 (UTC)'.") 154would give mode line times like `94/12/30 21:07:48 (UTC)'."
155 :type 'sexp
156 :group 'display-time)
135 157
136(defun display-time-event-handler () 158(defun display-time-event-handler ()
137 (display-time-update) 159 (display-time-update)