summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2006-05-11 06:57:32 +0000
committerGlenn Morris <rgm@gnu.org>2006-05-11 06:57:32 +0000
commit97bd933b8dcd1ccccc9e3b6b6c64d63803bacc9e (patch)
tree879e11441bfd81e543cf52a8eb4f2c4231a0bdbd /lisp
parentcde92efe2801e1aec4606daa9532b3c9aefb5200 (diff)
downloademacs-97bd933b8dcd1ccccc9e3b6b6c64d63803bacc9e.tar.gz
(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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/calendar.el10
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'."
"Extract the month part of DATE which has the form (month day year)."
(car date))
+;; Note gives wrong answer for result of (calendar-read-date 'noday).
(defsubst extract-calendar-day (date)
"Extract the day part of DATE which has the form (month day year)."
(car (cdr date)))
@@ -1639,6 +1640,9 @@ to be replaced by asterisks to highlight it whenever it is in the window."
(calendar-current-date)))
(month (extract-calendar-month date))
(year (extract-calendar-year date)))
+ ;; (calendar-read-date t) returns a date with day = nil, which is
+ ;; not a legal date for the visible test in the diary section.
+ (if arg (setcar (cdr date) 1))
(pop-to-buffer calendar-buffer)
(increment-calendar-month month year (- calendar-offset))
(generate-calendar-window month year)
@@ -2897,7 +2901,11 @@ interpreted as BC; -1 being 1 BC, and so on."
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(and (<= 1 month) (<= month 12)
- (<= 1 day) (<= day (calendar-last-day-of-month month year))
+ ;; (calendar-read-date t) returns a date with day = nil.
+ ;; Should not be valid (?), since many funcs prob assume integer.
+ ;; (calendar-read-date 'noday) returns (month year), which
+ ;; currently results in extract-calendar-year returning nil.
+ day year (<= 1 day) (<= day (calendar-last-day-of-month month year))
;; BC dates left as non-valid, to suppress errors from
;; complex holiday algorithms not suitable for years BC.
;; Note there are side effects on calendar navigation.