Mercurial > emacs
comparison lisp/calendar/calendar.el @ 60922:4e6ed80c0af2
* calendar/calendar.el: Replace `legal' with `valid'.
author | Werner LEMBERG <wl@gnu.org> |
---|---|
date | Fri, 25 Mar 2005 09:53:47 +0000 |
parents | 3a754b1548d3 |
children | 7f7db25577d9 |
comparison
equal
deleted
inserted
replaced
60921:78e08044a734 | 60922:4e6ed80c0af2 |
---|---|
2882 (setq mark-holidays-in-calendar nil) | 2882 (setq mark-holidays-in-calendar nil) |
2883 (setq mark-diary-entries-in-calendar nil) | 2883 (setq mark-diary-entries-in-calendar nil) |
2884 (redraw-calendar)) | 2884 (redraw-calendar)) |
2885 | 2885 |
2886 (defun calendar-date-is-visible-p (date) | 2886 (defun calendar-date-is-visible-p (date) |
2887 "Return t if DATE is legal and is visible in the calendar window." | 2887 "Return t if DATE is valid and is visible in the calendar window." |
2888 (let ((gap (calendar-interval | 2888 (let ((gap (calendar-interval |
2889 displayed-month displayed-year | 2889 displayed-month displayed-year |
2890 (extract-calendar-month date) (extract-calendar-year date)))) | 2890 (extract-calendar-month date) (extract-calendar-year date)))) |
2891 (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) | 2891 (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) |
2892 | 2892 |
2893 (defun calendar-date-is-legal-p (date) | 2893 (defun calendar-date-is-legal-p (date) |
2894 "Return t if DATE is a legal date." | 2894 "Return t if DATE is a valid date." |
2895 (let ((month (extract-calendar-month date)) | 2895 (let ((month (extract-calendar-month date)) |
2896 (day (extract-calendar-day date)) | 2896 (day (extract-calendar-day date)) |
2897 (year (extract-calendar-year date))) | 2897 (year (extract-calendar-year date))) |
2898 (and (<= 1 month) (<= month 12) | 2898 (and (<= 1 month) (<= month 12) |
2899 (<= 1 day) (<= day (calendar-last-day-of-month month year)) | 2899 (<= 1 day) (<= day (calendar-last-day-of-month month year)) |
2900 ;; BC dates left as non-legal, to suppress errors from | 2900 ;; BC dates left as non-valid, to suppress errors from |
2901 ;; complex holiday algorithms not suitable for years BC. | 2901 ;; complex holiday algorithms not suitable for years BC. |
2902 ;; Note there are side effects on calendar navigation. | 2902 ;; Note there are side effects on calendar navigation. |
2903 (<= 1 year)))) | 2903 (<= 1 year)))) |
2904 | 2904 |
2905 (defun calendar-date-equal (date1 date2) | 2905 (defun calendar-date-equal (date1 date2) |