annotate lisp/packages/time.el @ 169:15872534500d r20-3b11

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