;;; appt.el --- appointment notification functions
-;; Copyright (C) 1989, 1990, 1994, 1998, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1990, 1994, 1998, 2001, 2002, 2003, 2004, 2005,
+;; 2006 Free Software Foundation, Inc.
;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
-;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
+;; Maintainer: Glenn Morris <rgm@gnu.org>
;; Keywords: calendar
;; This file is part of GNU Emacs.
;; Make sure calendar is loaded when we compile this.
(require 'calendar)
+(defvar diary-selective-display)
;;;###autoload
(defcustom appt-issue-message t
:type '(choice
(const :tag "Separate window" window)
(const :tag "Echo-area" echo)
- (const :tag "No visible display" nil))
+ (const :tag "No visible display" nil)
+ (const :tag "Backwards compatibility setting - choose another value"
+ ignore))
:group 'appt
:version "22.1")
(cond ((eq appt-display-format 'window)
(funcall appt-disp-window-function
(number-to-string mins)
+ ;; TODO - use calendar-month-abbrev-array rather
+ ;; than %b?
(format-time-string "%a %b %e " (current-time))
string)
(run-at-time (format "%d sec" appt-display-duration)
diary-hook
(cons 'appt-make-list diary-hook))))
(diary))
- (let ((diary-display-hook 'appt-make-list)
- (d-buff (find-buffer-visiting
- (substitute-in-file-name diary-file)))
- selective)
- (if d-buff ; diary buffer exists
- (with-current-buffer d-buff
- (setq selective selective-display)))
+ (let* ((diary-display-hook 'appt-make-list)
+ (d-buff (find-buffer-visiting
+ (substitute-in-file-name diary-file)))
+ (selective
+ (if d-buff ; Diary buffer exists.
+ (with-current-buffer d-buff
+ diary-selective-display))))
(diary)
;; If the diary buffer existed before this command,
;; restore its display state. Otherwise, kill it.
(if d-buff
;; Displays the diary buffer.
- (or selective (show-all-diary-entries))
+ (or selective (diary-show-all-entries))
(and
(setq d-buff (find-buffer-visiting
(substitute-in-file-name diary-file)))
(if (and (< appt-comp-time appt-message-warning-time)
(> (+ cur-comp-time appt-message-warning-time)
appt-max-time))
- (setq min-to-app (+ (- (1+ appt-max-time) cur-comp-time))
- appt-comp-time))
+ (setq min-to-app (+ (- (1+ appt-max-time) cur-comp-time)
+ appt-comp-time)))
;; issue warning if the appointment time is
;; within appt-message-warning time
(interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
(unless (string-match appt-time-regexp new-appt-time)
(error "Unacceptable time-string"))
- (let* ((appt-time-string (concat new-appt-time " " new-appt-msg))
- (appt-time (list (appt-convert-time new-appt-time)))
- (time-msg (list appt-time appt-time-string t)))
- (setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg)))
- (setq appt-time-msg-list (appt-sort-list appt-time-msg-list))))
+ (let ((time-msg (list (list (appt-convert-time new-appt-time))
+ (concat new-appt-time " " new-appt-msg) t)))
+ (unless (member time-msg appt-time-msg-list)
+ (setq appt-time-msg-list
+ (appt-sort-list (nconc appt-time-msg-list (list time-msg)))))))
;;;###autoload
(defun appt-delete ()
The time must be at the beginning of a line for it to be
put in the appointments list (see examples in documentation of
the function `appt-check'). We assume that the variables DATE and
-NUMBER hold the arguments that `list-diary-entries' received.
+NUMBER hold the arguments that `diary-list-entries' received.
They specify the range of dates that the diary is being processed for.
Any appointments made with `appt-add' are not affected by this