diff options
| author | Glenn Morris | 2008-03-31 01:47:29 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-31 01:47:29 +0000 |
| commit | 34ee3257bd6220b1635a66c7010293ff25e3cd4a (patch) | |
| tree | c5708e9e9c184942dc1e81f1aa109411c83b5ef5 | |
| parent | c8a54cf1aacc41402bf5a231be3783db3de4b762 (diff) | |
| download | emacs-34ee3257bd6220b1635a66c7010293ff25e3cd4a.tar.gz emacs-34ee3257bd6220b1635a66c7010293ff25e3cd4a.zip | |
(calendar-bahai-date-string): Avoid an error for pre-Bahai dates.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/calendar/cal-bahai.el | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a163467b809..0ca01a7c8f4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2008-03-31 Glenn Morris <rgm@gnu.org> | 1 | 2008-03-31 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * calendar/cal-bahai.el (calendar-bahai-date-string): Avoid an error for | ||
| 4 | pre-Bahai dates. | ||
| 5 | |||
| 3 | * calendar/holidays.el (holiday-filter-visible-calendar): Return result | 6 | * calendar/holidays.el (holiday-filter-visible-calendar): Return result |
| 4 | from dolist. | 7 | from dolist. |
| 5 | 8 | ||
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 21978cacbf4..0bf97dd8a93 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el | |||
| @@ -126,8 +126,9 @@ Defaults to today's date if DATE is not given." | |||
| 126 | (y (extract-calendar-year bahai-date)) | 126 | (y (extract-calendar-year bahai-date)) |
| 127 | (m (extract-calendar-month bahai-date)) | 127 | (m (extract-calendar-month bahai-date)) |
| 128 | (d (extract-calendar-day bahai-date)) | 128 | (d (extract-calendar-day bahai-date)) |
| 129 | (monthname (if (and (= m 19) | 129 | (monthname (if (or (< m 1) ; pre-Bahai, avoid aref error |
| 130 | (<= d 0)) | 130 | (and (= m 19) |
| 131 | (<= d 0))) | ||
| 131 | "Ayyám-i-Há" | 132 | "Ayyám-i-Há" |
| 132 | (aref calendar-bahai-month-name-array (1- m)))) | 133 | (aref calendar-bahai-month-name-array (1- m)))) |
| 133 | (day (int-to-string | 134 | (day (int-to-string |
| @@ -195,6 +196,7 @@ Reads a year, month and day." | |||
| 195 | (defvar displayed-month) | 196 | (defvar displayed-month) |
| 196 | (defvar displayed-year) | 197 | (defvar displayed-year) |
| 197 | 198 | ||
| 199 | ;; FIXME same as islamic. | ||
| 198 | ;;;###holiday-autoload | 200 | ;;;###holiday-autoload |
| 199 | (defun holiday-bahai (month day string) | 201 | (defun holiday-bahai (month day string) |
| 200 | "Holiday on MONTH, DAY (Bahá'í) called STRING. | 202 | "Holiday on MONTH, DAY (Bahá'í) called STRING. |
| @@ -208,6 +210,8 @@ nil if it is not visible in the current calendar window." | |||
| 208 | (y (extract-calendar-year bahai-date)) | 210 | (y (extract-calendar-year bahai-date)) |
| 209 | date) | 211 | date) |
| 210 | (unless (< m 1) ; Bahá'í calendar doesn't apply | 212 | (unless (< m 1) ; Bahá'í calendar doesn't apply |
| 213 | ;; FIXME makes no sense (?), since there are not 12 months in a year. | ||
| 214 | ;; Suspect this was copied from cal-islam. | ||
| 211 | (increment-calendar-month m y (- 10 month)) | 215 | (increment-calendar-month m y (- 10 month)) |
| 212 | (if (> m 7) ; Bahá'í date might be visible | 216 | (if (> m 7) ; Bahá'í date might be visible |
| 213 | (let ((date (calendar-gregorian-from-absolute | 217 | (let ((date (calendar-gregorian-from-absolute |