annotate lisp/calendar/cal-hebrew.el @ 67429:3ff7903b19d7

(locate): Disable undo in *Locate* buffer.
author Juri Linkov <juri@jurta.org>
date Fri, 09 Dec 2005 09:56:39 +0000
parents e461582f967a
children a55ee709ec8d a3716f7538f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 24187
diff changeset
1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
2
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
3 ;; Copyright (C) 1995, 1997, 2003 Free Software Foundation, Inc.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
4
13051
0351b3061992 *** empty log message ***
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13050
diff changeset
5 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
7 ;; Keywords: calendar
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
8 ;; Human-Keywords: Hebrew calendar, calendar, diary
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
11
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
15 ;; any later version.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
16
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; GNU General Public License for more details.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13674
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62402
diff changeset
25 ;; Boston, MA 02110-1301, USA.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
26
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27 ;;; Commentary:
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
29 ;; This collection of functions implements the features of calendar.el and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
30 ;; diary.el that deal with the Hebrew calendar.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
31
20462
d179de7ad92e Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents: 20267
diff changeset
32 ;; Technical details of all the calendrical calculations can be found in
61148
7f7db25577d9 Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents: 54074
diff changeset
33 ;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
7f7db25577d9 Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents: 54074
diff changeset
34 ;; and Nachum Dershowitz, Cambridge University Press (2001).
20462
d179de7ad92e Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents: 20267
diff changeset
35
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
36 ;; Comments, corrections, and improvements should be sent to
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
37 ;; Edward M. Reingold Department of Computer Science
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
38 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
39 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
40 ;; Urbana, Illinois 61801
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
41
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
42 ;;; Code:
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
43
65143
e461582f967a (date, entry, number, original-date): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
44 (defvar date)
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
45 (defvar displayed-month)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
46 (defvar displayed-year)
65143
e461582f967a (date, entry, number, original-date): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
47 (defvar entry)
e461582f967a (date, entry, number, original-date): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
48 (defvar number)
e461582f967a (date, entry, number, original-date): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
49 (defvar original-date)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
50
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
51 (require 'calendar)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
52
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
53 (defun hebrew-calendar-leap-year-p (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
54 "t if YEAR is a Hebrew calendar leap year."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
55 (< (% (1+ (* 7 year)) 19) 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
56
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57 (defun hebrew-calendar-last-month-of-year (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
58 "The last month of the Hebrew calendar YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
59 (if (hebrew-calendar-leap-year-p year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60 13
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
61 12))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
62
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
63 (defun hebrew-calendar-elapsed-days (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64 "Days from Sun. prior to start of Hebrew calendar to mean conjunction of Tishri of Hebrew YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
65 (let* ((months-elapsed
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
66 (+ (* 235 (/ (1- year) 19));; Months in complete cycles so far.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
67 (* 12 (% (1- year) 19)) ;; Regular months in this cycle
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
68 (/ (1+ (* 7 (% (1- year) 19))) 19)));; Leap months this cycle
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
69 (parts-elapsed (+ 204 (* 793 (% months-elapsed 1080))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
70 (hours-elapsed (+ 5
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
71 (* 12 months-elapsed)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
72 (* 793 (/ months-elapsed 1080))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
73 (/ parts-elapsed 1080)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
74 (parts ;; Conjunction parts
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
75 (+ (* 1080 (% hours-elapsed 24)) (% parts-elapsed 1080)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
76 (day ;; Conjunction day
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
77 (+ 1 (* 29 months-elapsed) (/ hours-elapsed 24)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
78 (alternative-day
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
79 (if (or (>= parts 19440) ;; If the new moon is at or after midday,
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
80 (and (= (% day 7) 2);; ...or is on a Tuesday...
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
81 (>= parts 9924) ;; at 9 hours, 204 parts or later...
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
82 (not (hebrew-calendar-leap-year-p year)));; of a
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
83 ;; common year,
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
84 (and (= (% day 7) 1);; ...or is on a Monday...
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
85 (>= parts 16789) ;; at 15 hours, 589 parts or later...
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
86 (hebrew-calendar-leap-year-p (1- year))));; at the end
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
87 ;; of a leap year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
88 ;; Then postpone Rosh HaShanah one day
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
89 (1+ day)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
90 ;; Else
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
91 day)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
92 (if ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
93 (memq (% alternative-day 7) (list 0 3 5))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
94 ;; Then postpone it one (more) day and return
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
95 (1+ alternative-day)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
96 ;; Else return
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
97 alternative-day)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
98
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
99 (defun hebrew-calendar-days-in-year (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
100 "Number of days in Hebrew YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
101 (- (hebrew-calendar-elapsed-days (1+ year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
102 (hebrew-calendar-elapsed-days year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
103
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
104 (defun hebrew-calendar-long-heshvan-p (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
105 "t if Heshvan is long in Hebrew YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
106 (= (% (hebrew-calendar-days-in-year year) 10) 5))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
107
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
108 (defun hebrew-calendar-short-kislev-p (year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
109 "t if Kislev is short in Hebrew YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
110 (= (% (hebrew-calendar-days-in-year year) 10) 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
111
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
112 (defun hebrew-calendar-last-day-of-month (month year)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
113 "The last day of MONTH in YEAR."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
114 (if (or (memq month (list 2 4 6 10 13))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
115 (and (= month 12) (not (hebrew-calendar-leap-year-p year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
116 (and (= month 8) (not (hebrew-calendar-long-heshvan-p year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
117 (and (= month 9) (hebrew-calendar-short-kislev-p year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
118 29
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
119 30))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
120
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
121 (defun calendar-absolute-from-hebrew (date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
122 "Absolute date of Hebrew DATE.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
123 The absolute date is the number of days elapsed since the (imaginary)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
124 Gregorian date Sunday, December 31, 1 BC."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
125 (let* ((month (extract-calendar-month date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
126 (day (extract-calendar-day date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
127 (year (extract-calendar-year date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
128 (+ day ;; Days so far this month.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
129 (if (< month 7);; before Tishri
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
130 ;; Then add days in prior months this year before and after Nisan
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
131 (+ (calendar-sum
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
132 m 7 (<= m (hebrew-calendar-last-month-of-year year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
133 (hebrew-calendar-last-day-of-month m year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
134 (calendar-sum
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135 m 1 (< m month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
136 (hebrew-calendar-last-day-of-month m year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
137 ;; Else add days in prior months this year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
138 (calendar-sum
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
139 m 7 (< m month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
140 (hebrew-calendar-last-day-of-month m year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
141 (hebrew-calendar-elapsed-days year);; Days in prior years.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
142 -1373429))) ;; Days elapsed before absolute date 1.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
143
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
144 (defun calendar-hebrew-from-absolute (date)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
145 "Compute the Hebrew date (month day year) corresponding to absolute DATE.
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
146 The absolute date is the number of days elapsed since the (imaginary)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
147 Gregorian date Sunday, December 31, 1 BC."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
148 (let* ((greg-date (calendar-gregorian-from-absolute date))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
149 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
150 (1- (extract-calendar-month greg-date))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
151 (day)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
152 (year (+ 3760 (extract-calendar-year greg-date))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
153 (while (>= date (calendar-absolute-from-hebrew (list 7 1 (1+ year))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
154 (setq year (1+ year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
155 (let ((length (hebrew-calendar-last-month-of-year year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
156 (while (> date
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
157 (calendar-absolute-from-hebrew
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
158 (list month
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
159 (hebrew-calendar-last-day-of-month month year)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
160 year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
161 (setq month (1+ (% month length)))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
162 (setq day (1+
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
163 (- date (calendar-absolute-from-hebrew (list month 1 year)))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
164 (list month day year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
165
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
166 (defvar calendar-hebrew-month-name-array-common-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
167 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
168 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
169 "Array of strings giving the names of the Hebrew months in a common year.")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
170
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
171 (defvar calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
172 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
173 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
174 "Array of strings giving the names of the Hebrew months in a leap year.")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
175
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
176 (defun calendar-hebrew-date-string (&optional date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
177 "String of Hebrew date before sunset of Gregorian DATE.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
178 Defaults to today's date if DATE is not given.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
179 Driven by the variable `calendar-date-display-form'."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
180 (let* ((hebrew-date (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
181 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
182 (or date (calendar-current-date)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
183 (calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
184 (if (hebrew-calendar-leap-year-p (extract-calendar-year hebrew-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
185 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
186 calendar-hebrew-month-name-array-common-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
187 (calendar-date-string hebrew-date nil t)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
188
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
189 (defun calendar-print-hebrew-date ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
190 "Show the Hebrew calendar equivalent of the date under the cursor."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
191 (interactive)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
192 (message "Hebrew date (until sunset): %s"
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
193 (calendar-hebrew-date-string (calendar-cursor-to-date t))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
194
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
195 (defun hebrew-calendar-yahrzeit (death-date year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
196 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
197 (let* ((death-day (extract-calendar-day death-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
198 (death-month (extract-calendar-month death-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
199 (death-year (extract-calendar-year death-date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
200 (cond
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
201 ;; If it's Heshvan 30 it depends on the first anniversary; if
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
202 ;; that was not Heshvan 30, use the day before Kislev 1.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
203 ((and (= death-month 8)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
204 (= death-day 30)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
205 (not (hebrew-calendar-long-heshvan-p (1+ death-year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
206 (1- (calendar-absolute-from-hebrew (list 9 1 year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
207 ;; If it's Kislev 30 it depends on the first anniversary; if
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
208 ;; that was not Kislev 30, use the day before Teveth 1.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
209 ((and (= death-month 9)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
210 (= death-day 30)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
211 (hebrew-calendar-short-kislev-p (1+ death-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
212 (1- (calendar-absolute-from-hebrew (list 10 1 year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
213 ;; If it's Adar II, use the same day in last month of
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
214 ;; year (Adar or Adar II).
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
215 ((= death-month 13)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
216 (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
217 (list (hebrew-calendar-last-month-of-year year) death-day year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
218 ;; If it's the 30th in Adar I and year is not a leap year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
219 ;; (so Adar has only 29 days), use the last day in Shevat.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
220 ((and (= death-day 30)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
221 (= death-month 12)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
222 (not (hebrew-calendar-leap-year-p year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
223 (calendar-absolute-from-hebrew (list 11 30 year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
224 ;; In all other cases, use the normal anniversary of the date of death.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
225 (t (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
226 (list death-month death-day year))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
227
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
228 (defun calendar-goto-hebrew-date (date &optional noecho)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
229 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is t."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
230 (interactive
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
231 (let* ((today (calendar-current-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
232 (year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
233 "Hebrew calendar year (>3760): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
234 '(lambda (x) (> x 3760))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
235 (int-to-string
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
236 (extract-calendar-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
237 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
238 (calendar-absolute-from-gregorian today))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
239 (month-array (if (hebrew-calendar-leap-year-p year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
240 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
241 calendar-hebrew-month-name-array-common-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
242 (completion-ignore-case t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
243 (month (cdr (assoc-string
24187
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
244 (completing-read
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
245 "Hebrew calendar month name: "
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
246 (mapcar 'list (append month-array nil))
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
247 (if (= year 3761)
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
248 '(lambda (x)
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
249 (let ((m (cdr
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
250 (assoc-string
24187
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
251 (car x)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
252 (calendar-make-alist month-array)
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
253 t))))
24187
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
254 (< 0
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
255 (calendar-absolute-from-hebrew
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
256 (list m
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
257 (hebrew-calendar-last-day-of-month
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
258 m year)
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
259 year))))))
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
260 t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
261 (calendar-make-alist month-array 1) t)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
262 (last (hebrew-calendar-last-day-of-month month year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
263 (first (if (and (= year 3761) (= month 10))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
264 18 1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
265 (day (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
266 (format "Hebrew calendar day (%d-%d): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
267 first last)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
268 '(lambda (x) (and (<= first x) (<= x last))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
269 (list (list month day year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
270 (calendar-goto-date (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
271 (calendar-absolute-from-hebrew date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
272 (or noecho (calendar-print-hebrew-date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
273
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
274 (defun holiday-hebrew (month day string)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
275 "Holiday on MONTH, DAY (Hebrew) called STRING.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
276 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
277 Gregorian date in the form of the list (((month day year) STRING)). Returns
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
278 nil if it is not visible in the current calendar window."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
279 (if (memq displayed-month;; This test is only to speed things up a bit;
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
280 (list ;; it works fine without the test too.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
281 (if (< 11 month) (- month 11) (+ month 1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
282 (if (< 10 month) (- month 10) (+ month 2))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
283 (if (< 9 month) (- month 9) (+ month 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
284 (if (< 8 month) (- month 8) (+ month 4))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
285 (if (< 7 month) (- month 7) (+ month 5))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
286 (let ((m1 displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
287 (y1 displayed-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
288 (m2 displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
289 (y2 displayed-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
290 (year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
291 (increment-calendar-month m1 y1 -1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
292 (increment-calendar-month m2 y2 1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
293 (let* ((start-date (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
294 (list m1 1 y1)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
295 (end-date (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
296 (list m2 (calendar-last-day-of-month m2 y2) y2)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
297 (hebrew-start (calendar-hebrew-from-absolute start-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
298 (hebrew-end (calendar-hebrew-from-absolute end-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
299 (hebrew-y1 (extract-calendar-year hebrew-start))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
300 (hebrew-y2 (extract-calendar-year hebrew-end)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
301 (setq year (if (< 6 month) hebrew-y2 hebrew-y1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
302 (let ((date (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
303 (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
304 (list month day year)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
305 (if (calendar-date-is-visible-p date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
306 (list (list date string))))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
307
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
308 (defun holiday-rosh-hashanah-etc ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
309 "List of dates related to Rosh Hashanah, as visible in calendar window."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
310 (if (or (< displayed-month 8)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
311 (> displayed-month 11))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
312 nil;; None of the dates is visible
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
313 (let* ((abs-r-h (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
314 (list 7 1 (+ displayed-year 3761))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
315 (mandatory
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
316 (list
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
317 (list (calendar-gregorian-from-absolute abs-r-h)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
318 (format "Rosh HaShanah %d" (+ 3761 displayed-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
319 (list (calendar-gregorian-from-absolute (+ abs-r-h 9))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
320 "Yom Kippur")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
321 (list (calendar-gregorian-from-absolute (+ abs-r-h 14))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
322 "Sukkot")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
323 (list (calendar-gregorian-from-absolute (+ abs-r-h 21))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
324 "Shemini Atzeret")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
325 (list (calendar-gregorian-from-absolute (+ abs-r-h 22))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
326 "Simchat Torah")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
327 (optional
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
328 (list
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
329 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
330 (calendar-dayname-on-or-before 6 (- abs-r-h 4)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
331 "Selichot (night)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
332 (list (calendar-gregorian-from-absolute (1- abs-r-h))
13674
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
333 "Erev Rosh HaShanah")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
334 (list (calendar-gregorian-from-absolute (1+ abs-r-h))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
335 "Rosh HaShanah (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
336 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
337 (if (= (% abs-r-h 7) 4) (+ abs-r-h 3) (+ abs-r-h 2)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
338 "Tzom Gedaliah")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
339 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
340 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
341 "Shabbat Shuvah")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
342 (list (calendar-gregorian-from-absolute (+ abs-r-h 8))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
343 "Erev Yom Kippur")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
344 (list (calendar-gregorian-from-absolute (+ abs-r-h 13))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
345 "Erev Sukkot")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
346 (list (calendar-gregorian-from-absolute (+ abs-r-h 15))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
347 "Sukkot (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
348 (list (calendar-gregorian-from-absolute (+ abs-r-h 16))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
349 "Hol Hamoed Sukkot (first day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
350 (list (calendar-gregorian-from-absolute (+ abs-r-h 17))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
351 "Hol Hamoed Sukkot (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
352 (list (calendar-gregorian-from-absolute (+ abs-r-h 18))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
353 "Hol Hamoed Sukkot (third day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
354 (list (calendar-gregorian-from-absolute (+ abs-r-h 19))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
355 "Hol Hamoed Sukkot (fourth day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
356 (list (calendar-gregorian-from-absolute (+ abs-r-h 20))
44366
3ade5e9efe68 (holiday-rosh-hashanah-etc): Spelling correction.
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
357 "Hoshanah Rabbah")))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
358 (output-list
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
359 (filter-visible-calendar-holidays mandatory)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
360 (if all-hebrew-calendar-holidays
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
361 (setq output-list
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
362 (append
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
363 (filter-visible-calendar-holidays optional)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
364 output-list)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
365 output-list)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
366
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
367 (defun holiday-hanukkah ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
368 "List of dates related to Hanukkah, as visible in calendar window."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
369 (if (memq displayed-month;; This test is only to speed things up a bit;
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
370 '(10 11 12 1 2));; it works fine without the test too.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
371 (let ((m displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
372 (y displayed-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
373 (increment-calendar-month m y 1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
374 (let* ((h-y (extract-calendar-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
375 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
376 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
377 (list m (calendar-last-day-of-month m y) y)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
378 (abs-h (calendar-absolute-from-hebrew (list 9 25 h-y))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
379 (filter-visible-calendar-holidays
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
380 (list
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
381 (list (calendar-gregorian-from-absolute (1- abs-h))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
382 "Erev Hanukkah")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
383 (list (calendar-gregorian-from-absolute abs-h)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
384 "Hanukkah (first day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
385 (list (calendar-gregorian-from-absolute (1+ abs-h))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
386 "Hanukkah (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
387 (list (calendar-gregorian-from-absolute (+ abs-h 2))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
388 "Hanukkah (third day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
389 (list (calendar-gregorian-from-absolute (+ abs-h 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
390 "Hanukkah (fourth day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
391 (list (calendar-gregorian-from-absolute (+ abs-h 4))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
392 "Hanukkah (fifth day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
393 (list (calendar-gregorian-from-absolute (+ abs-h 5))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
394 "Hanukkah (sixth day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
395 (list (calendar-gregorian-from-absolute (+ abs-h 6))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
396 "Hanukkah (seventh day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
397 (list (calendar-gregorian-from-absolute (+ abs-h 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
398 "Hanukkah (eighth day)")))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
399
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
400 (defun holiday-passover-etc ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
401 "List of dates related to Passover, as visible in calendar window."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
402 (if (< 7 displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
403 nil;; None of the dates is visible
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
404 (let* ((abs-p (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
405 (list 1 15 (+ displayed-year 3760))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
406 (mandatory
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
407 (list
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
408 (list (calendar-gregorian-from-absolute abs-p)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
409 "Passover")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
410 (list (calendar-gregorian-from-absolute (+ abs-p 50))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
411 "Shavuot")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
412 (optional
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
413 (list
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
414 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
415 (calendar-dayname-on-or-before 6 (- abs-p 43)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
416 "Shabbat Shekalim")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
417 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
418 (calendar-dayname-on-or-before 6 (- abs-p 30)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
419 "Shabbat Zachor")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
420 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
421 (if (= (% abs-p 7) 2) (- abs-p 33) (- abs-p 31)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
422 "Fast of Esther")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
423 (list (calendar-gregorian-from-absolute (- abs-p 31))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
424 "Erev Purim")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
425 (list (calendar-gregorian-from-absolute (- abs-p 30))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
426 "Purim")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
427 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
428 (if (zerop (% abs-p 7)) (- abs-p 28) (- abs-p 29)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
429 "Shushan Purim")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
430 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
431 (- (calendar-dayname-on-or-before 6 (- abs-p 14)) 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
432 "Shabbat Parah")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
433 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
434 (calendar-dayname-on-or-before 6 (- abs-p 14)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
435 "Shabbat HaHodesh")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
436 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
437 (calendar-dayname-on-or-before 6 (1- abs-p)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
438 "Shabbat HaGadol")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
439 (list (calendar-gregorian-from-absolute (1- abs-p))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
440 "Erev Passover")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
441 (list (calendar-gregorian-from-absolute (1+ abs-p))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
442 "Passover (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
443 (list (calendar-gregorian-from-absolute (+ abs-p 2))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
444 "Hol Hamoed Passover (first day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
445 (list (calendar-gregorian-from-absolute (+ abs-p 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
446 "Hol Hamoed Passover (second day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
447 (list (calendar-gregorian-from-absolute (+ abs-p 4))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
448 "Hol Hamoed Passover (third day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
449 (list (calendar-gregorian-from-absolute (+ abs-p 5))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
450 "Hol Hamoed Passover (fourth day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
451 (list (calendar-gregorian-from-absolute (+ abs-p 6))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
452 "Passover (seventh day)")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
453 (list (calendar-gregorian-from-absolute (+ abs-p 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
454 "Passover (eighth day)")
17694
c9fd662941e3 (holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
455 (list (calendar-gregorian-from-absolute
c9fd662941e3 (holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
456 (if (zerop (% (+ abs-p 12) 7))
c9fd662941e3 (holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
457 (+ abs-p 13)
c9fd662941e3 (holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
458 (+ abs-p 12)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
459 "Yom HaShoah")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
460 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
461 (if (zerop (% abs-p 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
462 (+ abs-p 18)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
463 (if (= (% abs-p 7) 6)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
464 (+ abs-p 19)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
465 (+ abs-p 20))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
466 "Yom HaAtzma'ut")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
467 (list (calendar-gregorian-from-absolute (+ abs-p 33))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
468 "Lag BaOmer")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
469 (list (calendar-gregorian-from-absolute (+ abs-p 43))
22063
bf477b03b470 Fix mispelling.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20462
diff changeset
470 "Yom Yerushalaim")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
471 (list (calendar-gregorian-from-absolute (+ abs-p 49))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
472 "Erev Shavuot")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
473 (list (calendar-gregorian-from-absolute (+ abs-p 51))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
474 "Shavuot (second day)")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
475 (output-list
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
476 (filter-visible-calendar-holidays mandatory)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
477 (if all-hebrew-calendar-holidays
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
478 (setq output-list
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
479 (append
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
480 (filter-visible-calendar-holidays optional)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
481 output-list)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
482 output-list)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
483
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
484 (defun holiday-tisha-b-av-etc ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
485 "List of dates around Tisha B'Av, as visible in calendar window."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
486 (if (or (< displayed-month 5)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
487 (> displayed-month 9))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
488 nil;; None of the dates is visible
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
489 (let* ((abs-t-a (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
490 (list 5 9 (+ displayed-year 3760)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
491
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
492 (filter-visible-calendar-holidays
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
493 (list
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
494 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
495 (if (= (% abs-t-a 7) 6) (- abs-t-a 20) (- abs-t-a 21)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
496 "Tzom Tammuz")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
497 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
498 (calendar-dayname-on-or-before 6 abs-t-a))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
499 "Shabbat Hazon")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
500 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
501 (if (= (% abs-t-a 7) 6) (1+ abs-t-a) abs-t-a))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
502 "Tisha B'Av")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
503 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
504 (calendar-dayname-on-or-before 6 (+ abs-t-a 7)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
505 "Shabbat Nahamu"))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
506
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
507 (defun list-hebrew-diary-entries ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
508 "Add any Hebrew date entries from the diary file to `diary-entries-list'.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
509 Hebrew date diary entries must be prefaced by `hebrew-diary-entry-symbol'
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
510 \(normally an `H'). The same diary date forms govern the style of the Hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
511 calendar entries, except that the Hebrew month names must be spelled in full.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
512 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
513 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
514 common Hebrew year. If a Hebrew date diary entry begins with a
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
515 `diary-nonmarking-symbol', the entry will appear in the diary listing, but will
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
516 not be marked in the calendar. This function is provided for use with the
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
517 `nongregorian-diary-listing-hook'."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
518 (if (< 0 number)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
519 (let ((buffer-read-only nil)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
520 (diary-modified (buffer-modified-p))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
521 (gdate original-date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
522 (mark (regexp-quote diary-nonmarking-symbol)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
523 (calendar-for-loop i from 1 to number do
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
524 (let* ((d diary-date-forms)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
525 (hdate (calendar-hebrew-from-absolute
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
526 (calendar-absolute-from-gregorian gdate)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
527 (month (extract-calendar-month hdate))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
528 (day (extract-calendar-day hdate))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
529 (year (extract-calendar-year hdate)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
530 (while d
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
531 (let*
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
532 ((date-form (if (equal (car (car d)) 'backup)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
533 (cdr (car d))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
534 (car d)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
535 (backup (equal (car (car d)) 'backup))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
536 (dayname
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
537 (format "%s\\|%s\\.?"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
538 (calendar-day-name gdate)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
539 (calendar-day-name gdate 'abbrev)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
540 (calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
541 calendar-hebrew-month-name-array-leap-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
542 (monthname
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
543 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
544 "\\*\\|"
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
545 (calendar-month-name month)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
546 (month (concat "\\*\\|0*" (int-to-string month)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
547 (day (concat "\\*\\|0*" (int-to-string day)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
548 (year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
549 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
550 "\\*\\|0*" (int-to-string year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
551 (if abbreviated-calendar-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
552 (concat "\\|" (int-to-string (% year 100)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
553 "")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
554 (regexp
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
555 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
556 "\\(\\`\\|\^M\\|\n\\)" mark "?"
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
557 (regexp-quote hebrew-diary-entry-symbol)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
558 "\\("
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
559 (mapconcat 'eval date-form "\\)\\(")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
560 "\\)"))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
561 (case-fold-search t))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
562 (goto-char (point-min))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
563 (while (re-search-forward regexp nil t)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
564 (if backup (re-search-backward "\\<" nil t))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
565 (if (and (or (char-equal (preceding-char) ?\^M)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
566 (char-equal (preceding-char) ?\n))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
567 (not (looking-at " \\|\^I")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
568 ;; Diary entry that consists only of date.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
569 (backward-char 1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
570 ;; Found a nonempty diary entry--make it visible and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
571 ;; add it to the list.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
572 (let ((entry-start (point))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
573 (date-start))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
574 (re-search-backward "\^M\\|\n\\|\\`")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
575 (setq date-start (point))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
576 (re-search-forward "\^M\\|\n" nil t 2)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
577 (while (looking-at " \\|\^I")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
578 (re-search-forward "\^M\\|\n" nil t))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
579 (backward-char 1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
580 (subst-char-in-region date-start (point) ?\^M ?\n t)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
581 (add-to-diary-list
20267
6a9f60f7e241 (list-hebrew-diary-entries): Add the diary entry
Karl Heuer <kwzh@gnu.org>
parents: 17694
diff changeset
582 gdate
6a9f60f7e241 (list-hebrew-diary-entries): Add the diary entry
Karl Heuer <kwzh@gnu.org>
parents: 17694
diff changeset
583 (buffer-substring-no-properties entry-start (point))
6a9f60f7e241 (list-hebrew-diary-entries): Add the diary entry
Karl Heuer <kwzh@gnu.org>
parents: 17694
diff changeset
584 (buffer-substring-no-properties
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
585 (1+ date-start) (1- entry-start))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
586 (copy-marker entry-start))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
587 (setq d (cdr d))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
588 (setq gdate
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
589 (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
590 (1+ (calendar-absolute-from-gregorian gdate)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
591 (set-buffer-modified-p diary-modified))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
592 (goto-char (point-min))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
593
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
594 (defun mark-hebrew-calendar-date-pattern (month day year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
595 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
596 A value of 0 in any position is a wildcard."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
597 (save-excursion
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
598 (set-buffer calendar-buffer)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
599 (if (and (/= 0 month) (/= 0 day))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
600 (if (/= 0 year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
601 ;; Fully specified Hebrew date.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
602 (let ((date (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
603 (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
604 (list month day year)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
605 (if (calendar-date-is-visible-p date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
606 (mark-visible-calendar-date date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
607 ;; Month and day in any year--this taken from the holiday stuff.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
608 (if (memq displayed-month;; This test is only to speed things up a
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
609 (list ;; bit; it works fine without the test too.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
610 (if (< 11 month) (- month 11) (+ month 1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
611 (if (< 10 month) (- month 10) (+ month 2))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
612 (if (< 9 month) (- month 9) (+ month 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
613 (if (< 8 month) (- month 8) (+ month 4))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
614 (if (< 7 month) (- month 7) (+ month 5))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
615 (let ((m1 displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
616 (y1 displayed-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
617 (m2 displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
618 (y2 displayed-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
619 (year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
620 (increment-calendar-month m1 y1 -1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
621 (increment-calendar-month m2 y2 1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
622 (let* ((start-date (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
623 (list m1 1 y1)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
624 (end-date (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
625 (list m2
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
626 (calendar-last-day-of-month m2 y2)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
627 y2)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
628 (hebrew-start
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
629 (calendar-hebrew-from-absolute start-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
630 (hebrew-end (calendar-hebrew-from-absolute end-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
631 (hebrew-y1 (extract-calendar-year hebrew-start))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
632 (hebrew-y2 (extract-calendar-year hebrew-end)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
633 (setq year (if (< 6 month) hebrew-y2 hebrew-y1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
634 (let ((date (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
635 (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
636 (list month day year)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
637 (if (calendar-date-is-visible-p date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
638 (mark-visible-calendar-date date)))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
639 ;; Not one of the simple cases--check all visible dates for match.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
640 ;; Actually, the following code takes care of ALL of the cases, but
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
641 ;; it's much too slow to be used for the simple (common) cases.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
642 (let ((m displayed-month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
643 (y displayed-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
644 (first-date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
645 (last-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
646 (increment-calendar-month m y -1)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
647 (setq first-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
648 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
649 (list m 1 y)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
650 (increment-calendar-month m y 2)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
651 (setq last-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
652 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
653 (list m (calendar-last-day-of-month m y) y)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
654 (calendar-for-loop date from first-date to last-date do
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
655 (let* ((h-date (calendar-hebrew-from-absolute date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
656 (h-month (extract-calendar-month h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
657 (h-day (extract-calendar-day h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
658 (h-year (extract-calendar-year h-date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
659 (and (or (zerop month)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
660 (= month h-month))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
661 (or (zerop day)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
662 (= day h-day))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
663 (or (zerop year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
664 (= year h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
665 (mark-visible-calendar-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
666 (calendar-gregorian-from-absolute date)))))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
667
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
668 (defun mark-hebrew-diary-entries ()
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
669 "Mark days in the calendar window that have Hebrew date diary entries.
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
670 Each entry in diary-file (or included files) visible in the calendar window
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
671 is marked. Hebrew date entries are prefaced by a hebrew-diary-entry-symbol
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
672 \(normally an `H'). The same diary-date-forms govern the style of the Hebrew
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
673 calendar entries, except that the Hebrew month names must be spelled in full.
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
674 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
675 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
676 common Hebrew year. Hebrew date diary entries that begin with a
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
677 diary-nonmarking symbol will not be marked in the calendar. This function
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
678 is provided for use as part of the nongregorian-diary-marking-hook."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
679 (let ((d diary-date-forms))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
680 (while d
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
681 (let*
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
682 ((date-form (if (equal (car (car d)) 'backup)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
683 (cdr (car d))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
684 (car d)));; ignore 'backup directive
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
685 (dayname (diary-name-pattern calendar-day-name-array
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
686 calendar-day-abbrev-array))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
687 (monthname
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
688 (format "%s\\|\\*"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
689 (diary-name-pattern
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
690 calendar-hebrew-month-name-array-leap-year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
691 (month "[0-9]+\\|\\*")
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
692 (day "[0-9]+\\|\\*")
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
693 (year "[0-9]+\\|\\*")
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
694 (l (length date-form))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
695 (d-name-pos (- l (length (memq 'dayname date-form))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
696 (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
697 (m-name-pos (- l (length (memq 'monthname date-form))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
698 (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
699 (d-pos (- l (length (memq 'day date-form))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
700 (d-pos (if (/= l d-pos) (+ 2 d-pos)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
701 (m-pos (- l (length (memq 'month date-form))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
702 (m-pos (if (/= l m-pos) (+ 2 m-pos)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
703 (y-pos (- l (length (memq 'year date-form))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
704 (y-pos (if (/= l y-pos) (+ 2 y-pos)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
705 (regexp
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
706 (concat
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
707 "\\(\\`\\|\^M\\|\n\\)"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
708 (regexp-quote hebrew-diary-entry-symbol)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
709 "\\("
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
710 (mapconcat 'eval date-form "\\)\\(")
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
711 "\\)"))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
712 (case-fold-search t))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
713 (goto-char (point-min))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
714 (while (re-search-forward regexp nil t)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
715 (let* ((dd-name
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
716 (if d-name-pos
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
717 (buffer-substring
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
718 (match-beginning d-name-pos)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
719 (match-end d-name-pos))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
720 (mm-name
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
721 (if m-name-pos
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
722 (buffer-substring
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
723 (match-beginning m-name-pos)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
724 (match-end m-name-pos))))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61148
diff changeset
725 (mm (string-to-number
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
726 (if m-pos
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
727 (buffer-substring
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
728 (match-beginning m-pos)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
729 (match-end m-pos))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
730 "")))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61148
diff changeset
731 (dd (string-to-number
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
732 (if d-pos
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
733 (buffer-substring
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
734 (match-beginning d-pos)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
735 (match-end d-pos))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
736 "")))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
737 (y-str (if y-pos
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
738 (buffer-substring
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
739 (match-beginning y-pos)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
740 (match-end y-pos))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
741 (yy (if (not y-str)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
742 0
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
743 (if (and (= (length y-str) 2)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
744 abbreviated-calendar-year)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
745 (let* ((current-y
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
746 (extract-calendar-year
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
747 (calendar-hebrew-from-absolute
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
748 (calendar-absolute-from-gregorian
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
749 (calendar-current-date)))))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61148
diff changeset
750 (y (+ (string-to-number y-str)
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
751 (* 100 (/ current-y 100)))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
752 (if (> (- y current-y) 50)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
753 (- y 100)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
754 (if (> (- current-y y) 50)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
755 (+ y 100)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
756 y)))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61148
diff changeset
757 (string-to-number y-str)))))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
758 (if dd-name
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
759 (mark-calendar-days-named
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
760 (cdr (assoc-string dd-name
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
761 (calendar-make-alist
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
762 calendar-day-name-array
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
763 0 nil calendar-day-abbrev-array) t)))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
764 (if mm-name
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
765 (setq mm
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
766 (if (string-equal mm-name "*") 0
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
767 (cdr
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
768 (assoc-string
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
769 mm-name
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
770 (calendar-make-alist
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
771 calendar-hebrew-month-name-array-leap-year) t)))))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
772 (mark-hebrew-calendar-date-pattern mm dd yy)))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
773 (setq d (cdr d)))))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
774
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
775 (defun insert-hebrew-diary-entry (arg)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
776 "Insert a diary entry.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
777 For the Hebrew date corresponding to the date indicated by point.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
778 Prefix arg will make the entry nonmarking."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
779 (interactive "P")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
780 (let* ((calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
781 calendar-hebrew-month-name-array-leap-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
782 (make-diary-entry
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
783 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
784 hebrew-diary-entry-symbol
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
785 (calendar-date-string
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
786 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
787 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
788 (calendar-cursor-to-date t)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
789 nil t))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
790 arg)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
791
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
792 (defun insert-monthly-hebrew-diary-entry (arg)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
793 "Insert a monthly diary entry.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
794 For the day of the Hebrew month corresponding to the date indicated by point.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
795 Prefix arg will make the entry nonmarking."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
796 (interactive "P")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
797 (let* ((calendar-date-display-form
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
798 (if european-calendar-style '(day " * ") '("* " day )))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
799 (calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
800 calendar-hebrew-month-name-array-leap-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
801 (make-diary-entry
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
802 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
803 hebrew-diary-entry-symbol
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
804 (calendar-date-string
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
805 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
806 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
807 (calendar-cursor-to-date t)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
808 arg)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
809
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
810 (defun insert-yearly-hebrew-diary-entry (arg)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
811 "Insert an annual diary entry.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
812 For the day of the Hebrew year corresponding to the date indicated by point.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
813 Prefix arg will make the entry nonmarking."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
814 (interactive "P")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
815 (let* ((calendar-date-display-form
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
816 (if european-calendar-style
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
817 '(day " " monthname)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
818 '(monthname " " day)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
819 (calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
820 calendar-hebrew-month-name-array-leap-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
821 (make-diary-entry
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
822 (concat
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
823 hebrew-diary-entry-symbol
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
824 (calendar-date-string
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
825 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
826 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
827 (calendar-cursor-to-date t)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
828 arg)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
829
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
830 ;;;###autoload
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
831 (defun list-yahrzeit-dates (death-date start-year end-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
832 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
833 When called interactively from the calendar window, the date of death is taken
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
834 from the cursor position."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
835 (interactive
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
836 (let* ((death-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
837 (if (equal (current-buffer) (get-buffer calendar-buffer))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
838 (calendar-cursor-to-date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
839 (let* ((today (calendar-current-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
840 (year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
841 "Year of death (>0): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
842 '(lambda (x) (> x 0))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
843 (int-to-string (extract-calendar-year today))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
844 (month-array calendar-month-name-array)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
845 (completion-ignore-case t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
846 (month (cdr (assoc-string
24187
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
847 (completing-read
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
848 "Month of death (name): "
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
849 (mapcar 'list (append month-array nil))
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
850 nil t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
851 (calendar-make-alist month-array 1) t)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
852 (last (calendar-last-day-of-month month year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
853 (day (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
854 (format "Day of death (1-%d): " last)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
855 '(lambda (x) (and (< 0 x) (<= x last))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
856 (list month day year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
857 (death-year (extract-calendar-year death-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
858 (start-year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
859 (format "Starting year of Yahrzeit table (>%d): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
860 death-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
861 '(lambda (x) (> x death-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
862 (int-to-string (1+ death-year))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
863 (end-year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
864 (format "Ending year of Yahrzeit table (>=%d): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
865 start-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
866 '(lambda (x) (>= x start-year)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
867 (list death-date start-year end-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
868 (message "Computing yahrzeits...")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
869 (let* ((yahrzeit-buffer "*Yahrzeits*")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
870 (h-date (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
871 (calendar-absolute-from-gregorian death-date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
872 (h-month (extract-calendar-month h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
873 (h-day (extract-calendar-day h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
874 (h-year (extract-calendar-year h-date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
875 (set-buffer (get-buffer-create yahrzeit-buffer))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
876 (setq buffer-read-only nil)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
877 (calendar-set-mode-line
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
878 (format "Yahrzeit dates for %s = %s"
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
879 (calendar-date-string death-date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
880 (let ((calendar-month-name-array
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
881 (if (hebrew-calendar-leap-year-p h-year)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
882 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
883 calendar-hebrew-month-name-array-common-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
884 (calendar-date-string h-date nil t))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
885 (erase-buffer)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
886 (goto-char (point-min))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
887 (calendar-for-loop i from start-year to end-year do
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
888 (insert
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
889 (calendar-date-string
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
890 (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
891 (hebrew-calendar-yahrzeit
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
892 h-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
893 (extract-calendar-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
894 (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
895 (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n"))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
896 (goto-char (point-min))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
897 (set-buffer-modified-p nil)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
898 (setq buffer-read-only t)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
899 (display-buffer yahrzeit-buffer)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
900 (message "Computing yahrzeits...done")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
901
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
902 (defun diary-hebrew-date ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
903 "Hebrew calendar equivalent of date diary entry."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
904 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
905
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
906 (defun diary-omer (&optional mark)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
907 "Omer count diary entry.
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
908 Entry applies if date is within 50 days after Passover.
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
909
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
910 An optional parameter MARK specifies a face or single-character string to
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
911 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
912 (let* ((passover
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
913 (calendar-absolute-from-hebrew
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
914 (list 1 15 (+ (extract-calendar-year date) 3760))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
915 (omer (- (calendar-absolute-from-gregorian date) passover))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
916 (week (/ omer 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
917 (day (% omer 7)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
918 (if (and (> omer 0) (< omer 50))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
919 (cons mark
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
920 (format "Day %d%s of the omer (until sunset)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
921 omer
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
922 (if (zerop week)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
923 ""
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
924 (format ", that is, %d week%s%s"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
925 week
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
926 (if (= week 1) "" "s")
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
927 (if (zerop day)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
928 ""
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
929 (format " and %d day%s"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
930 day (if (= day 1) "" "s"))))))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
931
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
932 (defun diary-yahrzeit (death-month death-day death-year &optional mark)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
933 "Yahrzeit diary entry--entry applies if date is yahrzeit or the day before.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
934 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
935 to be the name of the person. Date of death is on the *civil* calendar;
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
936 although the date of death is specified by the civil calendar, the proper
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
937 Hebrew calendar yahrzeit is determined. If `european-calendar-style' is t, the
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
938 order of the parameters is changed to DEATH-DAY, DEATH-MONTH, DEATH-YEAR.
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
939
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
940 An optional parameter MARK specifies a face or single-character string to
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
941 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
942 (let* ((h-date (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
943 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
944 (if european-calendar-style
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
945 (list death-day death-month death-year)
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
946 (list death-month death-day death-year)))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
947 (h-month (extract-calendar-month h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
948 (h-day (extract-calendar-day h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
949 (h-year (extract-calendar-year h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
950 (d (calendar-absolute-from-gregorian date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
951 (yr (extract-calendar-year (calendar-hebrew-from-absolute d)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
952 (diff (- yr h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
953 (y (hebrew-calendar-yahrzeit h-date yr)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
954 (if (and (> diff 0) (or (= y d) (= y (1+ d))))
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
955 (cons mark
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
956 (format "Yahrzeit of %s%s: %d%s anniversary"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
957 entry
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
958 (if (= y d) "" " (evening)")
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
959 diff
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
960 (cond ((= (% diff 10) 1) "st")
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
961 ((= (% diff 10) 2) "nd")
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
962 ((= (% diff 10) 3) "rd")
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
963 (t "th")))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
964
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
965 (defun diary-rosh-hodesh (&optional mark)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
966 "Rosh Hodesh diary entry.
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
967 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before.
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
968
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
969 An optional parameter MARK specifies a face or single-character string to
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
970 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
971 (let* ((d (calendar-absolute-from-gregorian date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
972 (h-date (calendar-hebrew-from-absolute d))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
973 (h-month (extract-calendar-month h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
974 (h-day (extract-calendar-day h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
975 (h-year (extract-calendar-year h-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
976 (leap-year (hebrew-calendar-leap-year-p h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
977 (last-day (hebrew-calendar-last-day-of-month h-month h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
978 (h-month-names
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
979 (if leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
980 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
981 calendar-hebrew-month-name-array-common-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
982 (this-month (aref h-month-names (1- h-month)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
983 (h-yesterday (extract-calendar-day
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
984 (calendar-hebrew-from-absolute (1- d)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
985 (if (or (= h-day 30) (and (= h-day 1) (/= h-month 7)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
986 (cons mark
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
987 (format
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
988 "Rosh Hodesh %s"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
989 (if (= h-day 30)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
990 (format
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
991 "%s (first day)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
992 ;; next month must be in the same year since this
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
993 ;; month can't be the last month of the year since
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
994 ;; it has 30 days
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
995 (aref h-month-names h-month))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
996 (if (= h-yesterday 30)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
997 (format "%s (second day)" this-month)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
998 this-month))))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
999 (if (= (% d 7) 6) ;; Saturday--check for Shabbat Mevarchim
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
1000 (cons mark
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1001 (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1002 (format "Mevarchim Rosh Hodesh %s (%s)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1003 (aref h-month-names
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1004 (if (= h-month
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1005 (hebrew-calendar-last-month-of-year
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1006 h-year))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1007 0 h-month))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1008 (aref calendar-day-name-array (- 29 h-day))))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1009 ((and (< h-day 30) (> h-day 22) (= 30 last-day))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1010 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1011 (aref h-month-names h-month)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1012 (if (= h-day 29)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1013 "tomorrow"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1014 (aref calendar-day-name-array (- 29 h-day)))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1015 (aref calendar-day-name-array
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1016 (% (- 30 h-day) 7))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1017 (if (and (= h-day 29) (/= h-month 6))
46708
e82d42ccd30b (diary-rosh-hodesh): Cons MARK on in the third case.
Richard M. Stallman <rms@gnu.org>
parents: 46619
diff changeset
1018 (cons mark
e82d42ccd30b (diary-rosh-hodesh): Cons MARK on in the third case.
Richard M. Stallman <rms@gnu.org>
parents: 46619
diff changeset
1019 (format "Erev Rosh Hodesh %s"
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1020 (aref h-month-names
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1021 (if (= h-month
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1022 (hebrew-calendar-last-month-of-year
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1023 h-year))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1024 0 h-month)))))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1025
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1026 (defvar hebrew-calendar-parashiot-names
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1027 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1028 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1029 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1030 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1031 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1032 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1033 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1034 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1035 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1036 "The names of the parashiot in the Torah.")
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1037
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1038 (defun hebrew-calendar-parasha-name (p)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1039 "Name(s) corresponding to parasha P."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1040 (if (arrayp p);; combined parasha
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1041 (format "%s/%s"
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1042 (aref hebrew-calendar-parashiot-names (aref p 0))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1043 (aref hebrew-calendar-parashiot-names (aref p 1)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1044 (aref hebrew-calendar-parashiot-names p)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
1045
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1046 (defun diary-parasha (&optional mark)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1047 "Parasha diary entry--entry applies if date is a Saturday.
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1048
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
1049 An optional parameter MARK specifies a face or single-character string to
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1050 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1051 (let ((d (calendar-absolute-from-gregorian date)))
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1052 (if (= (% d 7) 6) ;; Saturday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1053 (let*
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1054 ((h-year (extract-calendar-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1055 (calendar-hebrew-from-absolute d)))
13674
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
1056 (rosh-hashanah
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1057 (calendar-absolute-from-hebrew (list 7 1 h-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1058 (passover
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1059 (calendar-absolute-from-hebrew (list 1 15 h-year)))
13674
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
1060 (rosh-hashanah-day
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
1061 (aref calendar-day-name-array (% rosh-hashanah 7)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1062 (passover-day
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1063 (aref calendar-day-name-array (% passover 7)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1064 (long-h (hebrew-calendar-long-heshvan-p h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1065 (short-k (hebrew-calendar-short-kislev-p h-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1066 (type (cond ((and long-h (not short-k)) "complete")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1067 ((and (not long-h) short-k) "incomplete")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1068 (t "regular")))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1069 (year-format
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1070 (symbol-value
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1071 (intern (format "hebrew-calendar-year-%s-%s-%s" ;; keviah
13674
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
1072 rosh-hashanah-day type passover-day))))
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1073 (first-saturday ;; of Hebrew year
13674
67da41b74267 (holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents: 13052
diff changeset
1074 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah)))
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1075 (saturday ;; which Saturday of the Hebrew year
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1076 (/ (- d first-saturday) 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1077 (parasha (aref year-format saturday)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1078 (if parasha
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1079 (cons mark
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1080 (format
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1081 "Parashat %s"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1082 (if (listp parasha) ;; Israel differs from diaspora
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1083 (if (car parasha)
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1084 (format "%s (diaspora), %s (Israel)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1085 (hebrew-calendar-parasha-name (car parasha))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1086 (hebrew-calendar-parasha-name (cdr parasha)))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1087 (format "%s (Israel)"
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1088 (hebrew-calendar-parasha-name (cdr parasha))))
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
1089 (hebrew-calendar-parasha-name parasha)))))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1090
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1091 ;; The seven ordinary year types (keviot)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1092
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1093 (defconst hebrew-calendar-year-Saturday-incomplete-Sunday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1094 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1095 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1096 43 44 45 46 47 48 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1097 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1098 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1099 29 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1100
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1101 (defconst hebrew-calendar-year-Saturday-complete-Tuesday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1102 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1103 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1104 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1105 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1106 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1107 have 30 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1108
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1109 (defconst hebrew-calendar-year-Monday-incomplete-Tuesday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1110 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1111 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1112 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1113 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1114 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1115 have 29 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1116
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1117 (defconst hebrew-calendar-year-Monday-complete-Thursday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1118 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1119 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1120 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1121 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1122 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1123 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1124
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1125 (defconst hebrew-calendar-year-Tuesday-regular-Thursday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1126 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1127 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1128 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1129 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1130 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1131 Kislev has 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1132
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1133 (defconst hebrew-calendar-year-Thursday-regular-Saturday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1134 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] 23
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1135 24 nil (nil . 25) (25 . [26 27]) ([26 27] . [28 29]) ([28 29] . 30)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1136 (30 . 31) ([31 32] . 32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1137 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1138 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1139 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1140 Kislev has 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1141
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1142 (defconst hebrew-calendar-year-Thursday-complete-Sunday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1143 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1144 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1145 43 44 45 46 47 48 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1146 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1147 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1148 have 30 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1149
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1150 ;; The seven leap year types (keviot)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1151
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1152 (defconst hebrew-calendar-year-Saturday-incomplete-Tuesday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1153 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1154 23 24 25 26 27 nil 28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1155 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1156 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1157 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1158 have 29 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1159
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1160 (defconst hebrew-calendar-year-Saturday-complete-Thursday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1161 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1162 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1163 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1164 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1165 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1166 have 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1167
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1168 (defconst hebrew-calendar-year-Monday-incomplete-Thursday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1169 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1170 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1171 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1172 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1173 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1174 have 29 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1175
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1176 (defconst hebrew-calendar-year-Monday-complete-Saturday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1177 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1178 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1179 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1180 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1181 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1182 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1183 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1184
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1185 (defconst hebrew-calendar-year-Tuesday-regular-Saturday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1186 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1187 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1188 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1189 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1190 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1191 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1192 Kislev has 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1193
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1194 (defconst hebrew-calendar-year-Thursday-incomplete-Sunday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1195 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1196 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1197 43 44 45 46 47 48 49 50]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1198 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1199 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1200 have 29 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1201
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1202 (defconst hebrew-calendar-year-Thursday-complete-Tuesday
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1203 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1204 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1205 43 44 45 46 47 48 49 [50 51]]
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1206 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1207 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1208 have 30 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1209
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1210 (provide 'cal-hebrew)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1211
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52118
diff changeset
1212 ;;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1213 ;;; cal-hebrew.el ends here