aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2004-02-19 01:12:21 +0000
committerGlenn Morris2004-02-19 01:12:21 +0000
commita19de6288e63e0622b575f7f66d1cfa97485c5dd (patch)
treee1890f42a96ad45ebecc7fd7ecd37e84ceeea453
parente306dc9f58438f7ff796364a7ab7a32947cb0939 (diff)
downloademacs-a19de6288e63e0622b575f7f66d1cfa97485c5dd.tar.gz
emacs-a19de6288e63e0622b575f7f66d1cfa97485c5dd.zip
(appt-display-format): Change default to'ignore, for backwards compatability.
(appt-display-message): If appt-display-format is 'ignore, respect old vars appt-msg-window and appt-visible. (appt-activate): Don't depend on return value of cancel-timer.
-rw-r--r--lisp/calendar/appt.el46
1 files changed, 27 insertions, 19 deletions
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index f6e33aeefe0..d002b6fd212 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -43,7 +43,7 @@
43;;; documentation of the function `appt-check' is required. 43;;; documentation of the function `appt-check' is required.
44;;; Relevant customizable variables are also listed in the 44;;; Relevant customizable variables are also listed in the
45;;; documentation of that function. 45;;; documentation of that function.
46;;; 46;;;
47;;; Today's appointment list is initialized from the diary when this 47;;; Today's appointment list is initialized from the diary when this
48;;; package is activated. Additionally, the appointments list is 48;;; package is activated. Additionally, the appointments list is
49;;; recreated automatically at 12:01am for those who do not logout 49;;; recreated automatically at 12:01am for those who do not logout
@@ -121,15 +121,16 @@ If non-nil, this variable overrides `appt-visible'."
121(make-obsolete-variable 'appt-msg-window 'appt-display-format "21.4") 121(make-obsolete-variable 'appt-msg-window 'appt-display-format "21.4")
122 122
123;; TODO - add popup. 123;; TODO - add popup.
124(defcustom appt-display-format (cond (appt-msg-window 'window) 124(defcustom appt-display-format 'ignore
125 (appt-visible 'echo)
126 (t nil))
127 "How appointment reminders should be displayed. 125 "How appointment reminders should be displayed.
128The options are: 126The options are:
129 window - use a separate window 127 window - use a separate window
130 echo - use the echo area 128 echo - use the echo area
131 nil - no visible reminder. 129 nil - no visible reminder.
132See also `appt-audible' and `appt-display-mode-line'." 130See also `appt-audible' and `appt-display-mode-line'.
131
132The default value is 'ignore, which means to fall back on the value
133of the (obsolete) variables `appt-msg-window' and `appt-visible'."
133 :type '(choice 134 :type '(choice
134 (const :tag "Separate window" window) 135 (const :tag "Separate window" window)
135 (const :tag "Echo-area" echo) 136 (const :tag "Echo-area" echo)
@@ -222,17 +223,24 @@ If this is non-nil, appointment checking is active.")
222The string STRING describes the appointment, due in integer MINS minutes. 223The string STRING describes the appointment, due in integer MINS minutes.
223The format of the visible reminder is controlled by `appt-display-format'. 224The format of the visible reminder is controlled by `appt-display-format'.
224The variable `appt-audible' controls the audible reminder." 225The variable `appt-audible' controls the audible reminder."
225 (cond ((eq appt-display-format 'window) 226 ;; let binding for backwards compatability. Remove when obsolete
226 (funcall appt-disp-window-function 227 ;; vars appt-msg-window and appt-visible are dropped.
227 (number-to-string mins) 228 (let ((appt-display-format
228 (format-time-string "%a %b %e " (current-time)) 229 (if (eq appt-display-format 'ignore)
229 string) 230 (cond (appt-msg-window 'window)
230 (run-at-time (format "%d sec" appt-display-duration) 231 (appt-visible 'echo))
231 nil 232 appt-display-format)))
232 appt-delete-window-function)) 233 (cond ((eq appt-display-format 'window)
233 ((eq appt-display-format 'echo) 234 (funcall appt-disp-window-function
234 (message "%s" string))) 235 (number-to-string mins)
235 (if appt-audible (beep 1))) 236 (format-time-string "%a %b %e " (current-time))
237 string)
238 (run-at-time (format "%d sec" appt-display-duration)
239 nil
240 appt-delete-window-function))
241 ((eq appt-display-format 'echo)
242 (message "%s" string)))
243 (if appt-audible (beep 1))))
236 244
237 245
238(defun appt-check (&optional force) 246(defun appt-check (&optional force)
@@ -648,9 +656,9 @@ ARG is positive, otherwise off."
648 (remove-hook 'write-file-functions 'appt-update-list) 656 (remove-hook 'write-file-functions 'appt-update-list)
649 (or global-mode-string (setq global-mode-string '(""))) 657 (or global-mode-string (setq global-mode-string '("")))
650 (delq 'appt-mode-string global-mode-string) 658 (delq 'appt-mode-string global-mode-string)
651 (and appt-timer 659 (when appt-timer
652 (cancel-timer appt-timer) 660 (cancel-timer appt-timer)
653 (setq appt-timer nil)) 661 (setq appt-timer nil))
654 (when appt-active 662 (when appt-active
655 (add-hook 'write-file-functions 'appt-update-list) 663 (add-hook 'write-file-functions 'appt-update-list)
656 (setq appt-timer (run-at-time t 60 'appt-check) 664 (setq appt-timer (run-at-time t 60 'appt-check)