diff options
| author | Glenn Morris | 2006-05-11 06:57:32 +0000 |
|---|---|---|
| committer | Glenn Morris | 2006-05-11 06:57:32 +0000 |
| commit | 21f8fcfd24dc96790589ad578c7ee54593fcfd10 (patch) | |
| tree | b9c8fbe07eaf342206592399a5bf9935d0377cd4 | |
| parent | 68fdbaf800a62bed75e1bb3e9ccf2542ef08a6b2 (diff) | |
| download | emacs-21f8fcfd24dc96790589ad578c7ee54593fcfd10.tar.gz emacs-21f8fcfd24dc96790589ad578c7ee54593fcfd10.zip | |
(calendar-basic-setup): Set day to 1 in
prefix arg case, to avoid view-diary-entries-initially error.
Reported by Stephen Berman <Stephen.Berman at gmx.net>.
(calendar-date-is-legal-p): Handle dates with no day part.
| -rw-r--r-- | lisp/calendar/calendar.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 1383b8bac16..99e39331054 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1374,6 +1374,7 @@ MON defaults to `displayed-month'. YR defaults to `displayed-year'." | |||
| 1374 | "Extract the month part of DATE which has the form (month day year)." | 1374 | "Extract the month part of DATE which has the form (month day year)." |
| 1375 | (car date)) | 1375 | (car date)) |
| 1376 | 1376 | ||
| 1377 | ;; Note gives wrong answer for result of (calendar-read-date 'noday). | ||
| 1377 | (defsubst extract-calendar-day (date) | 1378 | (defsubst extract-calendar-day (date) |
| 1378 | "Extract the day part of DATE which has the form (month day year)." | 1379 | "Extract the day part of DATE which has the form (month day year)." |
| 1379 | (car (cdr date))) | 1380 | (car (cdr date))) |
| @@ -1639,6 +1640,9 @@ to be replaced by asterisks to highlight it whenever it is in the window." | |||
| 1639 | (calendar-current-date))) | 1640 | (calendar-current-date))) |
| 1640 | (month (extract-calendar-month date)) | 1641 | (month (extract-calendar-month date)) |
| 1641 | (year (extract-calendar-year date))) | 1642 | (year (extract-calendar-year date))) |
| 1643 | ;; (calendar-read-date t) returns a date with day = nil, which is | ||
| 1644 | ;; not a legal date for the visible test in the diary section. | ||
| 1645 | (if arg (setcar (cdr date) 1)) | ||
| 1642 | (pop-to-buffer calendar-buffer) | 1646 | (pop-to-buffer calendar-buffer) |
| 1643 | (increment-calendar-month month year (- calendar-offset)) | 1647 | (increment-calendar-month month year (- calendar-offset)) |
| 1644 | (generate-calendar-window month year) | 1648 | (generate-calendar-window month year) |
| @@ -2897,7 +2901,11 @@ interpreted as BC; -1 being 1 BC, and so on." | |||
| 2897 | (day (extract-calendar-day date)) | 2901 | (day (extract-calendar-day date)) |
| 2898 | (year (extract-calendar-year date))) | 2902 | (year (extract-calendar-year date))) |
| 2899 | (and (<= 1 month) (<= month 12) | 2903 | (and (<= 1 month) (<= month 12) |
| 2900 | (<= 1 day) (<= day (calendar-last-day-of-month month year)) | 2904 | ;; (calendar-read-date t) returns a date with day = nil. |
| 2905 | ;; Should not be valid (?), since many funcs prob assume integer. | ||
| 2906 | ;; (calendar-read-date 'noday) returns (month year), which | ||
| 2907 | ;; currently results in extract-calendar-year returning nil. | ||
| 2908 | day year (<= 1 day) (<= day (calendar-last-day-of-month month year)) | ||
| 2901 | ;; BC dates left as non-valid, to suppress errors from | 2909 | ;; BC dates left as non-valid, to suppress errors from |
| 2902 | ;; complex holiday algorithms not suitable for years BC. | 2910 | ;; complex holiday algorithms not suitable for years BC. |
| 2903 | ;; Note there are side effects on calendar navigation. | 2911 | ;; Note there are side effects on calendar navigation. |