1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar.
3 ;; Copyright (C) 1995, 1997 Free Software Foundation, Inc.
5 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
6 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
8 ;; Human-Keywords: Hebrew calendar, calendar, diary
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
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.
29 ;; This collection of functions implements the features of calendar.el and
30 ;; diary.el that deal with the Hebrew calendar.
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).
36 ;; Comments, corrections, and improvements should be sent to
37 ;; Edward M. Reingold Department of Computer Science
38 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
39 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
40 ;; Urbana, Illinois 61801
46 (defun calendar-hebrew-from-absolute (date)
47 "Compute the Hebrew date (month day year) corresponding to absolute DATE.
48 The absolute date is the number of days elapsed since the (imaginary)
49 Gregorian date Sunday, December 31, 1 BC."
50 (let* ((greg-date (calendar-gregorian-from-absolute date
))
51 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
52 (1- (extract-calendar-month greg-date
))))
54 (year (+ 3760 (extract-calendar-year greg-date
))))
55 (while (>= date
(calendar-absolute-from-hebrew (list 7 1 (1+ year
))))
56 (setq year
(1+ year
)))
57 (let ((length (hebrew-calendar-last-month-of-year year
)))
59 (calendar-absolute-from-hebrew
61 (hebrew-calendar-last-day-of-month month year
)
63 (setq month
(1+ (% month length
)))))
65 (- date
(calendar-absolute-from-hebrew (list month
1 year
)))))
66 (list month day year
)))
68 (defun hebrew-calendar-leap-year-p (year)
69 "t if YEAR is a Hebrew calendar leap year."
70 (< (%
(1+ (* 7 year
)) 19) 7))
72 (defun hebrew-calendar-last-month-of-year (year)
73 "The last month of the Hebrew calendar YEAR."
74 (if (hebrew-calendar-leap-year-p year
)
78 (defun hebrew-calendar-last-day-of-month (month year
)
79 "The last day of MONTH in YEAR."
80 (if (or (memq month
(list 2 4 6 10 13))
81 (and (= month
12) (not (hebrew-calendar-leap-year-p year
)))
82 (and (= month
8) (not (hebrew-calendar-long-heshvan-p year
)))
83 (and (= month
9) (hebrew-calendar-short-kislev-p year
)))
87 (defun hebrew-calendar-elapsed-days (year)
88 "Days from Sun. prior to start of Hebrew calendar to mean conjunction of Tishri of Hebrew YEAR."
89 (let* ((months-elapsed
90 (+ (* 235 (/ (1- year
) 19));; Months in complete cycles so far.
91 (* 12 (%
(1- year
) 19)) ;; Regular months in this cycle
92 (/ (1+ (* 7 (%
(1- year
) 19))) 19)));; Leap months this cycle
93 (parts-elapsed (+ 204 (* 793 (% months-elapsed
1080))))
96 (* 793 (/ months-elapsed
1080))
97 (/ parts-elapsed
1080)))
98 (parts ;; Conjunction parts
99 (+ (* 1080 (% hours-elapsed
24)) (% parts-elapsed
1080)))
100 (day ;; Conjunction day
101 (+ 1 (* 29 months-elapsed
) (/ hours-elapsed
24)))
103 (if (or (>= parts
19440) ;; If the new moon is at or after midday,
104 (and (= (% day
7) 2);; ...or is on a Tuesday...
105 (>= parts
9924) ;; at 9 hours, 204 parts or later...
106 (not (hebrew-calendar-leap-year-p year
)));; of a
108 (and (= (% day
7) 1);; ...or is on a Monday...
109 (>= parts
16789) ;; at 15 hours, 589 parts or later...
110 (hebrew-calendar-leap-year-p (1- year
))));; at the end
112 ;; Then postpone Rosh HaShanah one day
116 (if ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
117 (memq (% alternative-day
7) (list 0 3 5))
118 ;; Then postpone it one (more) day and return
123 (defun hebrew-calendar-days-in-year (year)
124 "Number of days in Hebrew YEAR."
125 (- (hebrew-calendar-elapsed-days (1+ year
))
126 (hebrew-calendar-elapsed-days year
)))
128 (defun hebrew-calendar-long-heshvan-p (year)
129 "t if Heshvan is long in Hebrew YEAR."
130 (= (%
(hebrew-calendar-days-in-year year
) 10) 5))
132 (defun hebrew-calendar-short-kislev-p (year)
133 "t if Kislev is short in Hebrew YEAR."
134 (= (%
(hebrew-calendar-days-in-year year
) 10) 3))
136 (defun calendar-absolute-from-hebrew (date)
137 "Absolute date of Hebrew DATE.
138 The absolute date is the number of days elapsed since the (imaginary)
139 Gregorian date Sunday, December 31, 1 BC."
140 (let* ((month (extract-calendar-month date
))
141 (day (extract-calendar-day date
))
142 (year (extract-calendar-year date
)))
143 (+ day
;; Days so far this month.
144 (if (< month
7);; before Tishri
145 ;; Then add days in prior months this year before and after Nisan
147 m
7 (<= m
(hebrew-calendar-last-month-of-year year
))
148 (hebrew-calendar-last-day-of-month m year
))
151 (hebrew-calendar-last-day-of-month m year
)))
152 ;; Else add days in prior months this year
155 (hebrew-calendar-last-day-of-month m year
)))
156 (hebrew-calendar-elapsed-days year
);; Days in prior years.
157 -
1373429))) ;; Days elapsed before absolute date 1.
159 (defvar calendar-hebrew-month-name-array-common-year
160 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
161 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"])
163 (defvar calendar-hebrew-month-name-array-leap-year
164 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
165 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"])
167 (defun calendar-hebrew-date-string (&optional date
)
168 "String of Hebrew date before sunset of Gregorian DATE.
169 Defaults to today's date if DATE is not given.
170 Driven by the variable `calendar-date-display-form'."
171 (let* ((hebrew-date (calendar-hebrew-from-absolute
172 (calendar-absolute-from-gregorian
173 (or date
(calendar-current-date)))))
174 (calendar-month-name-array
175 (if (hebrew-calendar-leap-year-p (extract-calendar-year hebrew-date
))
176 calendar-hebrew-month-name-array-leap-year
177 calendar-hebrew-month-name-array-common-year
)))
178 (calendar-date-string hebrew-date nil t
)))
180 (defun calendar-print-hebrew-date ()
181 "Show the Hebrew calendar equivalent of the date under the cursor."
183 (message "Hebrew date (until sunset): %s"
184 (calendar-hebrew-date-string (calendar-cursor-to-date t
))))
186 (defun hebrew-calendar-yahrzeit (death-date year
)
187 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
188 (let* ((death-day (extract-calendar-day death-date
))
189 (death-month (extract-calendar-month death-date
))
190 (death-year (extract-calendar-year death-date
)))
192 ;; If it's Heshvan 30 it depends on the first anniversary; if
193 ;; that was not Heshvan 30, use the day before Kislev 1.
194 ((and (= death-month
8)
196 (not (hebrew-calendar-long-heshvan-p (1+ death-year
))))
197 (1- (calendar-absolute-from-hebrew (list 9 1 year
))))
198 ;; If it's Kislev 30 it depends on the first anniversary; if
199 ;; that was not Kislev 30, use the day before Teveth 1.
200 ((and (= death-month
9)
202 (hebrew-calendar-short-kislev-p (1+ death-year
)))
203 (1- (calendar-absolute-from-hebrew (list 10 1 year
))))
204 ;; If it's Adar II, use the same day in last month of
205 ;; year (Adar or Adar II).
207 (calendar-absolute-from-hebrew
208 (list (hebrew-calendar-last-month-of-year year
) death-day year
)))
209 ;; If it's the 30th in Adar I and year is not a leap year
210 ;; (so Adar has only 29 days), use the last day in Shevat.
211 ((and (= death-day
30)
213 (not (hebrew-calendar-leap-year-p year
)))
214 (calendar-absolute-from-hebrew (list 11 30 year
)))
215 ;; In all other cases, use the normal anniversary of the date of death.
216 (t (calendar-absolute-from-hebrew
217 (list death-month death-day year
))))))
219 (defun calendar-goto-hebrew-date (date &optional noecho
)
220 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is t."
222 (let* ((today (calendar-current-date))
224 "Hebrew calendar year (>3760): "
225 '(lambda (x) (> x
3760))
227 (extract-calendar-year
228 (calendar-hebrew-from-absolute
229 (calendar-absolute-from-gregorian today
))))))
230 (month-array (if (hebrew-calendar-leap-year-p year
)
231 calendar-hebrew-month-name-array-leap-year
232 calendar-hebrew-month-name-array-common-year
))
233 (completion-ignore-case t
)
237 "Hebrew calendar month name: "
238 (mapcar 'list
(append month-array nil
))
247 (calendar-absolute-from-hebrew
249 (hebrew-calendar-last-day-of-month
254 (calendar-make-alist month-array
1 'capitalize
))))
255 (last (hebrew-calendar-last-day-of-month month year
))
256 (first (if (and (= year
3761) (= month
10))
259 (format "Hebrew calendar day (%d-%d): "
261 '(lambda (x) (and (<= first x
) (<= x last
))))))
262 (list (list month day year
))))
263 (calendar-goto-date (calendar-gregorian-from-absolute
264 (calendar-absolute-from-hebrew date
)))
265 (or noecho
(calendar-print-hebrew-date)))
267 (defun holiday-hebrew (month day string
)
268 "Holiday on MONTH, DAY (Hebrew) called STRING.
269 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
270 Gregorian date in the form of the list (((month day year) STRING)). Returns
271 nil if it is not visible in the current calendar window."
272 (if (memq displayed-month
;; This test is only to speed things up a bit;
273 (list ;; it works fine without the test too.
274 (if (< 11 month
) (- month
11) (+ month
1))
275 (if (< 10 month
) (- month
10) (+ month
2))
276 (if (< 9 month
) (- month
9) (+ month
3))
277 (if (< 8 month
) (- month
8) (+ month
4))
278 (if (< 7 month
) (- month
7) (+ month
5))))
279 (let ((m1 displayed-month
)
284 (increment-calendar-month m1 y1 -
1)
285 (increment-calendar-month m2 y2
1)
286 (let* ((start-date (calendar-absolute-from-gregorian
288 (end-date (calendar-absolute-from-gregorian
289 (list m2
(calendar-last-day-of-month m2 y2
) y2
)))
290 (hebrew-start (calendar-hebrew-from-absolute start-date
))
291 (hebrew-end (calendar-hebrew-from-absolute end-date
))
292 (hebrew-y1 (extract-calendar-year hebrew-start
))
293 (hebrew-y2 (extract-calendar-year hebrew-end
)))
294 (setq year
(if (< 6 month
) hebrew-y2 hebrew-y1
))
295 (let ((date (calendar-gregorian-from-absolute
296 (calendar-absolute-from-hebrew
297 (list month day year
)))))
298 (if (calendar-date-is-visible-p date
)
299 (list (list date string
))))))))
301 (defun holiday-rosh-hashanah-etc ()
302 "List of dates related to Rosh Hashanah, as visible in calendar window."
303 (if (or (< displayed-month
8)
304 (> displayed-month
11))
305 nil
;; None of the dates is visible
306 (let* ((abs-r-h (calendar-absolute-from-hebrew
307 (list 7 1 (+ displayed-year
3761))))
310 (list (calendar-gregorian-from-absolute abs-r-h
)
311 (format "Rosh HaShanah %d" (+ 3761 displayed-year
)))
312 (list (calendar-gregorian-from-absolute (+ abs-r-h
9))
314 (list (calendar-gregorian-from-absolute (+ abs-r-h
14))
316 (list (calendar-gregorian-from-absolute (+ abs-r-h
21))
318 (list (calendar-gregorian-from-absolute (+ abs-r-h
22))
322 (list (calendar-gregorian-from-absolute
323 (calendar-dayname-on-or-before 6 (- abs-r-h
4)))
325 (list (calendar-gregorian-from-absolute (1- abs-r-h
))
326 "Erev Rosh HaShanah")
327 (list (calendar-gregorian-from-absolute (1+ abs-r-h
))
328 "Rosh HaShanah (second day)")
329 (list (calendar-gregorian-from-absolute
330 (if (= (% abs-r-h
7) 4) (+ abs-r-h
3) (+ abs-r-h
2)))
332 (list (calendar-gregorian-from-absolute
333 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h
)))
335 (list (calendar-gregorian-from-absolute (+ abs-r-h
8))
337 (list (calendar-gregorian-from-absolute (+ abs-r-h
13))
339 (list (calendar-gregorian-from-absolute (+ abs-r-h
15))
340 "Sukkot (second day)")
341 (list (calendar-gregorian-from-absolute (+ abs-r-h
16))
342 "Hol Hamoed Sukkot (first day)")
343 (list (calendar-gregorian-from-absolute (+ abs-r-h
17))
344 "Hol Hamoed Sukkot (second day)")
345 (list (calendar-gregorian-from-absolute (+ abs-r-h
18))
346 "Hol Hamoed Sukkot (third day)")
347 (list (calendar-gregorian-from-absolute (+ abs-r-h
19))
348 "Hol Hamoed Sukkot (fourth day)")
349 (list (calendar-gregorian-from-absolute (+ abs-r-h
20))
350 "Hoshannah Rabbah")))
352 (filter-visible-calendar-holidays mandatory
)))
353 (if all-hebrew-calendar-holidays
356 (filter-visible-calendar-holidays optional
)
360 (defun holiday-hanukkah ()
361 "List of dates related to Hanukkah, as visible in calendar window."
362 (if (memq displayed-month
;; This test is only to speed things up a bit;
363 '(10 11 12 1 2));; it works fine without the test too.
364 (let ((m displayed-month
)
366 (increment-calendar-month m y
1)
367 (let* ((h-y (extract-calendar-year
368 (calendar-hebrew-from-absolute
369 (calendar-absolute-from-gregorian
370 (list m
(calendar-last-day-of-month m y
) y
)))))
371 (abs-h (calendar-absolute-from-hebrew (list 9 25 h-y
))))
372 (filter-visible-calendar-holidays
374 (list (calendar-gregorian-from-absolute (1- abs-h
))
376 (list (calendar-gregorian-from-absolute abs-h
)
377 "Hanukkah (first day)")
378 (list (calendar-gregorian-from-absolute (1+ abs-h
))
379 "Hanukkah (second day)")
380 (list (calendar-gregorian-from-absolute (+ abs-h
2))
381 "Hanukkah (third day)")
382 (list (calendar-gregorian-from-absolute (+ abs-h
3))
383 "Hanukkah (fourth day)")
384 (list (calendar-gregorian-from-absolute (+ abs-h
4))
385 "Hanukkah (fifth day)")
386 (list (calendar-gregorian-from-absolute (+ abs-h
5))
387 "Hanukkah (sixth day)")
388 (list (calendar-gregorian-from-absolute (+ abs-h
6))
389 "Hanukkah (seventh day)")
390 (list (calendar-gregorian-from-absolute (+ abs-h
7))
391 "Hanukkah (eighth day)")))))))
393 (defun holiday-passover-etc ()
394 "List of dates related to Passover, as visible in calendar window."
395 (if (< 7 displayed-month
)
396 nil
;; None of the dates is visible
397 (let* ((abs-p (calendar-absolute-from-hebrew
398 (list 1 15 (+ displayed-year
3760))))
401 (list (calendar-gregorian-from-absolute abs-p
)
403 (list (calendar-gregorian-from-absolute (+ abs-p
50))
407 (list (calendar-gregorian-from-absolute
408 (calendar-dayname-on-or-before 6 (- abs-p
43)))
410 (list (calendar-gregorian-from-absolute
411 (calendar-dayname-on-or-before 6 (- abs-p
30)))
413 (list (calendar-gregorian-from-absolute
414 (if (= (% abs-p
7) 2) (- abs-p
33) (- abs-p
31)))
416 (list (calendar-gregorian-from-absolute (- abs-p
31))
418 (list (calendar-gregorian-from-absolute (- abs-p
30))
420 (list (calendar-gregorian-from-absolute
421 (if (zerop (% abs-p
7)) (- abs-p
28) (- abs-p
29)))
423 (list (calendar-gregorian-from-absolute
424 (- (calendar-dayname-on-or-before 6 (- abs-p
14)) 7))
426 (list (calendar-gregorian-from-absolute
427 (calendar-dayname-on-or-before 6 (- abs-p
14)))
429 (list (calendar-gregorian-from-absolute
430 (calendar-dayname-on-or-before 6 (1- abs-p
)))
432 (list (calendar-gregorian-from-absolute (1- abs-p
))
434 (list (calendar-gregorian-from-absolute (1+ abs-p
))
435 "Passover (second day)")
436 (list (calendar-gregorian-from-absolute (+ abs-p
2))
437 "Hol Hamoed Passover (first day)")
438 (list (calendar-gregorian-from-absolute (+ abs-p
3))
439 "Hol Hamoed Passover (second day)")
440 (list (calendar-gregorian-from-absolute (+ abs-p
4))
441 "Hol Hamoed Passover (third day)")
442 (list (calendar-gregorian-from-absolute (+ abs-p
5))
443 "Hol Hamoed Passover (fourth day)")
444 (list (calendar-gregorian-from-absolute (+ abs-p
6))
445 "Passover (seventh day)")
446 (list (calendar-gregorian-from-absolute (+ abs-p
7))
447 "Passover (eighth day)")
448 (list (calendar-gregorian-from-absolute
449 (if (zerop (%
(+ abs-p
12) 7))
453 (list (calendar-gregorian-from-absolute
454 (if (zerop (% abs-p
7))
456 (if (= (% abs-p
7) 6)
460 (list (calendar-gregorian-from-absolute (+ abs-p
33))
462 (list (calendar-gregorian-from-absolute (+ abs-p
43))
464 (list (calendar-gregorian-from-absolute (+ abs-p
49))
466 (list (calendar-gregorian-from-absolute (+ abs-p
51))
467 "Shavuot (second day)")))
469 (filter-visible-calendar-holidays mandatory
)))
470 (if all-hebrew-calendar-holidays
473 (filter-visible-calendar-holidays optional
)
477 (defun holiday-tisha-b-av-etc ()
478 "List of dates around Tisha B'Av, as visible in calendar window."
479 (if (or (< displayed-month
5)
480 (> displayed-month
9))
481 nil
;; None of the dates is visible
482 (let* ((abs-t-a (calendar-absolute-from-hebrew
483 (list 5 9 (+ displayed-year
3760)))))
485 (filter-visible-calendar-holidays
487 (list (calendar-gregorian-from-absolute
488 (if (= (% abs-t-a
7) 6) (- abs-t-a
20) (- abs-t-a
21)))
490 (list (calendar-gregorian-from-absolute
491 (calendar-dayname-on-or-before 6 abs-t-a
))
493 (list (calendar-gregorian-from-absolute
494 (if (= (% abs-t-a
7) 6) (1+ abs-t-a
) abs-t-a
))
496 (list (calendar-gregorian-from-absolute
497 (calendar-dayname-on-or-before 6 (+ abs-t-a
7)))
498 "Shabbat Nahamu"))))))
500 (defun list-hebrew-diary-entries ()
501 "Add any Hebrew date entries from the diary file to `diary-entries-list'.
502 Hebrew date diary entries must be prefaced by `hebrew-diary-entry-symbol'
503 \(normally an `H'). The same diary date forms govern the style of the Hebrew
504 calendar entries, except that the Hebrew month names must be spelled in full.
505 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
506 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
507 common Hebrew year. If a Hebrew date diary entry begins with a
508 `diary-nonmarking-symbol', the entry will appear in the diary listing, but will
509 not be marked in the calendar. This function is provided for use with the
510 `nongregorian-diary-listing-hook'."
512 (let ((buffer-read-only nil
)
513 (diary-modified (buffer-modified-p))
514 (gdate original-date
)
515 (mark (regexp-quote diary-nonmarking-symbol
)))
516 (calendar-for-loop i from
1 to number do
517 (let* ((d diary-date-forms
)
518 (hdate (calendar-hebrew-from-absolute
519 (calendar-absolute-from-gregorian gdate
)))
520 (month (extract-calendar-month hdate
))
521 (day (extract-calendar-day hdate
))
522 (year (extract-calendar-year hdate
)))
525 ((date-form (if (equal (car (car d
)) 'backup
)
528 (backup (equal (car (car d
)) 'backup
))
531 (calendar-day-name gdate
) "\\|"
532 (substring (calendar-day-name gdate
) 0 3) ".?"))
533 (calendar-month-name-array
534 calendar-hebrew-month-name-array-leap-year
)
538 (calendar-month-name month
)))
539 (month (concat "\\*\\|0*" (int-to-string month
)))
540 (day (concat "\\*\\|0*" (int-to-string day
)))
543 "\\*\\|0*" (int-to-string year
)
544 (if abbreviated-calendar-year
545 (concat "\\|" (int-to-string (% year
100)))
549 "\\(\\`\\|\^M\\|\n\\)" mark
"?"
550 (regexp-quote hebrew-diary-entry-symbol
)
552 (mapconcat 'eval date-form
"\\)\\(")
554 (case-fold-search t
))
555 (goto-char (point-min))
556 (while (re-search-forward regexp nil t
)
557 (if backup
(re-search-backward "\\<" nil t
))
558 (if (and (or (char-equal (preceding-char) ?\^M
)
559 (char-equal (preceding-char) ?
\n))
560 (not (looking-at " \\|\^I")))
561 ;; Diary entry that consists only of date.
563 ;; Found a nonempty diary entry--make it visible and
564 ;; add it to the list.
565 (let ((entry-start (point))
567 (re-search-backward "\^M\\|\n\\|\\`")
568 (setq date-start
(point))
569 (re-search-forward "\^M\\|\n" nil t
2)
570 (while (looking-at " \\|\^I")
571 (re-search-forward "\^M\\|\n" nil t
))
573 (subst-char-in-region date-start
(point) ?\^M ?
\n t
)
576 (buffer-substring-no-properties entry-start
(point))
577 (buffer-substring-no-properties
578 (1+ date-start
) (1- entry-start
)))))))
581 (calendar-gregorian-from-absolute
582 (1+ (calendar-absolute-from-gregorian gdate
)))))
583 (set-buffer-modified-p diary-modified
))
584 (goto-char (point-min))))
586 (defun mark-hebrew-diary-entries ()
587 "Mark days in the calendar window that have Hebrew date diary entries.
588 Each entry in diary-file (or included files) visible in the calendar window
589 is marked. Hebrew date entries are prefaced by a hebrew-diary-entry-symbol
590 \(normally an `H'). The same diary-date-forms govern the style of the Hebrew
591 calendar entries, except that the Hebrew month names must be spelled in full.
592 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
593 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
594 common Hebrew year. Hebrew date diary entries that begin with a
595 diary-nonmarking symbol will not be marked in the calendar. This function
596 is provided for use as part of the nongregorian-diary-marking-hook."
597 (let ((d diary-date-forms
))
600 ((date-form (if (equal (car (car d
)) 'backup
)
602 (car d
)));; ignore 'backup directive
603 (dayname (diary-name-pattern calendar-day-name-array
))
606 (diary-name-pattern calendar-hebrew-month-name-array-leap-year t
)
608 (month "[0-9]+\\|\\*")
610 (year "[0-9]+\\|\\*")
611 (l (length date-form
))
612 (d-name-pos (- l
(length (memq 'dayname date-form
))))
613 (d-name-pos (if (/= l d-name-pos
) (+ 2 d-name-pos
)))
614 (m-name-pos (- l
(length (memq 'monthname date-form
))))
615 (m-name-pos (if (/= l m-name-pos
) (+ 2 m-name-pos
)))
616 (d-pos (- l
(length (memq 'day date-form
))))
617 (d-pos (if (/= l d-pos
) (+ 2 d-pos
)))
618 (m-pos (- l
(length (memq 'month date-form
))))
619 (m-pos (if (/= l m-pos
) (+ 2 m-pos
)))
620 (y-pos (- l
(length (memq 'year date-form
))))
621 (y-pos (if (/= l y-pos
) (+ 2 y-pos
)))
624 "\\(\\`\\|\^M\\|\n\\)"
625 (regexp-quote hebrew-diary-entry-symbol
)
627 (mapconcat 'eval date-form
"\\)\\(")
629 (case-fold-search t
))
630 (goto-char (point-min))
631 (while (re-search-forward regexp nil t
)
635 (match-beginning d-name-pos
)
636 (match-end d-name-pos
))))
640 (match-beginning m-name-pos
)
641 (match-end m-name-pos
))))
645 (match-beginning m-pos
)
651 (match-beginning d-pos
)
656 (match-beginning y-pos
)
660 (if (and (= (length y-str
) 2)
661 abbreviated-calendar-year
)
663 (extract-calendar-year
664 (calendar-hebrew-from-absolute
665 (calendar-absolute-from-gregorian
666 (calendar-current-date)))))
667 (y (+ (string-to-int y-str
)
668 (* 100 (/ current-y
100)))))
669 (if (> (- y current-y
) 50)
671 (if (> (- current-y y
) 50)
674 (string-to-int y-str
)))))
676 (mark-calendar-days-named
677 (cdr (assoc (capitalize (substring dd-name
0 3))
679 calendar-day-name-array
681 '(lambda (x) (substring x
0 3))))))
683 (if (string-equal mm-name
"*")
691 calendar-hebrew-month-name-array-leap-year
))))))
692 (mark-hebrew-calendar-date-pattern mm dd yy
)))))
695 (defun mark-hebrew-calendar-date-pattern (month day year
)
696 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
697 A value of 0 in any position is a wildcard."
699 (set-buffer calendar-buffer
)
700 (if (and (/= 0 month
) (/= 0 day
))
702 ;; Fully specified Hebrew date.
703 (let ((date (calendar-gregorian-from-absolute
704 (calendar-absolute-from-hebrew
705 (list month day year
)))))
706 (if (calendar-date-is-visible-p date
)
707 (mark-visible-calendar-date date
)))
708 ;; Month and day in any year--this taken from the holiday stuff.
709 (if (memq displayed-month
;; This test is only to speed things up a
710 (list ;; bit; it works fine without the test too.
711 (if (< 11 month
) (- month
11) (+ month
1))
712 (if (< 10 month
) (- month
10) (+ month
2))
713 (if (< 9 month
) (- month
9) (+ month
3))
714 (if (< 8 month
) (- month
8) (+ month
4))
715 (if (< 7 month
) (- month
7) (+ month
5))))
716 (let ((m1 displayed-month
)
721 (increment-calendar-month m1 y1 -
1)
722 (increment-calendar-month m2 y2
1)
723 (let* ((start-date (calendar-absolute-from-gregorian
725 (end-date (calendar-absolute-from-gregorian
727 (calendar-last-day-of-month m2 y2
)
730 (calendar-hebrew-from-absolute start-date
))
731 (hebrew-end (calendar-hebrew-from-absolute end-date
))
732 (hebrew-y1 (extract-calendar-year hebrew-start
))
733 (hebrew-y2 (extract-calendar-year hebrew-end
)))
734 (setq year
(if (< 6 month
) hebrew-y2 hebrew-y1
))
735 (let ((date (calendar-gregorian-from-absolute
736 (calendar-absolute-from-hebrew
737 (list month day year
)))))
738 (if (calendar-date-is-visible-p date
)
739 (mark-visible-calendar-date date
)))))))
740 ;; Not one of the simple cases--check all visible dates for match.
741 ;; Actually, the following code takes care of ALL of the cases, but
742 ;; it's much too slow to be used for the simple (common) cases.
743 (let ((m displayed-month
)
747 (increment-calendar-month m y -
1)
749 (calendar-absolute-from-gregorian
751 (increment-calendar-month m y
2)
753 (calendar-absolute-from-gregorian
754 (list m
(calendar-last-day-of-month m y
) y
)))
755 (calendar-for-loop date from first-date to last-date do
756 (let* ((h-date (calendar-hebrew-from-absolute date
))
757 (h-month (extract-calendar-month h-date
))
758 (h-day (extract-calendar-day h-date
))
759 (h-year (extract-calendar-year h-date
)))
760 (and (or (zerop month
)
766 (mark-visible-calendar-date
767 (calendar-gregorian-from-absolute date
)))))))))
769 (defun insert-hebrew-diary-entry (arg)
770 "Insert a diary entry.
771 For the Hebrew date corresponding to the date indicated by point.
772 Prefix arg will make the entry nonmarking."
774 (let* ((calendar-month-name-array
775 calendar-hebrew-month-name-array-leap-year
))
778 hebrew-diary-entry-symbol
779 (calendar-date-string
780 (calendar-hebrew-from-absolute
781 (calendar-absolute-from-gregorian
782 (calendar-cursor-to-date t
)))
786 (defun insert-monthly-hebrew-diary-entry (arg)
787 "Insert a monthly diary entry.
788 For the day of the Hebrew month corresponding to the date indicated by point.
789 Prefix arg will make the entry nonmarking."
791 (let* ((calendar-date-display-form
792 (if european-calendar-style
'(day " * ") '("* " day
)))
793 (calendar-month-name-array
794 calendar-hebrew-month-name-array-leap-year
))
797 hebrew-diary-entry-symbol
798 (calendar-date-string
799 (calendar-hebrew-from-absolute
800 (calendar-absolute-from-gregorian
801 (calendar-cursor-to-date t
)))))
804 (defun insert-yearly-hebrew-diary-entry (arg)
805 "Insert an annual diary entry.
806 For the day of the Hebrew year corresponding to the date indicated by point.
807 Prefix arg will make the entry nonmarking."
809 (let* ((calendar-date-display-form
810 (if european-calendar-style
812 '(monthname " " day
)))
813 (calendar-month-name-array
814 calendar-hebrew-month-name-array-leap-year
))
817 hebrew-diary-entry-symbol
818 (calendar-date-string
819 (calendar-hebrew-from-absolute
820 (calendar-absolute-from-gregorian
821 (calendar-cursor-to-date t
)))))
825 (defun list-yahrzeit-dates (death-date start-year end-year
)
826 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
827 When called interactively from the calendar window, the date of death is taken
828 from the cursor position."
831 (if (equal (current-buffer) (get-buffer calendar-buffer
))
832 (calendar-cursor-to-date)
833 (let* ((today (calendar-current-date))
835 "Year of death (>0): "
836 '(lambda (x) (> x
0))
837 (int-to-string (extract-calendar-year today
))))
838 (month-array calendar-month-name-array
)
839 (completion-ignore-case t
)
843 "Month of death (name): "
844 (mapcar 'list
(append month-array nil
))
847 month-array
1 'capitalize
))))
848 (last (calendar-last-day-of-month month year
))
850 (format "Day of death (1-%d): " last
)
851 '(lambda (x) (and (< 0 x
) (<= x last
))))))
852 (list month day year
))))
853 (death-year (extract-calendar-year death-date
))
854 (start-year (calendar-read
855 (format "Starting year of Yahrzeit table (>%d): "
857 '(lambda (x) (> x death-year
))
858 (int-to-string (1+ death-year
))))
859 (end-year (calendar-read
860 (format "Ending year of Yahrzeit table (>=%d): "
862 '(lambda (x) (>= x start-year
)))))
863 (list death-date start-year end-year
)))
864 (message "Computing yahrzeits...")
865 (let* ((yahrzeit-buffer "*Yahrzeits*")
866 (h-date (calendar-hebrew-from-absolute
867 (calendar-absolute-from-gregorian death-date
)))
868 (h-month (extract-calendar-month h-date
))
869 (h-day (extract-calendar-day h-date
))
870 (h-year (extract-calendar-year h-date
)))
871 (set-buffer (get-buffer-create yahrzeit-buffer
))
872 (setq buffer-read-only nil
)
873 (calendar-set-mode-line
874 (format "Yahrzeit dates for %s = %s"
875 (calendar-date-string death-date
)
876 (let ((calendar-month-name-array
877 (if (hebrew-calendar-leap-year-p h-year
)
878 calendar-hebrew-month-name-array-leap-year
879 calendar-hebrew-month-name-array-common-year
)))
880 (calendar-date-string h-date nil t
))))
882 (goto-char (point-min))
883 (calendar-for-loop i from start-year to end-year do
885 (calendar-date-string
886 (calendar-gregorian-from-absolute
887 (hebrew-calendar-yahrzeit
889 (extract-calendar-year
890 (calendar-hebrew-from-absolute
891 (calendar-absolute-from-gregorian (list 1 1 i
))))))) "\n"))
892 (goto-char (point-min))
893 (set-buffer-modified-p nil
)
894 (setq buffer-read-only t
)
895 (display-buffer yahrzeit-buffer
)
896 (message "Computing yahrzeits...done")))
898 (defun diary-hebrew-date ()
899 "Hebrew calendar equivalent of date diary entry."
900 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date
)))
903 "Omer count diary entry.
904 Entry applies if date is within 50 days after Passover."
906 (calendar-absolute-from-hebrew
907 (list 1 15 (+ (extract-calendar-year date
) 3760))))
908 (omer (- (calendar-absolute-from-gregorian date
) passover
))
911 (if (and (> omer
0) (< omer
50))
912 (format "Day %d%s of the omer (until sunset)"
916 (format ", that is, %d week%s%s"
918 (if (= week
1) "" "s")
921 (format " and %d day%s"
922 day
(if (= day
1) "" "s")))))))))
924 (defun diary-yahrzeit (death-month death-day death-year
)
925 "Yahrzeit diary entry--entry applies if date is yahrzeit or the day before.
926 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed
927 to be the name of the person. Date of death is on the *civil* calendar;
928 although the date of death is specified by the civil calendar, the proper
929 Hebrew calendar yahrzeit is determined. If `european-calendar-style' is t, the
930 order of the parameters is changed to DEATH-DAY, DEATH-MONTH, DEATH-YEAR."
931 (let* ((h-date (calendar-hebrew-from-absolute
932 (calendar-absolute-from-gregorian
933 (if european-calendar-style
934 (list death-day death-month death-year
)
935 (list death-month death-day death-year
)))))
936 (h-month (extract-calendar-month h-date
))
937 (h-day (extract-calendar-day h-date
))
938 (h-year (extract-calendar-year h-date
))
939 (d (calendar-absolute-from-gregorian date
))
940 (yr (extract-calendar-year (calendar-hebrew-from-absolute d
)))
942 (y (hebrew-calendar-yahrzeit h-date yr
)))
943 (if (and (> diff
0) (or (= y d
) (= y
(1+ d
))))
944 (format "Yahrzeit of %s%s: %d%s anniversary"
946 (if (= y d
) "" " (evening)")
948 (cond ((= (% diff
10) 1) "st")
949 ((= (% diff
10) 2) "nd")
950 ((= (% diff
10) 3) "rd")
953 (defun diary-rosh-hodesh ()
954 "Rosh Hodesh diary entry.
955 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before."
956 (let* ((d (calendar-absolute-from-gregorian date
))
957 (h-date (calendar-hebrew-from-absolute d
))
958 (h-month (extract-calendar-month h-date
))
959 (h-day (extract-calendar-day h-date
))
960 (h-year (extract-calendar-year h-date
))
961 (leap-year (hebrew-calendar-leap-year-p h-year
))
962 (last-day (hebrew-calendar-last-day-of-month h-month h-year
))
965 calendar-hebrew-month-name-array-leap-year
966 calendar-hebrew-month-name-array-common-year
))
967 (this-month (aref h-month-names
(1- h-month
)))
968 (h-yesterday (extract-calendar-day
969 (calendar-hebrew-from-absolute (1- d
)))))
970 (if (or (= h-day
30) (and (= h-day
1) (/= h-month
7)))
976 ;; next month must be in the same year since this
977 ;; month can't be the last month of the year since
979 (aref h-month-names h-month
))
980 (if (= h-yesterday
30)
981 (format "%s (second day)" this-month
)
983 (if (= (% d
7) 6);; Saturday--check for Shabbat Mevarhim
984 (cond ((and (> h-day
22) (/= h-month
6) (= 29 last-day
))
985 (format "Mevarhim Rosh Hodesh %s (%s)"
988 (hebrew-calendar-last-month-of-year
991 (aref calendar-day-name-array
(- 29 h-day
))))
992 ((and (< h-day
30) (> h-day
22) (= 30 last-day
))
993 (format "Mevarhim Rosh Hodesh %s (%s-%s)"
994 (aref h-month-names h-month
)
997 (aref calendar-day-name-array
(- 29 h-day
)))
998 (aref calendar-day-name-array
999 (%
(- 30 h-day
) 7)))))
1000 (if (and (= h-day
29) (/= h-month
6))
1001 (format "Erev Rosh Hodesh %s"
1004 (hebrew-calendar-last-month-of-year
1008 (defun diary-parasha ()
1009 "Parasha diary entry--entry applies if date is a Saturday."
1010 (let ((d (calendar-absolute-from-gregorian date
)))
1011 (if (= (% d
7) 6);; Saturday
1013 ((h-year (extract-calendar-year
1014 (calendar-hebrew-from-absolute d
)))
1016 (calendar-absolute-from-hebrew (list 7 1 h-year
)))
1018 (calendar-absolute-from-hebrew (list 1 15 h-year
)))
1020 (aref calendar-day-name-array
(% rosh-hashanah
7)))
1022 (aref calendar-day-name-array
(% passover
7)))
1023 (long-h (hebrew-calendar-long-heshvan-p h-year
))
1024 (short-k (hebrew-calendar-short-kislev-p h-year
))
1025 (type (cond ((and long-h
(not short-k
)) "complete")
1026 ((and (not long-h
) short-k
) "incomplete")
1030 (intern (format "hebrew-calendar-year-%s-%s-%s";; keviah
1031 rosh-hashanah-day type passover-day
))))
1032 (first-saturday;; of Hebrew year
1033 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah
)))
1034 (saturday;; which Saturday of the Hebrew year
1035 (/ (- d first-saturday
) 7))
1036 (parasha (aref year-format saturday
)))
1040 (if (listp parasha
);; Israel differs from diaspora
1042 (format "%s (diaspora), %s (Israel)"
1043 (hebrew-calendar-parasha-name (car parasha
))
1044 (hebrew-calendar-parasha-name (cdr parasha
)))
1045 (format "%s (Israel)"
1046 (hebrew-calendar-parasha-name (cdr parasha
))))
1047 (hebrew-calendar-parasha-name parasha
))))))))
1049 (defvar hebrew-calendar-parashiot-names
1050 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
1051 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
1052 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
1053 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
1054 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
1055 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
1056 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
1057 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
1058 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
1059 "The names of the parashiot in the Torah.")
1061 ;; The seven ordinary year types (keviot)
1063 (defconst hebrew-calendar-year-Saturday-incomplete-Sunday
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]
1065 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1066 43 44 45 46 47 48 49 50]
1067 "The structure of the parashiot.
1068 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
1069 29 days), and has Passover start on Sunday.")
1071 (defconst hebrew-calendar-year-Saturday-complete-Tuesday
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]
1073 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1074 43 44 45 46 47 48 49 [50 51]]
1075 "The structure of the parashiot.
1076 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1077 have 30 days), and has Passover start on Tuesday.")
1079 (defconst hebrew-calendar-year-Monday-incomplete-Tuesday
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]
1081 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1082 43 44 45 46 47 48 49 [50 51]]
1083 "The structure of the parashiot.
1084 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1085 have 29 days), and has Passover start on Tuesday.")
1087 (defconst hebrew-calendar-year-Monday-complete-Thursday
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]
1089 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
1090 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1091 "The structure of the parashiot.
1092 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1093 30 days), and has Passover start on Thursday.")
1095 (defconst hebrew-calendar-year-Tuesday-regular-Thursday
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]
1097 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
1098 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1099 "The structure of the parashiot.
1100 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1101 Kislev has 30 days), and has Passover start on Thursday.")
1103 (defconst hebrew-calendar-year-Thursday-regular-Saturday
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
1105 24 nil
(nil .
25) (25 .
[26 27]) ([26 27] .
[28 29]) ([28 29] .
30)
1106 (30 .
31) ([31 32] .
32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
1108 "The structure of the parashiot.
1109 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
1110 Kislev has 30 days), and has Passover start on Saturday.")
1112 (defconst hebrew-calendar-year-Thursday-complete-Sunday
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
1114 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1115 43 44 45 46 47 48 49 50]
1116 "The structure of the parashiot.
1117 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
1118 have 30 days), and has Passover start on Sunday.")
1120 ;; The seven leap year types (keviot)
1122 (defconst hebrew-calendar-year-Saturday-incomplete-Tuesday
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
1124 23 24 25 26 27 nil
28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
1125 43 44 45 46 47 48 49 [50 51]]
1126 "The structure of the parashiot.
1127 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
1128 have 29 days), and has Passover start on Tuesday.")
1130 (defconst hebrew-calendar-year-Saturday-complete-Thursday
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
1132 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1133 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1134 "The structure of the parashiot.
1135 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1136 have 30 days), and has Passover start on Thursday.")
1138 (defconst hebrew-calendar-year-Monday-incomplete-Thursday
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
1140 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1141 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1142 "The structure of the parashiot.
1143 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1144 have 29 days), and has Passover start on Thursday.")
1146 (defconst hebrew-calendar-year-Monday-complete-Saturday
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
1148 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1149 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1150 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1151 "The structure of the parashiot.
1152 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1153 30 days), and has Passover start on Saturday.")
1155 (defconst hebrew-calendar-year-Tuesday-regular-Saturday
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
1157 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1158 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1159 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1160 "The structure of the parashiot.
1161 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1162 Kislev has 30 days), and has Passover start on Saturday.")
1164 (defconst hebrew-calendar-year-Thursday-incomplete-Sunday
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
1166 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1167 43 44 45 46 47 48 49 50]
1168 "The structure of the parashiot.
1169 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
1170 have 29 days), and has Passover start on Sunday.")
1172 (defconst hebrew-calendar-year-Thursday-complete-Tuesday
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
1174 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1175 43 44 45 46 47 48 49 [50 51]]
1176 "The structure of the parashiot.
1177 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
1178 have 30 days), and has Passover start on Tuesday.")
1180 (defun hebrew-calendar-parasha-name (p)
1181 "Name(s) corresponding to parasha P."
1182 (if (arrayp p
);; combined parasha
1184 (aref hebrew-calendar-parashiot-names
(aref p
0))
1185 (aref hebrew-calendar-parashiot-names
(aref p
1)))
1186 (aref hebrew-calendar-parashiot-names p
)))
1188 (provide 'cal-hebrew
)
1190 ;;; cal-hebrew.el ends here