Mercurial > emacs
comparison lisp/time.el @ 20583:c2510bf630e4
(display-time-mode): Set the variable display-time-mode.
(display-time-mode): New customize variable to
automatically load the package.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 05 Jan 1998 06:04:35 +0000 |
parents | 31fbf3a289c1 |
children | 808ecc2eaa84 |
comparison
equal
deleted
inserted
replaced
20582:3b630b1cb848 | 20583:c2510bf630e4 |
---|---|
30 | 30 |
31 (defgroup display-time nil | 31 (defgroup display-time nil |
32 "Display time and load in mode line of Emacs." | 32 "Display time and load in mode line of Emacs." |
33 :group 'modeline | 33 :group 'modeline |
34 :group 'mail) | 34 :group 'mail) |
35 | |
36 | |
37 (defcustom display-time-mode nil | |
38 "Toggle display of time, load level, and mail flag in mode lines. | |
39 You 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) | |
35 | 46 |
36 | 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. |
39 Non-nil and not a string means don't check for mail. nil means use | 50 Non-nil and not a string means don't check for mail. nil means use |
93 This runs the normal hook `display-time-hook' after each update." | 104 This runs the normal hook `display-time-hook' after each update." |
94 (interactive "P") | 105 (interactive "P") |
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 "") |
101 (or global-mode-string (setq global-mode-string '(""))) | 113 (or global-mode-string (setq global-mode-string '(""))) |
102 (if on | 114 (if on |
239 | 251 |
240 (defun display-time-file-nonempty-p (file) | 252 (defun display-time-file-nonempty-p (file) |
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 |