annotate lisp/packages/time.el @ 203:850242ba4a81 r20-3b28

Import from CVS: tag r20-3b28
author cvs
date Mon, 13 Aug 2007 10:02:21 +0200
parents 489f57a838ef
children 41ff10fd062f
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
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
5 ;; Maintainer: FSF for the original version.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
6 ;; XEmacs add-ons and rewrite (C) by Jens Lautenbacher
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
7 ;; mail <jens@lemming0.lem.uni-karlsruhe.de>
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
8 ;; for comments/fixes about the enhancements.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; 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
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
25 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
27 ;;; Version: 1.17 (I choose the version number starting at 1.1
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
28 ;;; to indicate that 1.0 was the old version
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
29 ;;; before I hacked away on it -jtl)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
30
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
31 ;;; Synched up with: Not synched with FSF.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
35 ;; Facilities to display current time/date and a new-mail indicator
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
36 ;; in the Emacs mode line. The single entry point is `display-time'.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
38 ;; See also reportmail.el.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 ;; This uses the XEmacs timeout-event mechanism, via a version
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
40 ;; of Kyle Jones' itimer package.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
42 ;;; jtl: This is in a wide part reworked for XEmacs so it won't use
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
43 ;;; the old mechanism for specifying what is to be displayed.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
44 ;;; The starting variable to look at is `display-time-form-list'
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
45
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
46 ;;; It's more advanced features include heavy use of `balloon-help' a
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
47 ;;; package again written by Kyle Jones. You need to load this
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
48 ;;; explicitely on your own because I don't think a package should make
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
49 ;;; decisions which have a global effect (if you want to use it, a
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
50 ;;; (require 'balloon-help) in your .emacs should work. But look at the
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
51 ;;; documentation in balloon-help.el itself).
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
52
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
53 ;;; Thanks to Mike Scheidler for the idea to make the time led's fore- and
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
54 ;;; background color customizable
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
55
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (require 'itimer)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
59 ;;; Not sure for now...
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
60 ;;;(require 'balloon-help)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
62 (defconst display-time-version-number "1.15" "Version number of time.el")
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
63 (defconst display-time-version (format "Time.el version %s for XEmacs"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
64 display-time-version-number)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
65 "The full version string for time.el")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
66
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
67 ;;; Doesn't work by now....
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
68 ;;;(defvar display-time-keymap nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
69 ;;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
70 ;;;(if display-time-keymap ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
71 ;;; (setq display-time-keymap (make-sparse-keymap))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
72 ;;; (suppress-keymap display-time-keymap)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
73 ;;; (define-key display-time-keymap 'button1 'balloon-help))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
74
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
75 (defgroup display-time nil
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
76 "Facilities to display the current time/date/load and a new-mail indicator
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
77 in the XEmacs mode line or echo area."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
78 :group 'applications)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
79
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
80 (defgroup display-time-balloon nil
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
81 "Fancy add-ons to display-time for using the `balloon-help' feature.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
82 balloon-help must be loaded before these settings take effect."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
83 :group 'display-time)
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
84
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
85
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
86 (defcustom display-time-mail-file nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "*File name of mail inbox file, for indicating existence of new mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 Non-nil and not a string means don't check for mail. nil means use
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
89 default, which is system-dependent, and is the same as used by Rmail."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
90 :group 'display-time)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;;;###autoload
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
93 (defcustom display-time-day-and-date nil
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
94 "*Non-nil means \\[display-time] should display day,date and time.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
95 This affects the spec 'date in the variable display-time-form-list."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
96 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
97 :type 'boolean)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
99 (defcustom display-time-interval 20
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
100 "*Seconds between updates of time in the mode line."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
101 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
102 :type 'integer)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
104 (defcustom display-time-24hr-format nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 "*Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
106 Nil means 1 <= hh <= 12, and an AM/PM suffix is used.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
107 This affects the spec 'time in the variable display-time-form-list."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
108 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
109 :type 'boolean)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
111 (defcustom display-time-echo-area nil
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
112 "*If non-nil, display-time will use the echo area instead of the mode line."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
113 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
114 :type 'boolean)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defvar display-time-string nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
118 (defcustom display-time-hook nil
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
119 "*List of functions to be called when the time is updated on the mode line."
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
120 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
121 :type 'hook)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defvar display-time-server-down-time nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 "Time when mail file's file system was recorded to be down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 If that file system seems to be up, the value is nil.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
127 (defcustom display-time-ignore-read-mail t
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
128 "*Non-nil means display the mail icon on any non-empty mailbox."
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
129 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
130 :type 'boolean)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
131
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defun display-time ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "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
135 Updates automatically every minute.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 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
137 are displayed as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 After each update, `display-time-hook' is run with `run-hooks'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 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
140 echo area instead of in the mode-line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (interactive)
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
142 (or display-time-insinuated
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
143 (display-time-insinuate))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;; if the "display-time" itimer already exists, nuke it first.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (let ((old (get-itimer "display-time")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (if old (delete-itimer old)))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
147
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
148 (if (memq 'display-time-string global-mode-string)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
149 (setq global-mode-string
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
150 (remove 'display-time-string global-mode-string)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;; If we're not displaying the time in the echo area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;; and the global mode string does not have a non-nil value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; then initialize the global mode string's value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (or display-time-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 global-mode-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (setq global-mode-string '("")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;; If we're not displaying the time in the echo area
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
158 ;; then we add our variable to the list. This will make the time
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; appear on the modeline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (or display-time-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (setq global-mode-string
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
162 (append global-mode-string '(display-time-string))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; Display the time initially...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (display-time-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ;; ... and start an itimer to do it automatically thereafter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ;; 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
168 ;; not be automatically restarted, but have it re-add itself each time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ;; Then we could look at (current-time) and arrange for the itimer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ;; wake up exactly at the minute boundary. But that's just a little
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ;; more work than it's worth...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (start-itimer "display-time" 'display-time-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 display-time-interval display-time-interval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
175 (defun display-time-stop ()
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
176 (interactive)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
177 (delete-itimer "display-time")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
178 (setq display-time-string nil))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
179
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
180 (defcustom display-time-show-icons-maybe t
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
181 "Use icons for time, load and mail status if possible
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
182 and not specified different explicitely"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
183 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
184 :type 'boolean)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
185
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
186 (defvar display-time-icons-dir (concat data-directory "time/"))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
187
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
188 (defcustom display-time-mail-sign-string " Mail"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
189 "The string used as mail indicator in the echo area
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
190 (and in the modeline if display-time-show-icons-maybe is nil)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
191 if display-time-echo-area is t"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
192 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
193 :type 'string)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
194
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
195 (defcustom display-time-no-mail-sign-string ""
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
196 "The string used as no-mail indicator in the echo area
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
197 (and in the modeline if display-time-show-icons-maybe is nil)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
198 if display-time-echo-area is t"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
199 :group 'display-time
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
200 :type 'string)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
201
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
202 (defcustom display-time-display-pad "grey35"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
203 "How the load indicator's trapezoidal \"pad\" is to be displayed.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
204 This can be 'transparent or a string describing the color it should have"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
205 :group 'display-time
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
206 :type '(choice :tag "Value"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
207 (const transparent)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
208 (string :tag "Color")))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
209
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
210 (defcustom display-time-display-time-foreground "firebrick"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
211 "How the time LEDs foreground is to be displayed.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
212 This can be 'modeline (foreground color of the Modeline)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
213 or a string describing the color it should have"
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
214 :group 'display-time
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
215 :type '(choice :tag "Value"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
216 (const modline)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
217 (string :tag "Color")))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
218
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
219 (defcustom display-time-display-time-background 'transparent
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
220 "How the time LEDs background is to be displayed.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
221 This can be 'transparent or a string describing the color it should have"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
222 :group 'display-time
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
223 :type '(choice :tag "Value"
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
224 (const transparent)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
225 (string :tag "Color")))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
226
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
227 (defcustom display-time-mail-balloon 'display-time-mail-balloon
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
228 "What to use to generate the ballon frame of the \"mail\" glyph
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
229 if balloon-help is loaded. This can be the function
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
230 display-time-mail-balloon, nil or a string."
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
231 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
232 :type '(choice (const display-time-mail-balloon)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
233 (const nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
234 (string)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
235
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
236 (defcustom display-time-no-mail-balloon "No mail is good mail."
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
237 "The string used in the ballon frame of the \"no mail\" glyph
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
238 if balloon-help is loaded. This can also be nil"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
239 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
240 :type '(choice (const nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
241 (string)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
242
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
243 (defcustom display-time-mail-balloon-show-gnus-group nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
244 "Show the mail group gnus would put this message in.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
245 This is only useful if you use gnus to read your mail and have set the variable
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
246 nnmail-split-methods to split your incoming mail into different groups.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
247 Look at the documentation for gnus. If you don't know what we're talking about,
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
248 don't care and leave this set to nil"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
249 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
250 :type 'boolean)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
251
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
252 (defface display-time-mail-balloon-enhance-face '((t (:background "orange")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
253 "Face used for entries in the mail balloon which match the regexp
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
254 display-time-mail-balloon-enhance"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
255 :group 'display-time-balloon)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
256
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
257 (defface display-time-time-balloon-face '((t (:foreground "red")))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
258 "Face used in the time balloon to display the full date and load.
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
259 It is also used in the mail balloon for the \"You have mail:\" heading."
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
260 :group 'display-time-balloon)
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
261
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
262 (defface display-time-mail-balloon-gnus-group-face '((t (:foreground "blue")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
263 "Face used for the gnus group entry in the mail balloon
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
264 if display-time-mail-balloon-show-gnus-group is t (see the documentation there
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
265 before you set it to t)"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
266 :group 'display-time-balloon)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
267
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
268 (defcustom display-time-mail-balloon-max-displayed 10
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
269 "The maximum number of messaged which are displayed in the mail balloon.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
270 You need to have balloon-help loaded to use this."
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
271 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
272 :type 'number)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
273
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
274 (defcustom display-time-mail-balloon-from-width 20
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
275 "The width of the `From:' part of the mail balloon.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
276 You need to have ballon-help loaded to use this"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
277 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
278 :type 'number)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
279
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
280 (defcustom display-time-mail-balloon-subject-width 25
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
281 "The width of the `Subject:' part of the mail balloon.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
282 You need to have ballon-help loaded to use this"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
283 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
284 :type 'number)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
285
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
286 (defcustom display-time-mail-balloon-gnus-split-width 10
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
287 "The width of the `Gnus Mail Group' part of the mail balloon.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
288 This denotes the mail group gnus would decide to put this message in.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
289 For getting this information, it consults the relevant variables from gnus
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
290 (nnmail-split-methods).
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
291 You need to have ballon-help loaded to use this"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
292 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
293 :type 'number)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
294
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
295 (defcustom display-time-mail-balloon-enhance nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
296 "A list of regular expressions describing which messages should be highlighted
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
297 in the mail balloon. The regexp will be matched against the complete header block
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
298 of an email. You need to load balloon-help to use this"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
299 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
300 :type '(repeat (string :tag "Regexp")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
301
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
302 (defcustom display-time-mail-balloon-suppress nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
303 "A list of regular expressions describing which messages should be completely suppressed
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
304 in the mail balloon. The regexp will be matched against the complete header block
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
305 of an email. It will only take effect if the message is not matched already
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
306 by display-time-mail-balloon-enhance.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
307 You need to load balloon-help to use this"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
308 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
309 :type '(repeat (string :tag "Regexp")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
310
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
311 (defcustom display-time-mail-balloon-enhance-gnus-group nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
312 "A list of regular expressions describing which messages should be highlighted
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
313 in the mail balloon. The regexp will be matched against the group gnus would stuff
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
314 this message into. It will only take effect if the message is not matched already
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
315 by display-time-mail-balloon-suppress.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
316
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
317 This requires display-time-mail-balloon-show-gnus-group to be t
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
318 and balloon-help to be loaded"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
319 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
320 :type '(repeat (string :tag "Regexp")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
321
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
322 (defcustom display-time-mail-balloon-suppress-gnus-group nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
323 "A list of regular expressions describing which messages should be completely suppressed
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
324 in the mail balloon. The regexp will be matched against the group gnus would stuff
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
325 this message into. It will only take effect if the message is not matched already
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
326 by display-time-mail-balloon-enhance or display-time-mail-balloon-enhance-gnus-group.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
327
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
328 This requires display-time-mail-balloon-show-gnus-group to be t
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
329 and balloon-help to be loaded"
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
330 :group 'display-time-balloon
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
331 :type '(repeat (string :tag "Regexp")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
332
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
333 (defvar display-time-spool-file-modification nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
334
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
335 (defvar display-time-mail-header nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
336
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
337 (defvar display-time-temp-buffer " *Display-time-temp-buffer*")
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
338
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
339 (defvar display-time-display-pad-old nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
340
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
341 (defvar display-time-display-time-fg-old nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
342
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
343 (defvar display-time-display-time-bg-old nil)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
344
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
345 (defcustom display-time-load-list
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
346 (list 0.2 0.5 0.8 1.1 1.8 2.6)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
347 "*A list giving six thresholds for the load
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
348 which correspond to the six different icons to be displayed
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
349 as a load indicator"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
350 :group 'display-time
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
351 :type '(list (number :tag "Threshold 1")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
352 (number :tag "Threshold 2")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
353 (number :tag "Threshold 3")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
354 (number :tag "Threshold 4")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
355 (number :tag "Threshold 5")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
356 (number :tag "Threshold 6")))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
357
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
358 (defcustom display-time-compatible nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
359 "*This variable may be set to t to get the old behaviour of display-time.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
360 It should be considered obsolete and only be used if you really want the
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
361 old behaviour (eq. you made extensive customizations yourself).
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
362 This means no display of a spiffy mail icon or use of the
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
363 display-time-form-list instead of the old display-time-string-form."
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
364 :group 'display-time
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
365 :type 'boolean)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
366
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
367 (defun display-time-string-to-char-list (str)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
368 (mapcar (function identity) str))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
369
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
370 (defun display-time-generate-load-glyphs (&optional force)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
371 (let* ((pad-color (if (symbolp display-time-display-pad)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
372 (list "pad-color" '(face-background 'modeline))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
373 (list "pad-color" display-time-display-pad)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
374 (xpm-color-symbols (append (list pad-color) xpm-color-symbols)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
375 (if (and (featurep 'xpm)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
376 (or force (not (equal display-time-display-pad
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
377 display-time-display-pad-old))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
378 (progn
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
379 (setq display-time-load-0.0-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
380 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
381 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
382 (concat display-time-icons-dir "l-0.0.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
383 (setq display-time-load-0.5-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
384 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
385 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
386 (concat display-time-icons-dir "l-0.5.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
387 (setq display-time-load-1.0-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
388 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
389 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
390 (concat display-time-icons-dir "l-1.0.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
391 (setq display-time-load-1.5-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
392 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
393 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
394 (concat display-time-icons-dir "l-1.5.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
395 (setq display-time-load-2.0-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
396 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
397 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
398 (concat display-time-icons-dir "l-2.0.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
399 (setq display-time-load-2.5-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
400 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
401 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
402 (concat display-time-icons-dir "l-2.5.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
403 (setq display-time-load-3.0-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
404 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
405 (make-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
406 (concat display-time-icons-dir "l-3.0.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
407 (setq display-time-display-pad-old display-time-display-pad)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
408 ))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
409
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
410
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
411 (defun display-time-generate-time-glyphs (&optional force)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
412 (let* ((ledbg (if (symbolp display-time-display-time-background)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
413 (list "ledbg" '(face-background 'modeline))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
414 (list "ledbg" display-time-display-time-background)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
415 (ledfg (if (symbolp display-time-display-time-foreground)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
416 (list "ledfg" '(face-foreground 'modeline))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
417 (list "ledfg" display-time-display-time-foreground)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
418 (xpm-color-symbols (append (list ledbg)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
419 (list ledfg) xpm-color-symbols)))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
420 (if (and (featurep 'xpm)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
421 (or force (not (equal display-time-display-time-background
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
422 display-time-display-time-bg-old))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
423 (not (equal display-time-display-time-foreground
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
424 display-time-display-time-fg-old))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
425 (progn
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
426 (setq display-time-1-glyph
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
427 (cons (make-extent nil nil)
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
428 (make-glyph (concat display-time-icons-dir "1.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
429 (setq display-time-2-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
430 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
431 (make-glyph (concat display-time-icons-dir "2.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
432 (setq display-time-3-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
433 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
434 (make-glyph (concat display-time-icons-dir "3.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
435 (setq display-time-4-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
436 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
437 (make-glyph (concat display-time-icons-dir "4.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
438 (setq display-time-5-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
439 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
440 (make-glyph (concat display-time-icons-dir "5.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
441 (setq display-time-6-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
442 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
443 (make-glyph (concat display-time-icons-dir "6.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
444 (setq display-time-7-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
445 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
446 (make-glyph (concat display-time-icons-dir "7.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
447 (setq display-time-8-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
448 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
449 (make-glyph (concat display-time-icons-dir "8.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
450 (setq display-time-9-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
451 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
452 (make-glyph (concat display-time-icons-dir "9.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
453 (setq display-time-0-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
454 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
455 (make-glyph (concat display-time-icons-dir "0.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
456 (setq display-time-:-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
457 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
458 (make-glyph (concat display-time-icons-dir "dp.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
459 (setq display-time-am-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
460 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
461 (make-glyph (concat display-time-icons-dir "am.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
462 (setq display-time-pm-glyph
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
463 (cons (make-extent nil nil)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
464 (make-glyph (concat display-time-icons-dir "pm.xpm"))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
465 (setq display-time-display-time-fg-old
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
466 display-time-display-time-foreground
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
467 display-time-display-time-bg-old
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
468 display-time-display-time-background)
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
469 ))))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
470
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
471 (defun display-time-init-glyphs ()
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
472 "This is a hack to have all glyphs be displayed one time at startup.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
473 It helps avoiding problems with the background color of the glyphs if a
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
474 balloon-help frame is open and a not yet displayed glyph is going to be
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
475 displayed."
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
476 (let ((i 0)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
477 (list '("am" "pm" ":"))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
478 elem mlist)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
479 (while (< i 10)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
480 (push (eval (intern-soft (concat "display-time-"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
481 (number-to-string i)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
482 "-glyph"))) mlist)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
483 (setq i (1+ i)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
484 (setq i 0.0)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
485 (while (<= i 3.0)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
486 (push (eval (intern-soft (concat "display-time-load-"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
487 (number-to-string i)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
488 "-glyph"))) mlist)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
489 (setq i (+ i 0.5)))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
490 (while (setq elem (pop list))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
491 (push (eval (intern-soft (concat "display-time-"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
492 elem "-glyph"))) mlist))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
493 (let ((global-mode-string mlist))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
494 (redisplay-frame))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
495 ))
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
496
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
497 (defvar display-time-insinuated nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
498
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
499 ;; This used to be at top-level!
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
500 (defun display-time-insinuate ()
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
501 (when (featurep 'xpm)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
502 (defvar display-time-mail-sign
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
503 (cons (make-extent nil nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
504 (make-glyph (concat display-time-icons-dir "letter.xpm"))))
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
505 (set-extent-property (car display-time-mail-sign) 'balloon-help
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
506 'display-time-mail-balloon)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
507 ;;; (set-extent-keymap (car display-time-mail-sign)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
508 ;;; display-time-keymap)
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
509 (defvar display-time-no-mail-sign
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
510 (cons (make-extent nil nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
511 (make-glyph (concat display-time-icons-dir "no-letter.xpm"))))
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
512 (set-extent-property (car display-time-no-mail-sign) 'balloon-help
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
513 display-time-no-mail-balloon)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
514 ;;; (set-extent-keymap (car display-time-no-mail-sign)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
515 ;;; display-time-keymap)
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
516 (defvar display-time-1-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
517 (defvar display-time-2-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
518 (defvar display-time-3-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
519 (defvar display-time-4-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
520 (defvar display-time-5-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
521 (defvar display-time-6-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
522 (defvar display-time-7-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
523 (defvar display-time-8-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
524 (defvar display-time-9-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
525 (defvar display-time-0-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
526 (defvar display-time-:-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
527 (defvar display-time-am-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
528 (defvar display-time-pm-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
529 (defvar display-time-load-0.0-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
530 (defvar display-time-load-0.5-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
531 (defvar display-time-load-1.0-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
532 (defvar display-time-load-1.5-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
533 (defvar display-time-load-2.0-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
534 (defvar display-time-load-2.5-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
535 (defvar display-time-load-3.0-glyph nil)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
536 (display-time-generate-time-glyphs 'force)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
537 (display-time-generate-load-glyphs 'force)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
538 (display-time-init-glyphs)
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
539 (sit-for 0))
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 185
diff changeset
540 (setq display-time-insinuated t))
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
541
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
542
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
543 (defun display-time-can-do-graphical-display (&optional textual)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
544 (and display-time-show-icons-maybe
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
545 (not textual)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
546 (eq (console-type) 'x)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
547 (featurep 'xpm)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
548 (not display-time-echo-area)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
549
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
550
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
551 (defun display-time-convert-num (time-string &optional textual)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
552 (let ((list (display-time-string-to-char-list time-string))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
553 elem tmp balloon-help balloon-ext)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
554 (if (not (display-time-can-do-graphical-display textual)) time-string
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
555 (display-time-generate-time-glyphs)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
556 (setq balloon-help
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
557 (format "%s, %s %s %s %s" dayname day monthname year
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
558 (concat " Average load:"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
559 (if (not (equal load ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
560 load
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
561 " 0"))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
562 (setq balloon-ext (make-extent 0 (length balloon-help) balloon-help))
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
563 (set-extent-property balloon-ext 'face 'display-time-time-balloon-face)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
564 (set-extent-property balloon-ext 'duplicable 't)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
565 (while (setq elem (pop list))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
566 (setq elem
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
567 (eval (intern-soft (concat "display-time-"
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
568 (char-to-string elem)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
569 "-glyph"))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
570 (set-extent-property (car elem) 'balloon-help balloon-help)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
571 ;;; (set-extent-keymap (car elem) display-time-keymap)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
572 (push elem tmp))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
573 (reverse tmp))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
574
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
575 (defun display-time-convert-load (load-string &optional textual)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
576 (let ((load-number (string-to-number load-string))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
577 (alist (list (cons 0.0 0.0)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
578 (cons 0.5 (car display-time-load-list))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
579 (cons 1.0 (cadr display-time-load-list))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
580 (cons 1.5 (caddr display-time-load-list))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
581 (cons 2.0 (cadddr display-time-load-list))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
582 (cons 2.5 (cadr (cdddr display-time-load-list)))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
583 (cons 3.0 (caddr (cdddr display-time-load-list)))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
584 (cons 100000 100000)))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
585 elem load-elem)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
586 (if (not (display-time-can-do-graphical-display textual))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
587 load-string
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
588 (display-time-generate-load-glyphs)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
589 (while (>= load-number (cdr (setq elem (pop alist))))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
590 (setq load-elem elem))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
591 (eval (intern-soft (concat "display-time-load-"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
592 (number-to-string (car load-elem))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
593 "-glyph"))))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
594
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
595 (defun display-time-convert-am-pm (ampm-string &optional textual)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
596 (if (not (display-time-can-do-graphical-display textual))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
597 ampm-string
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
598 (cond ((equal ampm-string "am") display-time-am-glyph)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
599 ((equal ampm-string "pm") display-time-pm-glyph))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
600
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
601 (defun display-time-mail-balloon (&rest ciao)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
602 (let* ((mail-spool-file (or display-time-mail-file
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
603 (getenv "MAIL")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
604 (concat rmail-spool-directory
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
605 (user-login-name))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
606 (show-split (and display-time-mail-balloon-show-gnus-group
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
607 (or (featurep 'nnmail) (require 'nnmail))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
608 (display-time-mail-balloon-gnus-split-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
609 (if (not show-split) 0
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
610 (+ 3 display-time-mail-balloon-gnus-split-width))) ; -><space>... = +3
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
611 (mod (nth 5 (file-attributes mail-spool-file)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
612 header header-ext)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
613 (setq header "You have mail:")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
614 (setq header-ext
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
615 (make-extent 0 (length header) header))
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 118
diff changeset
616 (set-extent-property header-ext 'face 'display-time-time-balloon-face)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
617 (set-extent-property header-ext 'duplicable t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
618 (setq header (concat header "\n"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
619 (make-string (+ display-time-mail-balloon-from-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
620 display-time-mail-balloon-subject-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
621 display-time-mail-balloon-gnus-split-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
622 3) (string-to-char "-"))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
623 (if (not (equal
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
624 mod display-time-spool-file-modification))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
625 (progn
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
626 (setq display-time-spool-file-modification mod)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
627 (setq display-time-mail-header
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
628 (display-time-scan-mail-file mail-spool-file show-split))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
629 (setq header (concat header display-time-mail-header))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
630 ))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
631
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
632
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
633 (defun display-time-scan-mail-file (file show-split)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
634 (let ((mail-headers "")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
635 (nntp-server-buffer (get-buffer-create " *Display-Time-Split-Buffer*"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
636 (suppress-count 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
637 (not-displayed 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
638 (i 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
639 (suppress-list display-time-mail-balloon-suppress)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
640 (enhance-list display-time-mail-balloon-enhance)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
641 (gnus-suppress-list display-time-mail-balloon-suppress-gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
642 (gnus-enhance-list display-time-mail-balloon-enhance-gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
643 mail-headers-list start end from subject gnus-group tmp
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
644 suppress enhance line line-ext
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
645 gnus-suppress-reg gnus-enhance-reg suppress-reg enhance-reg)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
646
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
647 (erase-buffer (get-buffer-create display-time-temp-buffer))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
648 (message "Scanning spool file...")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
649 (while (setq tmp (pop enhance-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
650 (setq enhance-reg
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
651 (if (car enhance-list) (concat enhance-reg tmp "\\|")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
652 (concat enhance-reg tmp))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
653 (while (setq tmp (pop suppress-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
654 (setq suppress-reg
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
655 (if (car suppress-list) (concat suppress-reg tmp "\\|")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
656 (concat suppress-reg tmp))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
657 (while (setq tmp (pop gnus-enhance-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
658 (setq gnus-enhance-reg
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
659 (if (car gnus-enhance-list) (concat gnus-enhance-reg tmp "\\|")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
660 (concat gnus-enhance-reg tmp))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
661 (while (setq tmp (pop gnus-suppress-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
662 (setq gnus-suppress-reg
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
663 (if (car gnus-suppress-list) (concat gnus-suppress-reg tmp "\\|")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
664 (concat gnus-suppress-reg tmp))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
665 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
666 (set-buffer display-time-temp-buffer)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
667 (setq case-fold-search nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
668 (insert-file-contents file)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
669 (goto-char (point-min))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
670 (while (setq start (re-search-forward "^From " nil t))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
671 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
672 (setq end (re-search-forward "^$" nil t))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
673 (narrow-to-region start end)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
674 (goto-char (point-min))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
675 (setq enhance
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
676 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
677 (if display-time-mail-balloon-enhance
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
678 (re-search-forward enhance-reg nil t))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
679 (if show-split
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
680 (save-excursion
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
681 (goto-char (point-min))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
682 (nnmail-article-group '(lambda (name) (setq gnus-group name)))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
683
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
684 (if enhance () ; this takes prejudice over everything else
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
685 (setq suppress ; maybe set suppress only if not already enhanced
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
686 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
687 (if display-time-mail-balloon-suppress
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
688 (re-search-forward suppress-reg nil t))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
689 (if suppress ()
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
690 (or (setq enhance ;;maybe we enhance because of the gnus group name
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
691 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
692 (if (and show-split gnus-group
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
693 display-time-mail-balloon-enhance-gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
694 (string-match gnus-enhance-reg gnus-group))))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
695 (setq suppress ;; if we didn't enhance then maybe we have to
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
696 ;; suppress it?
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
697 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
698 (if (and show-split gnus-group
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
699 display-time-mail-balloon-suppress-gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
700 (string-match gnus-suppress-reg gnus-group)))))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
701
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
702 (setq from
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
703 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
704 (re-search-forward "^From: \\(.*\\)" nil t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
705 (mail-extract-address-components (match-string 1))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
706 (setq subject
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
707 (save-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
708 (re-search-forward "^Subject: \\(.*\\)" nil t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
709 (match-string 1)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
710 (if suppress (setq suppress-count (1+ suppress-count))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
711 (if (car from) (setq from (car from))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
712 (setq from (cadr from)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
713 (if (> (length from) display-time-mail-balloon-from-width)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
714 (setq from (substring from 0
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
715 display-time-mail-balloon-from-width)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
716 (if (> (length subject) display-time-mail-balloon-subject-width)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
717 (setq subject (substring subject 0
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
718 display-time-mail-balloon-subject-width)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
719 (if (and show-split gnus-group
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
720 (> (length gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
721 (- display-time-mail-balloon-gnus-split-width 3)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
722 (setq gnus-group (substring gnus-group 0
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
723 (- display-time-mail-balloon-gnus-split-width 3))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
724
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
725 (setq line (format (concat
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
726 "\n%-"(number-to-string
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
727 display-time-mail-balloon-from-width)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
728 "s [%-"(number-to-string
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
729 display-time-mail-balloon-subject-width)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
730 "s]")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
731 from subject))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
732 (if (and show-split gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
733 (setq line (concat line
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
734 (format
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
735 (concat
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
736 "-> %" (number-to-string
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
737 (- display-time-mail-balloon-gnus-split-width 3))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
738 "s") gnus-group))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
739 (if enhance
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
740 (progn
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
741 (setq line-ext (make-extent 1 (length line) line))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
742 (set-extent-property line-ext 'face
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
743 'display-time-mail-balloon-enhance-face)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
744 (set-extent-property line-ext 'duplicable t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
745 (set-extent-property line-ext 'end-open t)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
746 (if (and show-split gnus-group)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
747 (progn
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
748 (setq line-ext (make-extent (- (length line)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
749 display-time-mail-balloon-gnus-split-width)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
750 (length line) line))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
751 (set-extent-property line-ext 'face
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
752 'display-time-mail-balloon-gnus-group-face)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
753 (set-extent-property line-ext 'duplicable t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
754 (set-extent-property line-ext 'end-open t)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
755 (push line mail-headers-list))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
756 (goto-char (point-max))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
757 (setq suppress nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
758 gnus-group nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
759 enhance nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
760 (widen)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
761 )))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
762 (kill-buffer display-time-temp-buffer)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
763 (if (> (length mail-headers-list) display-time-mail-balloon-max-displayed)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
764 (setq not-displayed (- (length mail-headers-list)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
765 display-time-mail-balloon-max-displayed)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
766 (while (< i display-time-mail-balloon-max-displayed)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
767 (setq mail-headers (concat mail-headers (pop mail-headers-list)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
768 (setq i (1+ i)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
769 (if (and (equal mail-headers "") (> suppress-count 0))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
770 (setq mail-headers "\nOnly junk mail..."))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
771 (concat mail-headers "\n"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
772 (make-string (+ display-time-mail-balloon-from-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
773 display-time-mail-balloon-subject-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
774 display-time-mail-balloon-gnus-split-width
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
775 3) (string-to-char "-"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
776 "\n"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
777 (if (> not-displayed 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
778 (concat "More: " (number-to-string not-displayed)"\n"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
779 (if (> suppress-count 0)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
780 (concat "Suppressed: " (number-to-string suppress-count)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
781 )))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
782
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
783
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
784 (defun display-time-mail-sign (&optional textual)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
785 "*A function giving back the object indicating 'mail' which
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
786 is the value of display-time-mail-sign when running under X,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
787 display-time-echo-area is nil and display-time-show-icons-maybe is t.
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
788 It is the value of display-time-mail-sign-string otherwise or when
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
789 the optional parameter TEXTUAL is non-nil."
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
790 (if (not (display-time-can-do-graphical-display textual))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
791 display-time-mail-sign-string
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
792 (list " " display-time-mail-sign " ")))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
793
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
794 (defun display-time-no-mail-sign (&optional textual)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
795 "*A function giving back the object indicating 'no mail' which
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
796 is the value of display-time-no-mail-sign when running under X,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
797 display-time-echo-area is nil and display-time-show-icons-maybe is t.
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
798 It is the value of display-time-no-mail-sign-string otherwise or when
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
799 the optional parameter TEXTUAL is non-nil."
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
800 (if (not (display-time-can-do-graphical-display textual))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
801 display-time-no-mail-sign-string
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 114
diff changeset
802 (list " " display-time-no-mail-sign " ")))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
803
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
804 (defcustom display-time-form-list
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
805 (list 'date 'time 'load 'mail)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
806 "*This list describes the format of the strings/glyphs
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
807 which are to be displayed by display-time.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
808 The old variable display-time-string-forms is only used if
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
809 display-time-compatible is non-nil. It is a list consisting of
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
810 strings or any of the following symbols:
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
811
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
812 There are three complex specs whose behaviour is changed via
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
813 the setting of various variables
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
814
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
815 date: This prints out the date in a manner compatible to
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
816 the default value of the obsolete variable
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
817 display-time-string-forms. It respects the variable
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
818 display-time-day-and-date. If this is t it will print
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
819 out the current date in the form DAYNAME MONTH DAY
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
820 otherwise it will print nothing.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
821
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
822 time: This prints out the time in a manner compatible to
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
823 the default value of the obsolete variable
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
824 display-time-string-forms. It respects the variable
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
825 display-time-24hr-format. If this is t it will print
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
826 out the current hours in 24-hour format, if nil the
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
827 hours will be printed in 12-hour format and the
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
828 minutes will be followed by 'AM' or 'PM'.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
829
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
830 time-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
831
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
832 The other specs are simpler, as their meaning is not changed via
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
833 variables.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
834
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
835 24-hours: This prints the hours in 24-hours format
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
836
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
837 24-hours-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
838
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
839 12-hours: This prints the hours in 12-hours format
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
840
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
841 12-hours-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
842
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
843 am-pm: This prints am or pm.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
844
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
845 Timezone: This prints out the local timezone
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
846
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
847 am-pm-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
848
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
849 minutes: This prints the minutes.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
850
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
851 minutes-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
852
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
853 day: This prints out the current day as a number.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
854
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
855 dayname: This prints out today's name.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
856
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
857 month: This prints out the current month as a number
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
858
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
859 monthname: This prints out the current month's name
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
860
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
861 year: This prints out the current year.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
862
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
863 load: This prints out the system's load.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
864
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
865 load-text: The same as above, but will not use a glyph
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
866
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
867 mail: This displays a mail indicator. Under X this will
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
868 normally be a small icon which changes depending if
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
869 there is new mail or not.
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
870
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
871 mail-text: The same as above, but will not use a glyph"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
872 :group 'display-time
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 110
diff changeset
873 :type '(repeat (choice :tag "Symbol/String"
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
874 (const :tag "Date" date)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
875 (const :tag "Time" time)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
876 (const :tag "Time (text)" time-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
877 (const :tag "24 hour format" 24-hours)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
878 (const :tag "24 hour format (text)" 24-hours-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
879 (const :tag "12 hour format" 12-hours)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
880 (const :tag "12 hour format (text)" 12-hours-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
881 (const :tag "AM/PM indicator" am-pm)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
882 (const :tag "AM/PM indicator (text)" am-pm-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
883 (const :tag "Timezone" timezone)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
884 (const :tag "Minutes" minutes)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
885 (const :tag "Minutes (text)" minutes-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
886 (const :tag "Day" day)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
887 (const :tag "Dayname" dayname)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
888 (const :tag "Month" month)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
889 (const :tag "Monthname" monthname)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
890 (const :tag "Year" year)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
891 (const :tag "Load" load)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
892 (const :tag "Load (text)" load-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
893 (const :tag "Mail sign" mail)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
894 (const :tag "Mail sign (text)" mail-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
895 (string :tag "String"))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
896
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
897 (defun display-time-evaluate-list ()
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
898 "Evalute the variable display-time-form-list"
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
899 (let ((list display-time-form-list) elem tmp result)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
900 (while (setq elem (pop list))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
901 (cond ((stringp elem) (push elem tmp))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
902 ((eq elem 'date)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
903 (push (if display-time-day-and-date
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
904 (format "%s %s %s " dayname monthname day) "") tmp))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
905 ((eq elem 'time)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
906 (progn
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
907 (push (display-time-convert-num
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
908 (format "%s:%s"
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
909 (if display-time-24hr-format 24-hours 12-hours)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
910 minutes)) tmp)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
911 (if (not display-time-24hr-format)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
912 (push (display-time-convert-am-pm am-pm) tmp))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
913 ((eq elem 'time-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
914 (push (display-time-convert-num
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
915 (format "%s:%s"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
916 (if display-time-24hr-format 24-hours 12-hours)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
917 minutes) t) tmp)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
918 (if (not display-time-24hr-format)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
919 (push (display-time-convert-am-pm am-pm t) tmp)))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
920 ((eq elem 'day) (push day tmp))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
921 ((eq elem 'dayname) (push dayname tmp))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
922 ((eq elem 'month) (push month tmp))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
923 ((eq elem 'monthname) (push monthname tmp))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
924 ((eq elem '24-hours)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
925 (push (display-time-convert-num 24-hours) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
926 ((eq elem 'year)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
927 (push year tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
928 ((eq elem '24-hours-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
929 (push (display-time-convert-num 24-hours t) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
930 ((eq elem '12-hours)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
931 (push (display-time-convert-num 12-hours) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
932 ((eq elem '12-hours-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
933 (push (display-time-convert-num 12-hours t) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
934 ((eq elem 'minutes)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
935 (push (display-time-convert-num minutes) tmp))
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 165
diff changeset
936 ((eq elem 'seconds)
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 165
diff changeset
937 (push (display-time-convert-num seconds) tmp))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
938 ((eq elem 'minutes-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
939 (push (display-time-convert-num minutes t) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
940 ((eq elem 'am-pm)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
941 (push (display-time-convert-am-pm am-pm) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
942 ((eq elem 'am-pm-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
943 (push (display-time-convert-am-pm am-pm t) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
944 ((eq elem 'timezone)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
945 (push time-zone tmp))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
946 ((eq elem 'load)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
947 (push (display-time-convert-load load) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
948 ((eq elem 'load-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
949 (push (display-time-convert-load load t) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
950 ((eq elem 'mail)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
951 (push (if mail (display-time-mail-sign)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
952 (display-time-no-mail-sign)) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
953 ((eq elem 'mail-text)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
954 (push (if mail (display-time-mail-sign t)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
955 (display-time-no-mail-sign t)) tmp))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
956 ))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
957 ;; We know that we have a list containing only of strings if
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
958 ;; display-time-echo-area is t. So we construct this string from
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
959 ;; the list. Else we just reverse the list and give it as result.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
960 (if (not display-time-echo-area) (setq result (reverse tmp))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
961 (while (setq elem (pop tmp))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
962 (setq result (concat elem result))))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
963 result))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
964
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
965
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (defvar display-time-string-forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 '((if display-time-day-and-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (format "%s %s %s " dayname monthname day)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (format "%s:%s%s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (if display-time-24hr-format 24-hours 12-hours)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 minutes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (if display-time-24hr-format "" am-pm))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
974 load
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
975 (if mail " Mail" ""))
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
976 "*It will only be used if display-time-compatible is t.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
977 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
978 This expression is a list of expressions that can involve the keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 `load', `day', `month', and `year', `12-hours', `24-hours', `minutes',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 `seconds', all numbers in string form, and `monthname', `dayname', `am-pm',
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
981 and `time-zone' all alphabetic strings and `mail' a true/nil string value.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 For example, the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 '((substring year -2) \"/\" month \"/\" day
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 \" \" 24-hours \":\" minutes \":\" seconds
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 70
diff changeset
987 (if time-zone \" (\") time-zone (if time-zone \")\"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 would give mode line times like `94/12/30 21:07:48 (UTC)'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
991 (make-obsolete-variable 'display-time-string-forms
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
992 "You should use the new facilities for `display-time'.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
993 Look at display-time-form-list.")
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 116
diff changeset
994
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (defun display-time-function ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (let* ((now (current-time))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
997 (nowhigh (* (- (nth 0 now) (* (/ (nth 0 now) 10) 10)) 65536))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (time (current-time-string now))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (load (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (if (zerop (car (load-average))) ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (let ((str (format " %03d" (car (load-average)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (concat (substring str 0 -2) "." (substring str -2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (error "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 (mail-spool-file (or display-time-mail-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 (getenv "MAIL")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (concat rmail-spool-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (user-login-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (mail (and (stringp mail-spool-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (or (null display-time-server-down-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 ;; If have been down for 20 min, try again.
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1011 (> (- (+ (nth 1 now) nowhigh)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 display-time-server-down-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 1200))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (let ((start-time (current-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (display-time-file-nonempty-p mail-spool-file)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1017 (setq now (current-time)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1018 nowhigh (* (- (nth 0 now) (* (/ (nth 0 now) 10) 10)) 65536))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1019 (if (> (- (+ (nth 1 now) nowhigh)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1020 (+ (nth 1 start-time)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1021 (* (- (nth 0 start-time) (* (/ (nth 0 start-time) 10) 10)) 65536)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 ;; Record that mail file is not accessible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (setq display-time-server-down-time
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 126
diff changeset
1025 (+ (nth 1 now) nowhigh))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 ;; Record that mail file is accessible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (setq display-time-server-down-time nil))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (24-hours (substring time 11 13))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (hour (string-to-int 24-hours))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (12-hours (int-to-string (1+ (% (+ hour 11) 12))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (am-pm (if (>= hour 12) "pm" "am"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 (minutes (substring time 14 16))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (seconds (substring time 17 19))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (time-zone (car (cdr (current-time-zone now))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (day (substring time 8 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 (year (substring time 20 24))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (monthname (substring time 4 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (month
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 monthname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 '(("Jan" . "1") ("Feb" . "2") ("Mar" . "3") ("Apr" . "4")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 ("May" . "5") ("Jun" . "6") ("Jul" . "7") ("Aug" . "8")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 ("Sep" . "9") ("Oct" . "10") ("Nov" . "11") ("Dec" . "12")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (dayname (substring time 0 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (setq display-time-string
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1047 (if display-time-compatible
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1048 (mapconcat 'eval display-time-string-forms "")
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 104
diff changeset
1049 (display-time-evaluate-list)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 ;; This is inside the let binding, but we are not going to document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 ;; what variables are available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (run-hooks 'display-time-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (if display-time-echo-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (or (> (minibuffer-depth) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 ;; don't stomp echo-area-buffer if reading from minibuffer now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (select-window (minibuffer-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (erase-buffer)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1060 (indent-to (- (frame-width) (length display-time-string) 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (insert display-time-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (message (buffer-string)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (force-mode-line-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 ;; Do redisplay right now, if no input pending.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 (sit-for 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (defun display-time-file-nonempty-p (file)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1068 (let ((attributes (file-attributes (file-chase-links file))))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1069 (and attributes
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1070 (< 0 (nth 7 attributes))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1071 (or display-time-ignore-read-mail
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1072 (> (car (nth 5 attributes)) (car (nth 4 attributes)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1073 (and (= (car (nth 5 attributes)) (car (nth 4 attributes)))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
1074 (> (cadr (nth 5 attributes)) (cadr (nth 4 attributes))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (provide 'time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 ;;; time.el ends here