X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bbd347f5f7e99da1a559dad818b5fa8f59c0901e..8a10ab0299469dc5a0da8167df4ab13593ed6c00:/lisp/calendar/holidays.el diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 9edd353b88..9643a1e290 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -250,7 +250,7 @@ See the documentation for `calendar-holidays' for details." (if calendar-christian-all-holidays-flag (append (holiday-fixed 1 6 "Epiphany") - (holiday-julian 12 25 "Eastern Orthodox Christmas") + (holiday-julian 12 25 "Christmas (Julian calendar)") (holiday-greek-orthodox-easter) (holiday-fixed 8 15 "Assumption") (holiday-advent 0 "Advent"))))) @@ -458,17 +458,20 @@ with descriptive strings such as (defun calendar-holiday-list () "Form the list of holidays that occur on dates in the calendar window. The holidays are those in the list `calendar-holidays'." - (let (res h) + (let (res h err) (sort (dolist (p calendar-holidays res) (if (setq h (if calendar-debug-sexp (let ((debug-on-error t)) (eval p)) - (condition-case nil + (condition-case err (eval p) - (error (beep) - (message "Bad holiday list item: %s" p) - (sleep-for 2))))) + (error + (display-warning + :error + (format "Bad holiday list item: %s\nError: %s\n" + p err)) + nil)))) (setq res (append h res)))) 'calendar-date-compare))) @@ -645,6 +648,33 @@ strings describing those holidays that apply on DATE, or nil if none do." (define-obsolete-function-alias 'check-calendar-holidays 'calendar-check-holidays "23.1") + +;; Formerly cal-tex-list-holidays. +(defun holiday-in-range (d1 d2) + "Generate a list of all holidays in range from absolute date D1 to D2." + (let* ((start (calendar-gregorian-from-absolute d1)) + (displayed-month (calendar-extract-month start)) + (displayed-year (calendar-extract-year start)) + (end (calendar-gregorian-from-absolute d2)) + (end-month (calendar-extract-month end)) + (end-year (calendar-extract-year end)) + (number-of-intervals + (1+ (/ (calendar-interval displayed-month displayed-year + end-month end-year) + 3))) + holidays in-range a) + (calendar-increment-month displayed-month displayed-year 1) + (dotimes (_idummy number-of-intervals) + (setq holidays (append holidays (calendar-holiday-list))) + (calendar-increment-month displayed-month displayed-year 3)) + (dolist (hol holidays) + (and (car hol) + (setq a (calendar-absolute-from-gregorian (car hol))) + (and (<= d1 a) (<= a d2)) + (setq in-range (append (list hol) in-range)))) + in-range)) + + (declare-function x-popup-menu "menu.c" (position menu)) ;;;###cal-autoload