diff options
| author | Glenn Morris | 2004-09-22 23:19:58 +0000 |
|---|---|---|
| committer | Glenn Morris | 2004-09-22 23:19:58 +0000 |
| commit | 1a499493553aac97b1faa13be89e0f846785ce40 (patch) | |
| tree | 33d85ec112a2eafcab5e464a95ad0d14d94cf3ef | |
| parent | b48bc937991d7e8d2676a842a9b784f91e62ffa1 (diff) | |
| download | emacs-1a499493553aac97b1faa13be89e0f846785ce40.tar.gz emacs-1a499493553aac97b1faa13be89e0f846785ce40.zip | |
Update copyright, and add missing centuries.
Update maintainer.
From H�n Malmedal <hmalmedal@yahoo.no>:
(holiday-advent): Report on a specified day offset from advent, not
just advent.
(holiday-easter-etc): Report on one specified day offset from easter,
not all easter holidays. Various Easter holidays moved to
`christian-holidays' variable in calendar.el.
| -rw-r--r-- | lisp/calendar/holidays.el | 112 |
1 files changed, 37 insertions, 75 deletions
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 71f73f24b75..a1adc080b2f 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | ;;; holidays.el --- holiday functions for the calendar package | 1 | ;;; holidays.el --- holiday functions for the calendar package |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1989, 90, 92, 93, 94, 1997 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2004 Free |
| 4 | ;; Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | 6 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> |
| 7 | ;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 6 | ;; Keywords: holidays, calendar | 8 | ;; Keywords: holidays, calendar |
| 7 | 9 | ||
| 8 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| @@ -398,86 +400,46 @@ date. If date is nil, or if the date is not visible, there is no holiday." | |||
| 398 | (string (if date (eval string)))) | 400 | (string (if date (eval string)))) |
| 399 | (list (list date string))))))) | 401 | (list (list date string))))))) |
| 400 | 402 | ||
| 401 | (defun holiday-advent () | 403 | (defun holiday-advent (n string) |
| 402 | "Date of Advent, if visible in calendar window." | 404 | "Date of Nth day after advent (named STRING), if visible in calendar window." |
| 403 | (let ((year displayed-year) | 405 | (let ((year displayed-year) |
| 404 | (month displayed-month)) | 406 | (month displayed-month)) |
| 405 | (increment-calendar-month month year -1) | 407 | (increment-calendar-month month year -1) |
| 406 | (let ((advent (calendar-gregorian-from-absolute | 408 | (let ((advent (calendar-gregorian-from-absolute |
| 407 | (calendar-dayname-on-or-before 0 | 409 | (+ n |
| 408 | (calendar-absolute-from-gregorian | 410 | (calendar-dayname-on-or-before |
| 409 | (list 12 3 year)))))) | 411 | 0 |
| 412 | (calendar-absolute-from-gregorian | ||
| 413 | (list 12 3 year))))))) | ||
| 410 | (if (calendar-date-is-visible-p advent) | 414 | (if (calendar-date-is-visible-p advent) |
| 411 | (list (list advent "Advent")))))) | 415 | (list (list advent string)))))) |
| 412 | 416 | ||
| 413 | (defun holiday-easter-etc () | 417 | (defun holiday-easter-etc (n string) |
| 414 | "List of dates related to Easter, as visible in calendar window." | 418 | "Date of Nth day after Easter (named STRING), if visible in calendar window." |
| 415 | (if (and (> displayed-month 5) (not all-christian-calendar-holidays)) | 419 | (let* ((century (1+ (/ displayed-year 100))) |
| 416 | nil;; Ash Wednesday, Good Friday, and Easter are not visible. | 420 | (shifted-epact ;; Age of moon for April 5... |
| 417 | (let* ((century (1+ (/ displayed-year 100))) | 421 | (% (+ 14 (* 11 (% displayed-year 19));; ...by Nicaean rule |
| 418 | (shifted-epact ;; Age of moon for April 5... | 422 | (- ;; ...corrected for the Gregorian century rule |
| 419 | (% (+ 14 (* 11 (% displayed-year 19));; ...by Nicaean rule | 423 | (/ (* 3 century) 4)) |
| 420 | (- ;; ...corrected for the Gregorian century rule | 424 | (/ ;; ...corrected for Metonic cycle inaccuracy. |
| 421 | (/ (* 3 century) 4)) | 425 | (+ 5 (* 8 century)) 25) |
| 422 | (/ ;; ...corrected for Metonic cycle inaccuracy. | 426 | (* 30 century));; Keeps value positive. |
| 423 | (+ 5 (* 8 century)) 25) | 427 | 30)) |
| 424 | (* 30 century));; Keeps value positive. | 428 | (adjusted-epact ;; Adjust for 29.5 day month. |
| 425 | 30)) | 429 | (if (or (= shifted-epact 0) |
| 426 | (adjusted-epact ;; Adjust for 29.5 day month. | 430 | (and (= shifted-epact 1) (< 10 (% displayed-year 19)))) |
| 427 | (if (or (= shifted-epact 0) | 431 | (1+ shifted-epact) |
| 428 | (and (= shifted-epact 1) (< 10 (% displayed-year 19)))) | 432 | shifted-epact)) |
| 429 | (1+ shifted-epact) | 433 | (paschal-moon ;; Day after the full moon on or after March 21. |
| 430 | shifted-epact)) | 434 | (- (calendar-absolute-from-gregorian (list 4 19 displayed-year)) |
| 431 | (paschal-moon ;; Day after the full moon on or after March 21. | 435 | adjusted-epact)) |
| 432 | (- (calendar-absolute-from-gregorian (list 4 19 displayed-year)) | 436 | (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))) |
| 433 | adjusted-epact)) | 437 | (mandatory |
| 434 | (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))) | ||
| 435 | (mandatory | ||
| 436 | (list | 438 | (list |
| 437 | (list (calendar-gregorian-from-absolute abs-easter) | 439 | (list (calendar-gregorian-from-absolute (+ abs-easter n)) |
| 438 | "Easter Sunday") | 440 | string))) |
| 439 | (list (calendar-gregorian-from-absolute (- abs-easter 2)) | 441 | (output-list (filter-visible-calendar-holidays mandatory))) |
| 440 | "Good Friday") | 442 | output-list)) |
| 441 | (list (calendar-gregorian-from-absolute (- abs-easter 46)) | ||
| 442 | "Ash Wednesday"))) | ||
| 443 | (optional | ||
| 444 | (list | ||
| 445 | (list (calendar-gregorian-from-absolute (- abs-easter 63)) | ||
| 446 | "Septuagesima Sunday") | ||
| 447 | (list (calendar-gregorian-from-absolute (- abs-easter 56)) | ||
| 448 | "Sexagesima Sunday") | ||
| 449 | (list (calendar-gregorian-from-absolute (- abs-easter 49)) | ||
| 450 | "Shrove Sunday") | ||
| 451 | (list (calendar-gregorian-from-absolute (- abs-easter 48)) | ||
| 452 | "Shrove Monday") | ||
| 453 | (list (calendar-gregorian-from-absolute (- abs-easter 47)) | ||
| 454 | "Shrove Tuesday") | ||
| 455 | (list (calendar-gregorian-from-absolute (- abs-easter 14)) | ||
| 456 | "Passion Sunday") | ||
| 457 | (list (calendar-gregorian-from-absolute (- abs-easter 7)) | ||
| 458 | "Palm Sunday") | ||
| 459 | (list (calendar-gregorian-from-absolute (- abs-easter 3)) | ||
| 460 | "Maundy Thursday") | ||
| 461 | (list (calendar-gregorian-from-absolute (+ abs-easter 35)) | ||
| 462 | "Rogation Sunday") | ||
| 463 | (list (calendar-gregorian-from-absolute (+ abs-easter 39)) | ||
| 464 | "Ascension Day") | ||
| 465 | (list (calendar-gregorian-from-absolute (+ abs-easter 49)) | ||
| 466 | "Pentecost (Whitsunday)") | ||
| 467 | (list (calendar-gregorian-from-absolute (+ abs-easter 50)) | ||
| 468 | "Whitmonday") | ||
| 469 | (list (calendar-gregorian-from-absolute (+ abs-easter 56)) | ||
| 470 | "Trinity Sunday") | ||
| 471 | (list (calendar-gregorian-from-absolute (+ abs-easter 60)) | ||
| 472 | "Corpus Christi"))) | ||
| 473 | (output-list | ||
| 474 | (filter-visible-calendar-holidays mandatory))) | ||
| 475 | (if all-christian-calendar-holidays | ||
| 476 | (setq output-list | ||
| 477 | (append | ||
| 478 | (filter-visible-calendar-holidays optional) | ||
| 479 | output-list))) | ||
| 480 | output-list))) | ||
| 481 | 443 | ||
| 482 | (defun holiday-greek-orthodox-easter () | 444 | (defun holiday-greek-orthodox-easter () |
| 483 | "Date of Easter according to the rule of the Council of Nicaea." | 445 | "Date of Easter according to the rule of the Council of Nicaea." |