/[emacs]/emacs/lisp/calendar/holidays.el
ViewVC logotype

Diff of /emacs/lisp/calendar/holidays.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by gm, Wed Sep 22 23:19:58 2004 UTC revision 1.38 by gm, Tue Dec 7 00:46:08 2004 UTC
# Line 414  date.  If date is nil, or if the date is Line 414  date.  If date is nil, or if the date is
414        (if (calendar-date-is-visible-p advent)        (if (calendar-date-is-visible-p advent)
415            (list (list advent string))))))            (list (list advent string))))))
416    
417  (defun holiday-easter-etc (n string)  (defun holiday-easter-etc (&optional n string)
418    "Date of Nth day after Easter (named STRING), if visible in calendar window."    "Date of Nth day after Easter (named STRING), if visible in calendar window.
419    (let* ((century (1+ (/ displayed-year 100)))  Negative values of N are interpreted as days before Easter.
420           (shifted-epact        ;; Age of moon for April 5...  STRING is used purely for display purposes.  The return value has
421            (% (+ 14 (* 11 (% displayed-year 19));;     ...by Nicaean rule  the form ((MONTH DAY YEAR) STRING), where the date is that of the
422                  (-           ;; ...corrected for the Gregorian century rule  Nth day before or after Easter.
423                   (/ (* 3 century) 4))  
424                  (/    ;; ...corrected for Metonic cycle inaccuracy.  For backwards compatability, if this function is called with no
425                   (+ 5 (* 8 century)) 25)  arguments, then it returns a list of \"standard\" Easter-related
426                  (* 30 century));;              Keeps value positive.  holidays (with more entries if `all-christian-calendar-holidays'
427               30))  is non-nil)."
428           (adjusted-epact       ;;  Adjust for 29.5 day month.    ;; Backwards compatability layer.
429            (if (or (= shifted-epact 0)    (if (not n)
430                    (and (= shifted-epact 1) (< 10 (% displayed-year 19))))        (let (res-list res)
431                (1+ shifted-epact)          (dolist (elem (append
432              shifted-epact))                         (if all-christian-calendar-holidays
433           (paschal-moon       ;; Day after the full moon on or after March 21.                             '((-63 . "Septuagesima Sunday")
434            (- (calendar-absolute-from-gregorian (list 4 19 displayed-year))                               (-56 . "Sexagesima Sunday")
435               adjusted-epact))                               (-49 . "Shrove Sunday")
436           (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))                               (-48 . "Shrove Monday")
437           (mandatory                               (-47 . "Shrove Tuesday")
438             (list                               (-14 . "Passion Sunday")
439              (list (calendar-gregorian-from-absolute (+ abs-easter n))                               (-7 . "Palm Sunday")
440                    string)))                               (-3 . "Maundy Thursday")
441           (output-list (filter-visible-calendar-holidays mandatory)))                               (35 . "Rogation Sunday")
442      output-list))                               (39 . "Ascension Day")
443                                 (49 . "Pentecost (Whitsunday)")
444                                 (50 . "Whitmonday")
445                                 (56 . "Trinity Sunday")
446                                 (60 . "Corpus Christi")))
447                           '((0 . "Easter Sunday")
448                             (-2 . "Good Friday")
449                             (-46 . "Ash Wednesday")))
450                          res-list)
451              ;; Filter out nil (not visible) values.
452              (if (setq res (holiday-easter-etc (car elem) (cdr elem)))
453                  (setq res-list (append res res-list)))))
454        (let* ((century (1+ (/ displayed-year 100)))
455               (shifted-epact ;; Age of moon for April 5...
456                (% (+ 14 (* 11 (% displayed-year 19)) ;;     ...by Nicaean rule
457                      (- ;; ...corrected for the Gregorian century rule
458                       (/ (* 3 century) 4))
459                      (/ ;; ...corrected for Metonic cycle inaccuracy.
460                       (+ 5 (* 8 century)) 25)
461                      (* 30 century)) ;;              Keeps value positive.
462                   30))
463               (adjusted-epact ;;  Adjust for 29.5 day month.
464                (if (or (zerop shifted-epact)
465                        (and (= shifted-epact 1) (< 10 (% displayed-year 19))))
466                    (1+ shifted-epact)
467                  shifted-epact))
468               (paschal-moon ;; Day after the full moon on or after March 21.
469                (- (calendar-absolute-from-gregorian (list 4 19 displayed-year))
470                   adjusted-epact))
471               (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
472          (filter-visible-calendar-holidays
473           (list (list (calendar-gregorian-from-absolute (+ abs-easter n))
474                       string))))))
475    
476  (defun holiday-greek-orthodox-easter ()  (defun holiday-greek-orthodox-easter ()
477    "Date of Easter according to the rule of the Council of Nicaea."    "Date of Easter according to the rule of the Council of Nicaea."

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26