annotate lisp/packages/time.el @ 76:c0c698873ce1 r20-0b33

Import from CVS: tag r20-0b33
author cvs
date Mon, 13 Aug 2007 09:05:10 +0200
parents 131b0175ea99
children cf808b4c4290
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; time.el --- display time and load in mode line of Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3 ;; Copyright (C) 1985, 86, 87, 93, 94, 1996 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
5 ;; Maintainer: FSF
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
22 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
24 ;;; Synched up with: Not synched with FSF.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
28 ;; Facilities to display current time/date and a new-mail indicator
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
29 ;; in the Emacs mode line. The single entry point is `display-time'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
31 ;; See also reportmail.el.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
32 ;; This uses the XEmacs timeout-event mechanism, via a version
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
33 ;; of Kyle Jones' itimer package.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (require 'itimer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
39 (defvar display-time-mail-file nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "*File name of mail inbox file, for indicating existence of new mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 Non-nil and not a string means don't check for mail. nil means use
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
42 default, which is system-dependent, and is the same as used by Rmail.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;;###autoload
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
45 (defvar display-time-day-and-date nil "\
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
46 *Non-nil means \\[display-time] should display day and date as well as time.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
48 (defvar display-time-interval 60
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
49 "*Seconds between updates of time in the mode line.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
51 (defvar display-time-24hr-format nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 "*Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
53 Nil means 1 <= hh <= 12, and an AM/PM suffix is used.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
55 (defvar display-time-echo-area nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
56 "*If non-nil, display-time will use the echo area instead of the mode line.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defvar display-time-string nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
60 (defvar display-time-hook nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
61 "*List of functions to be called when the time is updated on the mode line.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defvar display-time-server-down-time nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "Time when mail file's file system was recorded to be down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 If that file system seems to be up, the value is nil.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defun display-time ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "Display current time, load level, and mail flag in mode line of each buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Updates automatically every minute.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 If `display-time-day-and-date' is non-nil, the current day and date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 are displayed as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 After each update, `display-time-hook' is run with `run-hooks'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 If `display-time-echo-area' is non-nil, the time is displayed in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 echo area instead of in the mode-line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;; if the "display-time" itimer already exists, nuke it first.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (let ((old (get-itimer "display-time")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (if old (delete-itimer old)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; If we're not displaying the time in the echo area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;; and the global mode string does not have a non-nil value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;; then initialize the global mode string's value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (or display-time-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 global-mode-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (setq global-mode-string '("")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; If we're not displaying the time in the echo area
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
87 ;; and our display variable is not part of the global-mode-string list
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
88 ;; the we add our variable to the list. This will make the time
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; appear on the modeline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (or display-time-echo-area
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
91 (memq 'display-time-string global-mode-string)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (setq global-mode-string
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
93 (append global-mode-string '(display-time-string))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;; Display the time initially...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (display-time-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; ... and start an itimer to do it automatically thereafter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;; If we wanted to be really clever about this, we could have the itimer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;; not be automatically restarted, but have it re-add itself each time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;; Then we could look at (current-time) and arrange for the itimer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;; wake up exactly at the minute boundary. But that's just a little
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; more work than it's worth...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (start-itimer "display-time" 'display-time-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 display-time-interval display-time-interval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (defvar display-time-string-forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 '((if display-time-day-and-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (format "%s %s %s " dayname monthname day)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (format "%s:%s%s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (if display-time-24hr-format 24-hours 12-hours)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 minutes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (if display-time-24hr-format "" am-pm))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
114 load
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
115 (if mail " Mail" ""))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
116 "*A list of expressions governing display of the time in the mode line.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 This expression is a list of expressions that can involve the keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 `load', `day', `month', and `year', `12-hours', `24-hours', `minutes',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 `seconds', all numbers in string form, and `monthname', `dayname', `am-pm',
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
120 and `time-zone' all alphabetic strings, and `mail' a true/nil value.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 For example, the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 '((substring year -2) \"/\" month \"/\" day
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 \" \" 24-hours \":\" minutes \":\" seconds
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
126 (if time-zone \" (\") time-zone (if time-zone \")\")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
127 (if mail \" Mail\" \"\"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 would give mode line times like `94/12/30 21:07:48 (UTC)'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (defun display-time-function ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (let* ((now (current-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (time (current-time-string now))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (load (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if (zerop (car (load-average))) ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (let ((str (format " %03d" (car (load-average)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (concat (substring str 0 -2) "." (substring str -2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (error "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (mail-spool-file (or display-time-mail-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (getenv "MAIL")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (concat rmail-spool-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (user-login-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (mail (and (stringp mail-spool-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (or (null display-time-server-down-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;; If have been down for 20 min, try again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (> (- (nth 1 (current-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 display-time-server-down-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 1200))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (let ((start-time (current-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (display-time-file-nonempty-p mail-spool-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (if (> (- (nth 1 (current-time)) (nth 1 start-time))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; Record that mail file is not accessible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (setq display-time-server-down-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (nth 1 (current-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;; Record that mail file is accessible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (setq display-time-server-down-time nil))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (24-hours (substring time 11 13))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (hour (string-to-int 24-hours))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (12-hours (int-to-string (1+ (% (+ hour 11) 12))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (am-pm (if (>= hour 12) "pm" "am"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (minutes (substring time 14 16))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (seconds (substring time 17 19))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (time-zone (car (cdr (current-time-zone now))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (day (substring time 8 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (year (substring time 20 24))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (monthname (substring time 4 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (month
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 monthname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 '(("Jan" . "1") ("Feb" . "2") ("Mar" . "3") ("Apr" . "4")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ("May" . "5") ("Jun" . "6") ("Jul" . "7") ("Aug" . "8")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ("Sep" . "9") ("Oct" . "10") ("Nov" . "11") ("Dec" . "12")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (dayname (substring time 0 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (setq display-time-string
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
178 (mapconcat 'eval display-time-string-forms ""))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ;; This is inside the let binding, but we are not going to document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;; what variables are available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (run-hooks 'display-time-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if display-time-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (or (> (minibuffer-depth) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ;; don't stomp echo-area-buffer if reading from minibuffer now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (select-window (minibuffer-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (erase-buffer)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
189 (indent-to (- (screen-width) (length display-time-string) 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (insert display-time-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (message (buffer-string)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (force-mode-line-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;; Do redisplay right now, if no input pending.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (sit-for 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (defun display-time-file-nonempty-p (file)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
197 (and (file-exists-p file)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 42
diff changeset
198 (< 0 (nth 7 (file-attributes (file-chase-links file))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (provide 'time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;;; time.el ends here