diff options
| author | Paul Eggert | 2015-08-13 12:16:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-08-13 12:17:50 -0700 |
| commit | b532875a6021cd1715321dda932b187522840944 (patch) | |
| tree | 33b6c2d8b43dc68efe2463325262d55fca9ea988 | |
| parent | 57adf425f511b90153f128e7679b5f432df13fb5 (diff) | |
| download | emacs-b532875a6021cd1715321dda932b187522840944.tar.gz emacs-b532875a6021cd1715321dda932b187522840944.zip | |
Optional args for holiday-greek-orthodox-easter
* etc/NEWS: Document this.
* lisp/calendar/holidays.el (holiday-greek-orthodox-easter):
Add optional args N and STRING, mimicking the API and code of
‘holiday-easter-etc’. From suggestion by Foivos S. Zakkak (Bug#21256).
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/calendar/holidays.el | 21 |
2 files changed, 17 insertions, 7 deletions
| @@ -552,6 +552,9 @@ The option customizes which day headers receive the | |||
| 552 | `calendar-weekend-header' face. | 552 | `calendar-weekend-header' face. |
| 553 | 553 | ||
| 554 | --- | 554 | --- |
| 555 | *** New optional args N and STRING for ‘holiday-greek-orthodox-easter’. | ||
| 556 | |||
| 557 | --- | ||
| 555 | *** Many items obsolete since at least version 23.1 have been removed. | 558 | *** Many items obsolete since at least version 23.1 have been removed. |
| 556 | The majority were function/variable/face aliases, too numerous to list here. | 559 | The majority were function/variable/face aliases, too numerous to list here. |
| 557 | The remainder were: | 560 | The remainder were: |
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 8085c1cf119..6d7cea6b8c5 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -791,8 +791,16 @@ is non-nil)." | |||
| 791 | ;; Prior call to calendar-julian-from-absolute will autoload cal-julian. | 791 | ;; Prior call to calendar-julian-from-absolute will autoload cal-julian. |
| 792 | (declare-function calendar-julian-to-absolute "cal-julian" (date)) | 792 | (declare-function calendar-julian-to-absolute "cal-julian" (date)) |
| 793 | 793 | ||
| 794 | (defun holiday-greek-orthodox-easter () | 794 | (defun holiday-greek-orthodox-easter (&optional n string) |
| 795 | "Date of Easter according to the rule of the Council of Nicaea." | 795 | "Date of Nth day after Easter (named STRING), if visible in calendar window. |
| 796 | It is calculated according to the rule of the Council of Nicaea. | ||
| 797 | Negative values of N are interpreted as days before Easter. | ||
| 798 | STRING is used purely for display purposes. The return value has | ||
| 799 | the form ((MONTH DAY YEAR) STRING), where the date is that of the | ||
| 800 | Nth day before or after Easter. | ||
| 801 | |||
| 802 | For backwards compatibility, if this function is called with no | ||
| 803 | arguments, it returns the date of Pascha (Greek Orthodox Easter)." | ||
| 796 | (let* ((m displayed-month) | 804 | (let* ((m displayed-month) |
| 797 | (y displayed-year) | 805 | (y displayed-year) |
| 798 | (julian-year (progn | 806 | (julian-year (progn |
| @@ -808,11 +816,10 @@ is non-nil)." | |||
| 808 | (paschal-moon ; day after full moon on or after March 21 | 816 | (paschal-moon ; day after full moon on or after March 21 |
| 809 | (- (calendar-julian-to-absolute (list 4 19 julian-year)) | 817 | (- (calendar-julian-to-absolute (list 4 19 julian-year)) |
| 810 | shifted-epact)) | 818 | shifted-epact)) |
| 811 | (nicaean-easter ; Sunday following the Paschal moon | 819 | (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))) |
| 812 | (calendar-gregorian-from-absolute | 820 | (greg (calendar-gregorian-from-absolute (+ abs-easter (or n 0))))) |
| 813 | (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))) | 821 | (if (calendar-date-is-visible-p greg) |
| 814 | (if (calendar-date-is-visible-p nicaean-easter) | 822 | (list (list greg (or string "Pascha (Greek Orthodox Easter)")))))) |
| 815 | (list (list nicaean-easter "Pascha (Greek Orthodox Easter)"))))) | ||
| 816 | 823 | ||
| 817 | (provide 'holidays) | 824 | (provide 'holidays) |
| 818 | 825 | ||