# HG changeset patch # User Glenn Morris # Date 1102381082 0 # Node ID 9fcc0f024a83d223dc1348288b9c6bfdd4406fe7 # Parent e08266495ac8410e876bf9adb4047a62593021b4 (holiday-advent): Make arguments optional for backwards compatability. Doc fix. diff -r e08266495ac8 -r 9fcc0f024a83 lisp/calendar/holidays.el --- a/lisp/calendar/holidays.el Tue Dec 07 00:57:30 2004 +0000 +++ b/lisp/calendar/holidays.el Tue Dec 07 00:58:02 2004 +0000 @@ -400,19 +400,29 @@ (string (if date (eval string)))) (list (list date string))))))) -(defun holiday-advent (n string) - "Date of Nth day after advent (named STRING), if visible in calendar window." - (let ((year displayed-year) - (month displayed-month)) - (increment-calendar-month month year -1) - (let ((advent (calendar-gregorian-from-absolute - (+ n - (calendar-dayname-on-or-before - 0 - (calendar-absolute-from-gregorian - (list 12 3 year))))))) - (if (calendar-date-is-visible-p advent) - (list (list advent string)))))) +(defun holiday-advent (&optional n string) + "Date of Nth day after advent (named STRING), if visible in calendar window. +Negative values of N are interpreted as days before advent. +STRING is used purely for display purposes. The return value has +the form ((MONTH DAY YEAR) STRING), where the date is that of the +Nth day before or after advent. + +For backwards compatability, if this function is called with no +arguments, then it returns the value appropriate for advent itself." + ;; Backwards compatability layer. + (if (not n) + (holiday-advent 0 "Advent") + (let ((year displayed-year) + (month displayed-month)) + (increment-calendar-month month year -1) + (let ((advent (calendar-gregorian-from-absolute + (+ n + (calendar-dayname-on-or-before + 0 + (calendar-absolute-from-gregorian + (list 12 3 year))))))) + (if (calendar-date-is-visible-p advent) + (list (list advent string))))))) (defun holiday-easter-etc (&optional n string) "Date of Nth day after Easter (named STRING), if visible in calendar window.