summaryrefslogtreecommitdiff
path: root/lisp/calendar/appt.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2004-02-19 01:12:21 +0000
committerGlenn Morris <rgm@gnu.org>2004-02-19 01:12:21 +0000
commita19de6288e63e0622b575f7f66d1cfa97485c5dd (patch)
treee1890f42a96ad45ebecc7fd7ecd37e84ceeea453 /lisp/calendar/appt.el
parente306dc9f58438f7ff796364a7ab7a32947cb0939 (diff)
downloademacs-a19de6288e63e0622b575f7f66d1cfa97485c5dd.tar.gz
(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.
Diffstat (limited to 'lisp/calendar/appt.el')
-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 @@
;;; documentation of the function `appt-check' is required.
;;; Relevant customizable variables are also listed in the
;;; documentation of that function.
-;;;
+;;;
;;; Today's appointment list is initialized from the diary when this
;;; package is activated. Additionally, the appointments list is
;;; recreated automatically at 12:01am for those who do not logout
@@ -121,15 +121,16 @@ If non-nil, this variable overrides `appt-visible'."
(make-obsolete-variable 'appt-msg-window 'appt-display-format "21.4")
;; TODO - add popup.
-(defcustom appt-display-format (cond (appt-msg-window 'window)
- (appt-visible 'echo)
- (t nil))
+(defcustom appt-display-format 'ignore
"How appointment reminders should be displayed.
The options are:
window - use a separate window
echo - use the echo area
nil - no visible reminder.
-See also `appt-audible' and `appt-display-mode-line'."
+See also `appt-audible' and `appt-display-mode-line'.
+
+The default value is 'ignore, which means to fall back on the value
+of the (obsolete) variables `appt-msg-window' and `appt-visible'."
:type '(choice
(const :tag "Separate window" window)
(const :tag "Echo-area" echo)
@@ -222,17 +223,24 @@ If this is non-nil, appointment checking is active.")
The string STRING describes the appointment, due in integer MINS minutes.
The format of the visible reminder is controlled by `appt-display-format'.
The variable `appt-audible' controls the audible reminder."
- (cond ((eq appt-display-format 'window)
- (funcall appt-disp-window-function
- (number-to-string mins)
- (format-time-string "%a %b %e " (current-time))
- string)
- (run-at-time (format "%d sec" appt-display-duration)
- nil
- appt-delete-window-function))
- ((eq appt-display-format 'echo)
- (message "%s" string)))
- (if appt-audible (beep 1)))
+ ;; let binding for backwards compatability. Remove when obsolete
+ ;; vars appt-msg-window and appt-visible are dropped.
+ (let ((appt-display-format
+ (if (eq appt-display-format 'ignore)
+ (cond (appt-msg-window 'window)
+ (appt-visible 'echo))
+ appt-display-format)))
+ (cond ((eq appt-display-format 'window)
+ (funcall appt-disp-window-function
+ (number-to-string mins)
+ (format-time-string "%a %b %e " (current-time))
+ string)
+ (run-at-time (format "%d sec" appt-display-duration)
+ nil
+ appt-delete-window-function))
+ ((eq appt-display-format 'echo)
+ (message "%s" string)))
+ (if appt-audible (beep 1))))
(defun appt-check (&optional force)
@@ -648,9 +656,9 @@ ARG is positive, otherwise off."
(remove-hook 'write-file-functions 'appt-update-list)
(or global-mode-string (setq global-mode-string '("")))
(delq 'appt-mode-string global-mode-string)
- (and appt-timer
- (cancel-timer appt-timer)
- (setq appt-timer nil))
+ (when appt-timer
+ (cancel-timer appt-timer)
+ (setq appt-timer nil))
(when appt-active
(add-hook 'write-file-functions 'appt-update-list)
(setq appt-timer (run-at-time t 60 'appt-check)