diff options
| author | Richard M. Stallman | 2002-08-12 17:21:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-08-12 17:21:06 +0000 |
| commit | 4e96d63b414ca1163e5d1804b5bd9888d4c0286b (patch) | |
| tree | 9d9e2cfe5384021eb55dcd3ad1627e641e0686dd /lisp | |
| parent | 5883787cd6e7b35636ff9928c2c21022906bb8da (diff) | |
| download | emacs-4e96d63b414ca1163e5d1804b5bd9888d4c0286b.tar.gz emacs-4e96d63b414ca1163e5d1804b5bd9888d4c0286b.zip | |
(appt-make-list): Correct the parsing of each appointment from time-string.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/calendar/appt.el | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 5e903eead40..dbf34107829 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el | |||
| @@ -516,26 +516,30 @@ They specify the range of dates that the diary is being processed for." | |||
| 516 | (cadr (car entry-list))) 1 -1))) | 516 | (cadr (car entry-list))) 1 -1))) |
| 517 | 517 | ||
| 518 | (while (string-match | 518 | (while (string-match |
| 519 | "[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\(.*\n\\)*.*" | 519 | "\\([0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\).*" |
| 520 | time-string) | 520 | time-string) |
| 521 | (let* ((appt-time-string (match-string 0 time-string))) | 521 | (let* ((beg (match-beginning 0)) |
| 522 | 522 | ;; Get just the time for this appointment. | |
| 523 | (if (< (match-end 0) (length time-string)) | 523 | (only-time (match-string 1 time-string)) |
| 524 | (setq new-time-string (substring time-string | 524 | ;; Find the end of this appointment |
| 525 | (+ (match-end 0) 1) | 525 | ;; (the start of the next). |
| 526 | nil)) | 526 | (end (string-match |
| 527 | (setq new-time-string "")) | 527 | "^[ \t]*[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?" |
| 528 | 528 | time-string | |
| 529 | (string-match "[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?" | 529 | (match-end 0))) |
| 530 | time-string) | 530 | ;; Get the whole string for this appointment. |
| 531 | 531 | (appt-time-string | |
| 532 | (let* ((appt-time (list (appt-convert-time | 532 | (substring time-string beg (if end (1- end))))) |
| 533 | (match-string 0 time-string)))) | 533 | |
| 534 | (time-msg (cons appt-time | 534 | ;; Add this appointment to appt-time-msg-list. |
| 535 | (list appt-time-string)))) | 535 | (let* ((appt-time (list (appt-convert-time only-time))) |
| 536 | (setq time-string new-time-string) | 536 | (time-msg (list appt-time appt-time-string))) |
| 537 | (setq appt-time-msg-list (nconc appt-time-msg-list | 537 | (setq appt-time-msg-list |
| 538 | (list time-msg))))))) | 538 | (nconc appt-time-msg-list (list time-msg)))) |
| 539 | |||
| 540 | ;; Discard this appointment from the string. | ||
| 541 | (setq time-string | ||
| 542 | (if end (substring time-string end) ""))))) | ||
| 539 | (setq entry-list (cdr entry-list))))) | 543 | (setq entry-list (cdr entry-list))))) |
| 540 | (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)) | 544 | (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)) |
| 541 | 545 | ||