From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Foivos S. Zakkak Newsgroups: gmane.emacs.devel Subject: [RFC] Extend holiday-greek-orthodox-easter in calendar Date: Mon, 06 Jul 2015 00:42:21 +0300 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1436149682 23375 80.91.229.3 (6 Jul 2015 02:28:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jul 2015 02:28:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 06 04:27:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBw8O-0002M4-Iv for ged-emacs-devel@m.gmane.org; Mon, 06 Jul 2015 04:27:52 +0200 Original-Received: from localhost ([::1]:48475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBw8N-0007zT-Hk for ged-emacs-devel@m.gmane.org; Sun, 05 Jul 2015 22:27:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBsGW-0000yZ-6Z for emacs-devel@gnu.org; Sun, 05 Jul 2015 18:20:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBsGS-0006O5-Vr for emacs-devel@gnu.org; Sun, 05 Jul 2015 18:20:00 -0400 Original-Received: from [2001:1af8:40e0:a00d:6::1115] (port=39690 helo=srv1.tolabaki.gr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBsGS-0006Gj-Mu for emacs-devel@gnu.org; Sun, 05 Jul 2015 18:19:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tolabaki.gr; s=20150420; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=OkHhHPotc8sM9Dkh7ZVwtPJ037C2Q+Xz5yX1THsFx7I=; b=aOTIHK/aaRgIdVZWL5795AxwvfxjjvOjHqxQ7JwuEgIv9gh8hXucN3cIAoDIpcZo2S5y83g7Imw4HyHTdMR3HvyyU6yTOc9k0EnhSK+sOCAjPpNuZLMQ3ZFPS7Icb9cfMO3/SpqE+Tn+RnMODb0OSVja/anH6G3aOX2DtBGjVk0=; Original-Received: from 46.12.61.39.dsl.dyn.forthnet.gr ([46.12.61.39] helo=transarch) by srv1.tolabaki.gr with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZBrgA-000168-N2 for emacs-devel@gnu.org; Mon, 06 Jul 2015 00:42:27 +0300 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:1af8:40e0:a00d:6::1115 X-Mailman-Approved-At: Sun, 05 Jul 2015 22:27:49 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187735 Archived-At: --=-=-= Content-Type: text/plain * 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlWZpL0ACgkQEtEYTzCDyrYh8AD+NWGjs6g0or0087TqxSgIJraQ U0mf6eAxi0Zxa+vgMPgBAJkWarN4k5/RwvkvJtoag40M/atBXeXjUbRgufOPjYR8 =pQcg -----END PGP SIGNATURE----- --=-=-=--