aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-05 06:04:35 +0000
committerRichard M. Stallman1998-01-05 06:04:35 +0000
commite4191987516d37563610bc014a1723f6bbf30550 (patch)
treef5b42f87d444534139b3ca3b6102da9f6d7ef00f
parent79f6bf6a93e9da61d1f05b53bfd4ea7fa26b2d27 (diff)
downloademacs-e4191987516d37563610bc014a1723f6bbf30550.tar.gz
emacs-e4191987516d37563610bc014a1723f6bbf30550.zip
(display-time-mode): Set the variable display-time-mode.
(display-time-mode): New customize variable to automatically load the package.
-rw-r--r--lisp/time.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/time.el b/lisp/time.el
index ad94c2c4fab..9c405c2a1aa 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -34,6 +34,17 @@
34 :group 'mail) 34 :group 'mail)
35 35
36 36
37(defcustom display-time-mode nil
38 "Toggle display of time, load level, and mail flag in mode lines.
39You must modify via \\[customize] for this variable to have an effect."
40 :set (lambda (symbol value)
41 (display-time-mode (or value 0)))
42 :initialize 'custom-initialize-default
43 :type 'boolean
44 :group 'display-time
45 :require 'time)
46
47
37(defcustom display-time-mail-file nil 48(defcustom display-time-mail-file nil
38 "*File name of mail inbox file, for indicating existence of new mail. 49 "*File name of mail inbox file, for indicating existence of new mail.
39Non-nil and not a string means don't check for mail. nil means use 50Non-nil and not a string means don't check for mail. nil means use
@@ -95,6 +106,7 @@ This runs the normal hook `display-time-hook' after each update."
95 (let ((on (if (null arg) 106 (let ((on (if (null arg)
96 (not display-time-timer) 107 (not display-time-timer)
97 (> (prefix-numeric-value arg) 0)))) 108 (> (prefix-numeric-value arg) 0))))
109 (setq display-time-mode on)
98 (and display-time-timer (cancel-timer display-time-timer)) 110 (and display-time-timer (cancel-timer display-time-timer))
99 (setq display-time-timer nil) 111 (setq display-time-timer nil)
100 (setq display-time-string "") 112 (setq display-time-string "")
@@ -241,6 +253,9 @@ would give mode line times like `94/12/30 21:07:48 (UTC)'."
241 (and (file-exists-p file) 253 (and (file-exists-p file)
242 (< 0 (nth 7 (file-attributes (file-chase-links file)))))) 254 (< 0 (nth 7 (file-attributes (file-chase-links file))))))
243 255
256(if display-time-mode
257 (display-time-mode t))
258
244(provide 'time) 259(provide 'time)
245 260
246;;; time.el ends here 261;;; time.el ends here