From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#21256: [RFC] Extend holiday-greek-orthodox-easter in calendar Date: Thu, 13 Aug 2015 11:01:46 -0700 Organization: UCLA Computer Science Department Message-ID: <55CCDB8A.2080006@cs.ucla.edu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070903080405060105000903" X-Trace: ger.gmane.org 1439489019 22001 80.91.229.3 (13 Aug 2015 18:03:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Aug 2015 18:03:39 +0000 (UTC) Cc: "Foivos S. Zakkak" To: 21256@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 13 20:03:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZPwqT-000180-U6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2015 20:03:18 +0200 Original-Received: from localhost ([::1]:43705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwqT-00027B-4A for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2015 14:03:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwqJ-00026i-CI for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:03:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPwqE-0004mN-PW for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:03:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwqE-0004lL-MN for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZPwqE-0005we-An for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Aug 2015 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Emacs bug reports and feature requests Original-Received: via spool by submit@debbugs.gnu.org id=B.143948892522717 (code B ref -1); Thu, 13 Aug 2015 18:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Aug 2015 18:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:55247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPwpJ-0005uK-4b for submit@debbugs.gnu.org; Thu, 13 Aug 2015 14:02:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36892) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPwpG-0005u8-L9 for submit@debbugs.gnu.org; Thu, 13 Aug 2015 14:02:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPwpF-0004Fz-D8 for submit@debbugs.gnu.org; Thu, 13 Aug 2015 14:02:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwpF-0004Fu-Ay for submit@debbugs.gnu.org; Thu, 13 Aug 2015 14:02:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwpE-0001pq-1Y for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:02:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPwpA-0004Ei-Ru for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:01:59 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPwpA-0004EP-KD for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2015 14:01:56 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2F9EF1605AF; Thu, 13 Aug 2015 11:01:50 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id z7ADse0kgA1K; Thu, 13 Aug 2015 11:01:48 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 923D0160D28; Thu, 13 Aug 2015 11:01:48 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zgLSm_jpsIew; Thu, 13 Aug 2015 11:01:48 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 525151605AF; Thu, 13 Aug 2015 11:01:48 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: X-Forwarded-Message-Id: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:105457 Archived-At: This is a multi-part message in MIME format. --------------070903080405060105000903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 To: emacs-devel@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 --------------070903080405060105000903 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjIKCmlGNEVB UkVLQUFZRkFsWE1uWGtBQ2drUUV0RVlUekNEeXJaWG1RRC9jM3V2VzNlaXFqRHRNd2ovVGlw ZG1GL2oKMElNYkdVbWRoWDl1dEQ2dmNkMEJBSXk4Vjd6SDZPZTNhditnN01QNzdKWXRlVk9J ZzRrd2RPM0QrS0JBOWtyMQo9bFpQcAotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --------------070903080405060105000903--