189 |
Use `appt-add' and `appt-delete' to add and delete appointments. |
Use `appt-add' and `appt-delete' to add and delete appointments. |
190 |
The original list is generated from today's `diary-entries-list', and |
The original list is generated from today's `diary-entries-list', and |
191 |
can be regenerated using the function `appt-check'. |
can be regenerated using the function `appt-check'. |
192 |
Each element of the generated list has the form (MINUTES) STRING; where |
Each element of the generated list has the form (MINUTES STRING [FLAG]); where |
193 |
MINUTES is the time in minutes of the appointment after midnight, and |
MINUTES is the time in minutes of the appointment after midnight, and |
194 |
STRING is the description of the appointment.") |
STRING is the description of the appointment. |
195 |
|
FLAG, if non-nil, says that the element was made with `appt-add' |
196 |
|
so calling `appt-make-list' again should preserve it.") |
197 |
|
|
198 |
(defconst appt-max-time 1439 |
(defconst appt-max-time 1439 |
199 |
"11:59pm in minutes - number of minutes in a day minus 1.") |
"11:59pm in minutes - number of minutes in a day minus 1.") |
495 |
(error "Unacceptable time-string")) |
(error "Unacceptable time-string")) |
496 |
(let* ((appt-time-string (concat new-appt-time " " new-appt-msg)) |
(let* ((appt-time-string (concat new-appt-time " " new-appt-msg)) |
497 |
(appt-time (list (appt-convert-time new-appt-time))) |
(appt-time (list (appt-convert-time new-appt-time))) |
498 |
(time-msg (cons appt-time (list appt-time-string)))) |
(time-msg (list appt-time appt-time-string t))) |
499 |
(setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg))) |
(setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg))) |
500 |
(setq appt-time-msg-list (appt-sort-list appt-time-msg-list)))) |
(setq appt-time-msg-list (appt-sort-list appt-time-msg-list)))) |
501 |
|
|
527 |
(defvar diary-entries-list)) |
(defvar diary-entries-list)) |
528 |
;;;###autoload |
;;;###autoload |
529 |
(defun appt-make-list () |
(defun appt-make-list () |
530 |
"Create the appointments list from today's diary buffer. |
"Update the appointments list from today's diary buffer. |
531 |
The time must be at the beginning of a line for it to be |
The time must be at the beginning of a line for it to be |
532 |
put in the appointments list (see examples in documentation of |
put in the appointments list (see examples in documentation of |
533 |
the function `appt-check'). We assume that the variables DATE and |
the function `appt-check'). We assume that the variables DATE and |
534 |
NUMBER hold the arguments that `list-diary-entries' received. |
NUMBER hold the arguments that `list-diary-entries' received. |
535 |
They specify the range of dates that the diary is being processed for." |
They specify the range of dates that the diary is being processed for. |
536 |
|
|
537 |
|
Any appointments made with `appt-add' are not affected by this |
538 |
|
function." |
539 |
|
|
540 |
;; We have something to do if the range of dates that the diary is |
;; We have something to do if the range of dates that the diary is |
541 |
;; considering includes the current date. |
;; considering includes the current date. |
549 |
number))))) |
number))))) |
550 |
(save-excursion |
(save-excursion |
551 |
;; Clear the appointments list, then fill it in from the diary. |
;; Clear the appointments list, then fill it in from the diary. |
552 |
(setq appt-time-msg-list nil) |
(dolist (elt appt-time-msg-list) |
553 |
|
;; Delete any entries that were not made with appt-add. |
554 |
|
(unless (nth 2 elt) |
555 |
|
(setq appt-time-msg-list |
556 |
|
(delq elt appt-time-msg-list)))) |
557 |
(if diary-entries-list |
(if diary-entries-list |
558 |
|
|
559 |
;; Cycle through the entry-list (diary-entries-list) |
;; Cycle through the entry-list (diary-entries-list) |