aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-08-13 12:16:25 -0700
committerPaul Eggert2015-08-13 12:17:50 -0700
commitb532875a6021cd1715321dda932b187522840944 (patch)
tree33b6c2d8b43dc68efe2463325262d55fca9ea988
parent57adf425f511b90153f128e7679b5f432df13fb5 (diff)
downloademacs-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/NEWS3
-rw-r--r--lisp/calendar/holidays.el21
2 files changed, 17 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 0a33a6ef3ee..3ec16f54458 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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.
556The majority were function/variable/face aliases, too numerous to list here. 559The majority were function/variable/face aliases, too numerous to list here.
557The remainder were: 560The 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.
796It is calculated according to the rule of the Council of Nicaea.
797Negative values of N are interpreted as days before Easter.
798STRING is used purely for display purposes. The return value has
799the form ((MONTH DAY YEAR) STRING), where the date is that of the
800Nth day before or after Easter.
801
802For backwards compatibility, if this function is called with no
803arguments, 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