From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ed Reingold Newsgroups: gmane.emacs.devel Subject: Re: holidays.el Date: Mon, 19 Jul 2004 12:35:01 -0500 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200407191735.i6JHZ19B015634@emr.cs.iit.edu> References: <"Message from hmalmedal"@yahoo.no> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1090258534 16506 80.91.224.253 (19 Jul 2004 17:35:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jul 2004 17:35:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 19 19:35:22 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bmc2s-0004yT-00 for ; Mon, 19 Jul 2004 19:35:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bmc5Z-0005aS-6l for ged-emacs-devel@m.gmane.org; Mon, 19 Jul 2004 13:38:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bmc5U-0005aN-5q for emacs-devel@gnu.org; Mon, 19 Jul 2004 13:38:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bmc5S-0005Yr-Bl for emacs-devel@gnu.org; Mon, 19 Jul 2004 13:38:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bmc5S-0005Yo-7o for emacs-devel@gnu.org; Mon, 19 Jul 2004 13:38:02 -0400 Original-Received: from [216.47.143.101] (helo=email2.iit.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bmc2e-0007md-In for emacs-devel@gnu.org; Mon, 19 Jul 2004 13:35:08 -0400 Original-Received: from emr.cs.iit.edu (emr.cs.iit.edu [216.47.142.126]) by email2.iit.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0I14000M10TZUV@email2.iit.edu> for emacs-devel@gnu.org; Mon, 19 Jul 2004 12:34:47 -0500 (CDT) Original-Received: from emr.cs.iit.edu (localhost [127.0.0.1]) by emr.cs.iit.edu (8.12.9+Sun/8.12.2) with ESMTP id i6JHZ19B015634; Mon, 19 Jul 2004 12:35:01 -0500 (CDT) In-reply-to: <"Message from hmalmedal"@yahoo.no> "of Mon, 19 Jul 2004 17:59:18 +0200." Original-To: hmalmedal@yahoo.no (=?iso-8859-1?q?H=E5kon_Malmedal?=) X-Mailer: exmh version 2.5 11/23/2002 with nmh-1.0.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 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 Xref: main.gmane.org gmane.emacs.devel:25844 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25844 That's a good idea--there are similar things elsewhere that should be changed. I did not write it that way originally (nearly 20 years ago!) because it would have been too slow; now hardware is so fast that the difference in time would be negligible. Feel free to fix this. > I was thinking that if the function holiday-easter-etc looked > something like this: > > (defun holiday-easter-etc (n string) > "Holiday on Nth day after Easter called STRING." > (let* ((century (1+ (/ displayed-year 100))) > (shifted-epact ;; Age of moon for April 5... > (% (+ 14 (* 11 (% displayed-year 19));; ...by Nicaean rule > (- ;; ...corrected for the Gregorian century rule > (/ (* 3 century) 4)) > (/ ;; ...corrected for Metonic cycle inaccuracy. > (+ 5 (* 8 century)) 25) > (* 30 century));; Keeps value positive. > 30)) > (adjusted-epact ;; Adjust for 29.5 day month. > (if (or (= shifted-epact 0) > (and (= shifted-epact 1) (< 10 (% displayed-year 19)))) > (1+ shifted-epact) > shifted-epact)) > (paschal-moon ;; Day after the full moon on or after March 21. > (- (calendar-absolute-from-gregorian (list 4 19 displayed-year)) > adjusted-epact)) > (abs-easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))) > (mandatory > (list > (list (calendar-gregorian-from-absolute (+ abs-easter n)) > string))) > (output-list > (filter-visible-calendar-holidays mandatory))) > output-list)) > > and the function holiday-advent looked something like this: > > (defun holiday-advent (n string) > "Holiday on Nth day after Advent called STRING." > (let ((year displayed-year) > (month displayed-month)) > (increment-calendar-month month year -1) > (let ((advent (calendar-gregorian-from-absolute > (+ n > (calendar-dayname-on-or-before 0 > (calendar-absolute-from-gregorian > (list 12 3 year))))))) > (if (calendar-date-is-visible-p advent) > (list (list advent string)))))) > > then the variable christian-holidays (in calendar.el) could look like > this: > > ;;;###autoload > (put 'christian-holidays 'risky-local-variable t) > ;;;###autoload > (defcustom christian-holidays > '((if all-christian-calendar-holidays > (holiday-fixed 1 6 "Epiphany")) > (holiday-easter-etc 0 "Easter Sunday") > (holiday-easter-etc -2 "Good Friday") > (holiday-easter-etc -46 "Ash Wednesday") > (if all-christian-calendar-holidays > (holiday-easter-etc -63 "Septuagesima Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -56 "Sexagesima Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -49 "Shrove Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -48 "Shrove Monday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -47 "Shrove Tuesday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -14 "Passion Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -7 "Palm Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc -3 "Maundy Thursday")) > (if all-christian-calendar-holidays > (holiday-easter-etc 35 "Rogation Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc 39 "Ascension Day")) > (if all-christian-calendar-holidays > (holiday-easter-etc 49 "Pentecost (Whitsunday)")) > (if all-christian-calendar-holidays > (holiday-easter-etc 50 "Whitmonday")) > (if all-christian-calendar-holidays > (holiday-easter-etc 56 "Trinity Sunday")) > (if all-christian-calendar-holidays > (holiday-easter-etc 60 "Corpus Christi")) > (if all-christian-calendar-holidays > (holiday-greek-orthodox-easter)) > (if all-christian-calendar-holidays > (holiday-fixed 8 15 "Assumption")) > (if all-christian-calendar-holidays > (holiday-advent 0 "Advent")) > (holiday-fixed 12 25 "Christmas") > (if all-christian-calendar-holidays > (holiday-julian 12 25 "Eastern Orthodox Christmas"))) > "*Christian holidays. > See the documentation for `calendar-holidays' for details." > :type 'sexp > :group 'holidays) > > and be much easier to customize. Is this a good/bad idea? > > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel