GNU bug report logs -
#21256
[RFC] Extend holiday-greek-orthodox-easter in calendar
Previous Next
Reported by: foivos <at> zakkak.net
Date: Thu, 13 Aug 2015 18:03:02 UTC
Severity: wishlist
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#21256: [RFC] Extend holiday-greek-orthodox-easter in calendar
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 21256 <at> debbugs.gnu.org.
--
21256: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21256
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Foivos S. Zakkak wrote:
> With this extension one can use the following configuration or similar:
Thanks for the explanation. I installed the attached patch, which should have
the same effect, and am marking this as done. Please let me know if it has any
problems.
[0001-Optional-args-for-holiday-greek-orthodox-easter.txt (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
Tags: patch
Severity: wishlist
Forwarded from:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00519.html
-------- Forwarded Message --------
Subject: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 16:36:56 +0300
From: Foivos S. Zakkak <foivos <at> zakkak.net>
To: emacs-devel <at> gnu.org
* Description
Extend holiday-greek-orthodox-easter to work like holiday-easter-etc.
That is, accept two optional arguments (n string) and calculate the Date
of Nth day after Easter (named STRING), if visible in calendar window.
The date is calculated according to the rule of the Council of Nicaea.
For backwards compatibility, if this function is called with no
arguments, then it returns the Pascha (Greek Orthodox Easter) day.
* The patch
--8<---------------cut here---------------start------------->8---
--- holidays_orig.el 2015-07-06 00:27:54.992714111 +0300
+++ holidays.el 2015-07-06 00:37:19.530996341 +0300
@@ -791,8 +791,20 @@
;; Prior call to calendar-julian-from-absolute will autoload cal-julian.
(declare-function calendar-julian-to-absolute "cal-julian" (date))
-(defun holiday-greek-orthodox-easter ()
- "Date of Easter according to the rule of the Council of Nicaea."
+(defun holiday-greek-orthodox-easter (&optional n string)
+ "Date of Nth day after Easter (named STRING), if visible in calendar
+window. The date is calculated according to the rule of the Council of
+Nicaea. Negative values of N are interpreted as days before Easter.
+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 Easter.
+
+For backwards compatibility, if this function is called with no
+arguments, then it returns the Pascha (Greek Orthodox Easter)
+day."
+ ;; Backwards compatibility layer.
+ (if (not n)
+ (holiday-greek-orthodox-easter 0 "Pascha (Greek Orthodox Easter)")
(let* ((m displayed-month)
(y displayed-year)
(julian-year (progn
@@ -808,11 +820,11 @@
(paschal-moon ; day after full moon on or after March 21
(- (calendar-julian-to-absolute (list 4 19 julian-year))
shifted-epact))
- (nicaean-easter ; Sunday following the Paschal moon
- (calendar-gregorian-from-absolute
- (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))))
- (if (calendar-date-is-visible-p nicaean-easter)
- (list (list nicaean-easter "Pascha (Greek Orthodox Easter)")))))
+ ;; Sunday following the Paschal moon
+ (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7)))
+ (greg (calendar-gregorian-from-absolute (+ abs-easter n))))
+ (if (calendar-date-is-visible-p greg)
+ (list (list greg string))))))
(provide 'holidays)
--8<---------------cut here---------------end--------------->8---
Kind regards,
Foivos
--
WWW: foivos.zakkak.net
PGP: 7B40 69D9 29BA AE91 C0B3 220A 0846 BFD1 03F0 4EA1
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 9 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.