From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: hmalmedal@yahoo.no (=?iso-8859-1?q?H=E5kon_Malmedal?=) Newsgroups: gmane.emacs.devel Subject: holidays.el Date: Mon, 19 Jul 2004 17:59:18 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1090254062 4376 80.91.224.253 (19 Jul 2004 16:21:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jul 2004 16:21:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 19 18:20:50 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 1Bmasj-000740-00 for ; Mon, 19 Jul 2004 18:20:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BmavQ-0000N8-7V for ged-emacs-devel@m.gmane.org; Mon, 19 Jul 2004 12:23:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BmavH-0000N3-U1 for emacs-devel@gnu.org; Mon, 19 Jul 2004 12:23:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BmavH-0000Mr-3n for emacs-devel@gnu.org; Mon, 19 Jul 2004 12:23:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BmavH-0000Mo-12 for emacs-devel@gnu.org; Mon, 19 Jul 2004 12:23:27 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BmasM-0004rk-Vx for emacs-devel@gnu.org; Mon, 19 Jul 2004 12:20:27 -0400 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BmasM-0008RL-00 for ; Mon, 19 Jul 2004 18:20:26 +0200 Original-Received: from s01i34-0609.no.powertech.net ([195.159.184.97]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jul 2004 18:20:26 +0200 Original-Received: from hmalmedal by s01i34-0609.no.powertech.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jul 2004 18:20:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 101 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: s01i34-0609.no.powertech.net User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) 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:25843 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25843 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?