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