GNU bug report logs - #21256
[RFC] Extend holiday-greek-orthodox-easter in calendar

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21256 in the body.
You can then email your comments to 21256 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21256; Package emacs. (Thu, 13 Aug 2015 18:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Aug 2015 18:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Emacs bug reports and feature requests <bug-gnu-emacs <at> gnu.org>
Cc: "Foivos S. Zakkak" <foivos <at> zakkak.net>
Subject: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 11:01:46 -0700
[Message part 1 (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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21256; Package emacs. (Thu, 13 Aug 2015 18:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 21256 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Foivos S. Zakkak" <foivos <at> zakkak.net>
Cc: 21256 <at> debbugs.gnu.org
Subject: Re: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 11:05:34 -0700
[Moving this thread to the bug report email address.]

Foivos S. Zakkak wrote:

> Extend holiday-greek-orthodox-easter to work like holiday-easter-etc.

Thanks, could you give the use case for this extension?  My impression is that 
holiday-greek-orthodox-easter is intended for internal use, and the only place 
it's called wouldn't use this extension.





Changed bug submitter to 'foivos <at> zakkak.net' from 'Paul Eggert <eggert <at> cs.ucla.edu>' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 13 Aug 2015 18:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21256; Package emacs. (Thu, 13 Aug 2015 18:39:02 GMT) Full text and rfc822 format available.

Message #13 received at 21256 <at> debbugs.gnu.org (full text, mbox):

From: Foivos S. Zakkak <foivos <at> zakkak.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21256 <at> debbugs.gnu.org
Subject: Re: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 21:38:37 +0300
[Message part 1 (text/plain, inline)]
On 08/13/15 21:05 , Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> [Moving this thread to the bug report email address.]
>
> Foivos S. Zakkak wrote:
>
>> Extend holiday-greek-orthodox-easter to work like holiday-easter-etc.
>
> Thanks, could you give the use case for this extension?  My impression is that
> holiday-greek-orthodox-easter is intended for internal use, and the only place
> it's called wouldn't use this extension.

Hello Paul,

To the best of my knowledge there is no preset to properly display all
the Greek holidays.  As a result, following the paradigms in [1] I
created a Greek localization.  However there are various Greek-Orthodox
holidays that are relative to the Easter date (i.e., "Καθαρά Δευτέρα" is
48 days before the Greek-Orthodox Easter) and I was not able to define
them properly.

With this extension one can use the following configuration or similar:

--8<---------------cut here---------------start------------->8---
  ;; Greek public holidays
  (setq holiday-christian-holidays
        '((holiday-fixed 1 1 "Πρωτοχρονιά")
          (holiday-fixed 1 6 "Θεοφάνεια")
          (holiday-greek-orthodox-easter -48 "Καθαρά Δευτέρα")
          (holiday-fixed 3 25 "Ευαγγελισμός της Θεοτόκου")
          (holiday-greek-orthodox-easter -2 "Μεγάλη Παρασκευή")
          (holiday-greek-orthodox-easter 0 "Κυριακή του Πάσχα")
          (holiday-greek-orthodox-easter +1 "Δευτέρα του Πάσχα")
          (holiday-fixed 5 1 "Εργατική Πρωτομαγιά")
          (holiday-greek-orthodox-easter +49 "Πεντηκοστή")
          (holiday-greek-orthodox-easter +50 "Αγίου Πνεύματος")
          (holiday-fixed 8 15 "Η Κοίμηση της Θεοτόκου")
          (holiday-fixed 12 25 "Χριστούγεννα")
          (holiday-fixed 12 26 "Σύναξις Ὑπεραγίας Θεοτόκου Μαρίας")
        ))
--8<---------------cut here---------------end--------------->8---

[1] http://www.emacswiki.org/emacs/CalendarLocalization

Kind regards,
Foivos
--
WWW: foivos.zakkak.net
PGP: 7B40 69D9 29BA AE91 C0B3  220A 0846 BFD1 03F0 4EA1
[signature.asc (application/pgp-signature, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Thu, 13 Aug 2015 19:20:03 GMT) Full text and rfc822 format available.

Notification sent to foivos <at> zakkak.net:
bug acknowledged by developer. (Thu, 13 Aug 2015 19:20:03 GMT) Full text and rfc822 format available.

Message #18 received at 21256-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Foivos S. Zakkak" <foivos <at> zakkak.net>
Cc: 21256-done <at> debbugs.gnu.org
Subject: Re: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 12:19:52 -0700
[Message part 1 (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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21256; Package emacs. (Thu, 13 Aug 2015 19:50:03 GMT) Full text and rfc822 format available.

Message #21 received at 21256-done <at> debbugs.gnu.org (full text, mbox):

From: Foivos S. Zakkak <foivos <at> zakkak.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21256-done <at> debbugs.gnu.org
Subject: Re: [RFC] Extend holiday-greek-orthodox-easter in calendar
Date: Thu, 13 Aug 2015 22:49:44 +0300
[Message part 1 (text/plain, inline)]
On 08/13/15 22:19 , Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> 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.

I only see some tabs instead of spaces in the patch but functionally it
is OK, thanks!

Foivos
--
WWW: foivos.zakkak.net
PGP: 7B40 69D9 29BA AE91 C0B3  220A 0846 BFD1 03F0 4EA1
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Sep 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.