1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
4 ;; Free Software Foundation, Inc.
6 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
7 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
8 ;; Maintainer: Glenn Morris <rgm@gnu.org>
10 ;; Human-Keywords: Hebrew calendar, calendar, diary
12 ;; This file is part of GNU Emacs.
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 3, or (at your option)
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 ;; Boston, MA 02110-1301, USA.
31 ;; This collection of functions implements the features of calendar.el and
32 ;; diary.el that deal with the Hebrew calendar.
34 ;; Technical details of all the calendrical calculations can be found in
35 ;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
36 ;; and Nachum Dershowitz, Cambridge University Press (2001).
41 (defvar displayed-month
)
42 (defvar displayed-year
)
45 (defvar original-date
)
51 (defun hebrew-calendar-leap-year-p (year)
52 "t if YEAR is a Hebrew calendar leap year."
53 (< (%
(1+ (* 7 year
)) 19) 7))
55 (defun hebrew-calendar-last-month-of-year (year)
56 "The last month of the Hebrew calendar YEAR."
57 (if (hebrew-calendar-leap-year-p year
)
61 (defun hebrew-calendar-elapsed-days (year)
62 "Days from Sun. prior to start of Hebrew calendar to mean conjunction of Tishri of Hebrew YEAR."
63 (let* ((months-elapsed
64 (+ (* 235 (/ (1- year
) 19));; Months in complete cycles so far.
65 (* 12 (%
(1- year
) 19)) ;; Regular months in this cycle
66 (/ (1+ (* 7 (%
(1- year
) 19))) 19)));; Leap months this cycle
67 (parts-elapsed (+ 204 (* 793 (% months-elapsed
1080))))
70 (* 793 (/ months-elapsed
1080))
71 (/ parts-elapsed
1080)))
72 (parts ;; Conjunction parts
73 (+ (* 1080 (% hours-elapsed
24)) (% parts-elapsed
1080)))
74 (day ;; Conjunction day
75 (+ 1 (* 29 months-elapsed
) (/ hours-elapsed
24)))
77 (if (or (>= parts
19440) ;; If the new moon is at or after midday,
78 (and (= (% day
7) 2);; ...or is on a Tuesday...
79 (>= parts
9924) ;; at 9 hours, 204 parts or later...
80 (not (hebrew-calendar-leap-year-p year
)));; of a
82 (and (= (% day
7) 1);; ...or is on a Monday...
83 (>= parts
16789) ;; at 15 hours, 589 parts or later...
84 (hebrew-calendar-leap-year-p (1- year
))));; at the end
86 ;; Then postpone Rosh HaShanah one day
90 (if ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
91 (memq (% alternative-day
7) (list 0 3 5))
92 ;; Then postpone it one (more) day and return
97 (defun hebrew-calendar-days-in-year (year)
98 "Number of days in Hebrew YEAR."
99 (- (hebrew-calendar-elapsed-days (1+ year
))
100 (hebrew-calendar-elapsed-days year
)))
102 (defun hebrew-calendar-long-heshvan-p (year)
103 "t if Heshvan is long in Hebrew YEAR."
104 (= (%
(hebrew-calendar-days-in-year year
) 10) 5))
106 (defun hebrew-calendar-short-kislev-p (year)
107 "t if Kislev is short in Hebrew YEAR."
108 (= (%
(hebrew-calendar-days-in-year year
) 10) 3))
110 (defun hebrew-calendar-last-day-of-month (month year
)
111 "The last day of MONTH in YEAR."
112 (if (or (memq month
(list 2 4 6 10 13))
113 (and (= month
12) (not (hebrew-calendar-leap-year-p year
)))
114 (and (= month
8) (not (hebrew-calendar-long-heshvan-p year
)))
115 (and (= month
9) (hebrew-calendar-short-kislev-p year
)))
119 (defun calendar-absolute-from-hebrew (date)
120 "Absolute date of Hebrew DATE.
121 The absolute date is the number of days elapsed since the (imaginary)
122 Gregorian date Sunday, December 31, 1 BC."
123 (let* ((month (extract-calendar-month date
))
124 (day (extract-calendar-day date
))
125 (year (extract-calendar-year date
)))
126 (+ day
;; Days so far this month.
127 (if (< month
7);; before Tishri
128 ;; Then add days in prior months this year before and after Nisan
130 m
7 (<= m
(hebrew-calendar-last-month-of-year year
))
131 (hebrew-calendar-last-day-of-month m year
))
134 (hebrew-calendar-last-day-of-month m year
)))
135 ;; Else add days in prior months this year
138 (hebrew-calendar-last-day-of-month m year
)))
139 (hebrew-calendar-elapsed-days year
);; Days in prior years.
140 -
1373429))) ;; Days elapsed before absolute date 1.
142 (defun calendar-hebrew-from-absolute (date)
143 "Compute the Hebrew date (month day year) corresponding to absolute DATE.
144 The absolute date is the number of days elapsed since the (imaginary)
145 Gregorian date Sunday, December 31, 1 BC."
146 (let* ((greg-date (calendar-gregorian-from-absolute date
))
147 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
148 (1- (extract-calendar-month greg-date
))))
150 (year (+ 3760 (extract-calendar-year greg-date
))))
151 (while (>= date
(calendar-absolute-from-hebrew (list 7 1 (1+ year
))))
152 (setq year
(1+ year
)))
153 (let ((length (hebrew-calendar-last-month-of-year year
)))
155 (calendar-absolute-from-hebrew
157 (hebrew-calendar-last-day-of-month month year
)
159 (setq month
(1+ (% month length
)))))
161 (- date
(calendar-absolute-from-hebrew (list month
1 year
)))))
162 (list month day year
)))
164 (defvar calendar-hebrew-month-name-array-common-year
165 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
166 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]
167 "Array of strings giving the names of the Hebrew months in a common year.")
169 (defvar calendar-hebrew-month-name-array-leap-year
170 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
171 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]
172 "Array of strings giving the names of the Hebrew months in a leap year.")
174 (defun calendar-hebrew-date-string (&optional date
)
175 "String of Hebrew date before sunset of Gregorian DATE.
176 Defaults to today's date if DATE is not given.
177 Driven by the variable `calendar-date-display-form'."
178 (let* ((hebrew-date (calendar-hebrew-from-absolute
179 (calendar-absolute-from-gregorian
180 (or date
(calendar-current-date)))))
181 (calendar-month-name-array
182 (if (hebrew-calendar-leap-year-p (extract-calendar-year hebrew-date
))
183 calendar-hebrew-month-name-array-leap-year
184 calendar-hebrew-month-name-array-common-year
)))
185 (calendar-date-string hebrew-date nil t
)))
187 (defun calendar-print-hebrew-date ()
188 "Show the Hebrew calendar equivalent of the date under the cursor."
190 (message "Hebrew date (until sunset): %s"
191 (calendar-hebrew-date-string (calendar-cursor-to-date t
))))
193 (defun hebrew-calendar-yahrzeit (death-date year
)
194 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
195 (let* ((death-day (extract-calendar-day death-date
))
196 (death-month (extract-calendar-month death-date
))
197 (death-year (extract-calendar-year death-date
)))
199 ;; If it's Heshvan 30 it depends on the first anniversary; if
200 ;; that was not Heshvan 30, use the day before Kislev 1.
201 ((and (= death-month
8)
203 (not (hebrew-calendar-long-heshvan-p (1+ death-year
))))
204 (1- (calendar-absolute-from-hebrew (list 9 1 year
))))
205 ;; If it's Kislev 30 it depends on the first anniversary; if
206 ;; that was not Kislev 30, use the day before Teveth 1.
207 ((and (= death-month
9)
209 (hebrew-calendar-short-kislev-p (1+ death-year
)))
210 (1- (calendar-absolute-from-hebrew (list 10 1 year
))))
211 ;; If it's Adar II, use the same day in last month of
212 ;; year (Adar or Adar II).
214 (calendar-absolute-from-hebrew
215 (list (hebrew-calendar-last-month-of-year year
) death-day year
)))
216 ;; If it's the 30th in Adar I and year is not a leap year
217 ;; (so Adar has only 29 days), use the last day in Shevat.
218 ((and (= death-day
30)
220 (not (hebrew-calendar-leap-year-p year
)))
221 (calendar-absolute-from-hebrew (list 11 30 year
)))
222 ;; In all other cases, use the normal anniversary of the date of death.
223 (t (calendar-absolute-from-hebrew
224 (list death-month death-day year
))))))
226 (defun calendar-goto-hebrew-date (date &optional noecho
)
227 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is t."
229 (let* ((today (calendar-current-date))
231 "Hebrew calendar year (>3760): "
232 '(lambda (x) (> x
3760))
234 (extract-calendar-year
235 (calendar-hebrew-from-absolute
236 (calendar-absolute-from-gregorian today
))))))
237 (month-array (if (hebrew-calendar-leap-year-p year
)
238 calendar-hebrew-month-name-array-leap-year
239 calendar-hebrew-month-name-array-common-year
))
240 (completion-ignore-case t
)
241 (month (cdr (assoc-string
243 "Hebrew calendar month name: "
244 (mapcar 'list
(append month-array nil
))
250 (calendar-make-alist month-array
)
253 (calendar-absolute-from-hebrew
255 (hebrew-calendar-last-day-of-month
259 (calendar-make-alist month-array
1) t
)))
260 (last (hebrew-calendar-last-day-of-month month year
))
261 (first (if (and (= year
3761) (= month
10))
264 (format "Hebrew calendar day (%d-%d): "
266 '(lambda (x) (and (<= first x
) (<= x last
))))))
267 (list (list month day year
))))
268 (calendar-goto-date (calendar-gregorian-from-absolute
269 (calendar-absolute-from-hebrew date
)))
270 (or noecho
(calendar-print-hebrew-date)))
272 (defun holiday-hebrew (month day string
)
273 "Holiday on MONTH, DAY (Hebrew) called STRING.
274 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
275 Gregorian date in the form of the list (((month day year) STRING)). Returns
276 nil if it is not visible in the current calendar window."
277 (if (memq displayed-month
;; This test is only to speed things up a bit;
278 (list ;; it works fine without the test too.
279 (if (< 11 month
) (- month
11) (+ month
1))
280 (if (< 10 month
) (- month
10) (+ month
2))
281 (if (< 9 month
) (- month
9) (+ month
3))
282 (if (< 8 month
) (- month
8) (+ month
4))
283 (if (< 7 month
) (- month
7) (+ month
5))))
284 (let ((m1 displayed-month
)
289 (increment-calendar-month m1 y1 -
1)
290 (increment-calendar-month m2 y2
1)
291 (let* ((start-date (calendar-absolute-from-gregorian
293 (end-date (calendar-absolute-from-gregorian
294 (list m2
(calendar-last-day-of-month m2 y2
) y2
)))
295 (hebrew-start (calendar-hebrew-from-absolute start-date
))
296 (hebrew-end (calendar-hebrew-from-absolute end-date
))
297 (hebrew-y1 (extract-calendar-year hebrew-start
))
298 (hebrew-y2 (extract-calendar-year hebrew-end
)))
299 (setq year
(if (< 6 month
) hebrew-y2 hebrew-y1
))
300 (let ((date (calendar-gregorian-from-absolute
301 (calendar-absolute-from-hebrew
302 (list month day year
)))))
303 (if (calendar-date-is-visible-p date
)
304 (list (list date string
))))))))
306 (defun holiday-rosh-hashanah-etc ()
307 "List of dates related to Rosh Hashanah, as visible in calendar window."
308 (if (or (< displayed-month
8)
309 (> displayed-month
11))
310 nil
;; None of the dates is visible
311 (let* ((abs-r-h (calendar-absolute-from-hebrew
312 (list 7 1 (+ displayed-year
3761))))
315 (list (calendar-gregorian-from-absolute abs-r-h
)
316 (format "Rosh HaShanah %d" (+ 3761 displayed-year
)))
317 (list (calendar-gregorian-from-absolute (+ abs-r-h
9))
319 (list (calendar-gregorian-from-absolute (+ abs-r-h
14))
321 (list (calendar-gregorian-from-absolute (+ abs-r-h
21))
323 (list (calendar-gregorian-from-absolute (+ abs-r-h
22))
327 (list (calendar-gregorian-from-absolute
328 (calendar-dayname-on-or-before 6 (- abs-r-h
4)))
330 (list (calendar-gregorian-from-absolute (1- abs-r-h
))
331 "Erev Rosh HaShanah")
332 (list (calendar-gregorian-from-absolute (1+ abs-r-h
))
333 "Rosh HaShanah (second day)")
334 (list (calendar-gregorian-from-absolute
335 (if (= (% abs-r-h
7) 4) (+ abs-r-h
3) (+ abs-r-h
2)))
337 (list (calendar-gregorian-from-absolute
338 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h
)))
340 (list (calendar-gregorian-from-absolute (+ abs-r-h
8))
342 (list (calendar-gregorian-from-absolute (+ abs-r-h
13))
344 (list (calendar-gregorian-from-absolute (+ abs-r-h
15))
345 "Sukkot (second day)")
346 (list (calendar-gregorian-from-absolute (+ abs-r-h
16))
347 "Hol Hamoed Sukkot (first day)")
348 (list (calendar-gregorian-from-absolute (+ abs-r-h
17))
349 "Hol Hamoed Sukkot (second day)")
350 (list (calendar-gregorian-from-absolute (+ abs-r-h
18))
351 "Hol Hamoed Sukkot (third day)")
352 (list (calendar-gregorian-from-absolute (+ abs-r-h
19))
353 "Hol Hamoed Sukkot (fourth day)")
354 (list (calendar-gregorian-from-absolute (+ abs-r-h
20))
357 (holiday-filter-visible-calendar mandatory
)))
358 (if all-hebrew-calendar-holidays
361 (holiday-filter-visible-calendar optional
)
365 (defun holiday-hanukkah ()
366 "List of dates related to Hanukkah, as visible in calendar window."
367 (if (memq displayed-month
;; This test is only to speed things up a bit;
368 '(10 11 12 1 2));; it works fine without the test too.
369 (let ((m displayed-month
)
371 (increment-calendar-month m y
1)
372 (let* ((h-y (extract-calendar-year
373 (calendar-hebrew-from-absolute
374 (calendar-absolute-from-gregorian
375 (list m
(calendar-last-day-of-month m y
) y
)))))
376 (abs-h (calendar-absolute-from-hebrew (list 9 25 h-y
))))
377 (holiday-filter-visible-calendar
379 (list (calendar-gregorian-from-absolute (1- abs-h
))
381 (list (calendar-gregorian-from-absolute abs-h
)
382 "Hanukkah (first day)")
383 (list (calendar-gregorian-from-absolute (1+ abs-h
))
384 "Hanukkah (second day)")
385 (list (calendar-gregorian-from-absolute (+ abs-h
2))
386 "Hanukkah (third day)")
387 (list (calendar-gregorian-from-absolute (+ abs-h
3))
388 "Hanukkah (fourth day)")
389 (list (calendar-gregorian-from-absolute (+ abs-h
4))
390 "Hanukkah (fifth day)")
391 (list (calendar-gregorian-from-absolute (+ abs-h
5))
392 "Hanukkah (sixth day)")
393 (list (calendar-gregorian-from-absolute (+ abs-h
6))
394 "Hanukkah (seventh day)")
395 (list (calendar-gregorian-from-absolute (+ abs-h
7))
396 "Hanukkah (eighth day)")))))))
398 (defun holiday-passover-etc ()
399 "List of dates related to Passover, as visible in calendar window."
400 (if (< 7 displayed-month
)
401 nil
;; None of the dates is visible
402 (let* ((abs-p (calendar-absolute-from-hebrew
403 (list 1 15 (+ displayed-year
3760))))
406 (list (calendar-gregorian-from-absolute abs-p
)
408 (list (calendar-gregorian-from-absolute (+ abs-p
50))
412 (list (calendar-gregorian-from-absolute
413 (calendar-dayname-on-or-before 6 (- abs-p
43)))
415 (list (calendar-gregorian-from-absolute
416 (calendar-dayname-on-or-before 6 (- abs-p
30)))
418 (list (calendar-gregorian-from-absolute
419 (if (= (% abs-p
7) 2) (- abs-p
33) (- abs-p
31)))
421 (list (calendar-gregorian-from-absolute (- abs-p
31))
423 (list (calendar-gregorian-from-absolute (- abs-p
30))
425 (list (calendar-gregorian-from-absolute
426 (if (zerop (% abs-p
7)) (- abs-p
28) (- abs-p
29)))
428 (list (calendar-gregorian-from-absolute
429 (- (calendar-dayname-on-or-before 6 (- abs-p
14)) 7))
431 (list (calendar-gregorian-from-absolute
432 (calendar-dayname-on-or-before 6 (- abs-p
14)))
434 (list (calendar-gregorian-from-absolute
435 (calendar-dayname-on-or-before 6 (1- abs-p
)))
437 (list (calendar-gregorian-from-absolute (1- abs-p
))
439 (list (calendar-gregorian-from-absolute (1+ abs-p
))
440 "Passover (second day)")
441 (list (calendar-gregorian-from-absolute (+ abs-p
2))
442 "Hol Hamoed Passover (first day)")
443 (list (calendar-gregorian-from-absolute (+ abs-p
3))
444 "Hol Hamoed Passover (second day)")
445 (list (calendar-gregorian-from-absolute (+ abs-p
4))
446 "Hol Hamoed Passover (third day)")
447 (list (calendar-gregorian-from-absolute (+ abs-p
5))
448 "Hol Hamoed Passover (fourth day)")
449 (list (calendar-gregorian-from-absolute (+ abs-p
6))
450 "Passover (seventh day)")
451 (list (calendar-gregorian-from-absolute (+ abs-p
7))
452 "Passover (eighth day)")
453 (list (calendar-gregorian-from-absolute
454 (if (zerop (%
(+ abs-p
12) 7))
458 (list (calendar-gregorian-from-absolute
459 (if (zerop (% abs-p
7))
461 (if (= (% abs-p
7) 6)
465 (list (calendar-gregorian-from-absolute (+ abs-p
33))
467 (list (calendar-gregorian-from-absolute (+ abs-p
43))
469 (list (calendar-gregorian-from-absolute (+ abs-p
49))
471 (list (calendar-gregorian-from-absolute (+ abs-p
51))
472 "Shavuot (second day)")))
474 (holiday-filter-visible-calendar mandatory
)))
475 (if all-hebrew-calendar-holidays
478 (holiday-filter-visible-calendar optional
)
482 (defun holiday-tisha-b-av-etc ()
483 "List of dates around Tisha B'Av, as visible in calendar window."
484 (if (or (< displayed-month
5)
485 (> displayed-month
9))
486 nil
;; None of the dates is visible
487 (let* ((abs-t-a (calendar-absolute-from-hebrew
488 (list 5 9 (+ displayed-year
3760)))))
490 (holiday-filter-visible-calendar
492 (list (calendar-gregorian-from-absolute
493 (if (= (% abs-t-a
7) 6) (- abs-t-a
20) (- abs-t-a
21)))
495 (list (calendar-gregorian-from-absolute
496 (calendar-dayname-on-or-before 6 abs-t-a
))
498 (list (calendar-gregorian-from-absolute
499 (if (= (% abs-t-a
7) 6) (1+ abs-t-a
) abs-t-a
))
501 (list (calendar-gregorian-from-absolute
502 (calendar-dayname-on-or-before 6 (+ abs-t-a
7)))
503 "Shabbat Nahamu"))))))
505 (defun list-hebrew-diary-entries ()
506 "Add any Hebrew date entries from the diary file to `diary-entries-list'.
507 Hebrew date diary entries must be prefaced by `hebrew-diary-entry-symbol'
508 \(normally an `H'). The same diary date forms govern the style of the Hebrew
509 calendar entries, except that the Hebrew month names must be spelled in full.
510 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
511 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
512 common Hebrew year. If a Hebrew date diary entry begins with a
513 `diary-nonmarking-symbol', the entry will appear in the diary listing, but will
514 not be marked in the calendar. This function is provided for use with the
515 `nongregorian-diary-listing-hook'."
517 (let ((buffer-read-only nil
)
518 (diary-modified (buffer-modified-p))
519 (gdate original-date
)
520 (mark (regexp-quote diary-nonmarking-symbol
)))
521 (dotimes (idummy number
)
522 (let* ((d diary-date-forms
)
523 (hdate (calendar-hebrew-from-absolute
524 (calendar-absolute-from-gregorian gdate
)))
525 (month (extract-calendar-month hdate
))
526 (day (extract-calendar-day hdate
))
527 (year (extract-calendar-year hdate
)))
530 ((date-form (if (equal (car (car d
)) 'backup
)
533 (backup (equal (car (car d
)) 'backup
))
535 (format "%s\\|%s\\.?"
536 (calendar-day-name gdate
)
537 (calendar-day-name gdate
'abbrev
)))
538 (calendar-month-name-array
539 calendar-hebrew-month-name-array-leap-year
)
543 (calendar-month-name month
)))
544 (month (concat "\\*\\|0*" (int-to-string month
)))
545 (day (concat "\\*\\|0*" (int-to-string day
)))
548 "\\*\\|0*" (int-to-string year
)
549 (if abbreviated-calendar-year
550 (concat "\\|" (int-to-string (% year
100)))
554 "\\(\\`\\|\^M\\|\n\\)" mark
"?"
555 (regexp-quote hebrew-diary-entry-symbol
)
557 (mapconcat 'eval date-form
"\\)\\(")
559 (case-fold-search t
))
560 (goto-char (point-min))
561 (while (re-search-forward regexp nil t
)
562 (if backup
(re-search-backward "\\<" nil t
))
563 (if (and (or (char-equal (preceding-char) ?\^M
)
564 (char-equal (preceding-char) ?
\n))
565 (not (looking-at " \\|\^I")))
566 ;; Diary entry that consists only of date.
568 ;; Found a nonempty diary entry--make it visible and
569 ;; add it to the list.
570 (let ((entry-start (point))
572 (re-search-backward "\^M\\|\n\\|\\`")
573 (setq date-start
(point))
574 (re-search-forward "\^M\\|\n" nil t
2)
575 (while (looking-at " \\|\^I")
576 (re-search-forward "\^M\\|\n" nil t
))
578 (subst-char-in-region date-start
(point) ?\^M ?
\n t
)
581 (buffer-substring-no-properties entry-start
(point))
582 (buffer-substring-no-properties
583 (1+ date-start
) (1- entry-start
))
584 (copy-marker entry-start
))))))
587 (calendar-gregorian-from-absolute
588 (1+ (calendar-absolute-from-gregorian gdate
)))))
589 (set-buffer-modified-p diary-modified
))
590 (goto-char (point-min))))
592 (defun mark-hebrew-calendar-date-pattern (month day year
)
593 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
594 A value of 0 in any position is a wildcard."
596 (set-buffer calendar-buffer
)
597 (if (and (/= 0 month
) (/= 0 day
))
599 ;; Fully specified Hebrew date.
600 (let ((date (calendar-gregorian-from-absolute
601 (calendar-absolute-from-hebrew
602 (list month day year
)))))
603 (if (calendar-date-is-visible-p date
)
604 (mark-visible-calendar-date date
)))
605 ;; Month and day in any year--this taken from the holiday stuff.
606 (if (memq displayed-month
;; This test is only to speed things up a
607 (list ;; bit; it works fine without the test too.
608 (if (< 11 month
) (- month
11) (+ month
1))
609 (if (< 10 month
) (- month
10) (+ month
2))
610 (if (< 9 month
) (- month
9) (+ month
3))
611 (if (< 8 month
) (- month
8) (+ month
4))
612 (if (< 7 month
) (- month
7) (+ month
5))))
613 (let ((m1 displayed-month
)
618 (increment-calendar-month m1 y1 -
1)
619 (increment-calendar-month m2 y2
1)
620 (let* ((start-date (calendar-absolute-from-gregorian
622 (end-date (calendar-absolute-from-gregorian
624 (calendar-last-day-of-month m2 y2
)
627 (calendar-hebrew-from-absolute start-date
))
628 (hebrew-end (calendar-hebrew-from-absolute end-date
))
629 (hebrew-y1 (extract-calendar-year hebrew-start
))
630 (hebrew-y2 (extract-calendar-year hebrew-end
)))
631 (setq year
(if (< 6 month
) hebrew-y2 hebrew-y1
))
632 (let ((date (calendar-gregorian-from-absolute
633 (calendar-absolute-from-hebrew
634 (list month day year
)))))
635 (if (calendar-date-is-visible-p date
)
636 (mark-visible-calendar-date date
)))))))
637 ;; Not one of the simple cases--check all visible dates for match.
638 ;; Actually, the following code takes care of ALL of the cases, but
639 ;; it's much too slow to be used for the simple (common) cases.
640 (let ((m displayed-month
)
644 (increment-calendar-month m y -
1)
646 (calendar-absolute-from-gregorian
648 (increment-calendar-month m y
2)
650 (calendar-absolute-from-gregorian
651 (list m
(calendar-last-day-of-month m y
) y
)))
652 (calendar-for-loop date from first-date to last-date do
653 (let* ((h-date (calendar-hebrew-from-absolute date
))
654 (h-month (extract-calendar-month h-date
))
655 (h-day (extract-calendar-day h-date
))
656 (h-year (extract-calendar-year h-date
)))
657 (and (or (zerop month
)
663 (mark-visible-calendar-date
664 (calendar-gregorian-from-absolute date
)))))))))
666 (defun mark-hebrew-diary-entries ()
667 "Mark days in the calendar window that have Hebrew date diary entries.
668 Each entry in diary-file (or included files) visible in the calendar window
669 is marked. Hebrew date entries are prefaced by a hebrew-diary-entry-symbol
670 \(normally an `H'). The same diary-date-forms govern the style of the Hebrew
671 calendar entries, except that the Hebrew month names must be spelled in full.
672 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being
673 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a
674 common Hebrew year. Hebrew date diary entries that begin with a
675 diary-nonmarking symbol will not be marked in the calendar. This function
676 is provided for use as part of the nongregorian-diary-marking-hook."
677 (let ((d diary-date-forms
))
680 ((date-form (if (equal (car (car d
)) 'backup
)
682 (car d
)));; ignore 'backup directive
683 (dayname (diary-name-pattern calendar-day-name-array
684 calendar-day-abbrev-array
))
688 calendar-hebrew-month-name-array-leap-year
)))
689 (month "[0-9]+\\|\\*")
691 (year "[0-9]+\\|\\*")
692 (l (length date-form
))
693 (d-name-pos (- l
(length (memq 'dayname date-form
))))
694 (d-name-pos (if (/= l d-name-pos
) (+ 2 d-name-pos
)))
695 (m-name-pos (- l
(length (memq 'monthname date-form
))))
696 (m-name-pos (if (/= l m-name-pos
) (+ 2 m-name-pos
)))
697 (d-pos (- l
(length (memq 'day date-form
))))
698 (d-pos (if (/= l d-pos
) (+ 2 d-pos
)))
699 (m-pos (- l
(length (memq 'month date-form
))))
700 (m-pos (if (/= l m-pos
) (+ 2 m-pos
)))
701 (y-pos (- l
(length (memq 'year date-form
))))
702 (y-pos (if (/= l y-pos
) (+ 2 y-pos
)))
705 "\\(\\`\\|\^M\\|\n\\)"
706 (regexp-quote hebrew-diary-entry-symbol
)
708 (mapconcat 'eval date-form
"\\)\\(")
710 (case-fold-search t
))
711 (goto-char (point-min))
712 (while (re-search-forward regexp nil t
)
716 (match-beginning d-name-pos
)
717 (match-end d-name-pos
))))
721 (match-beginning m-name-pos
)
722 (match-end m-name-pos
))))
723 (mm (string-to-number
726 (match-beginning m-pos
)
729 (dd (string-to-number
732 (match-beginning d-pos
)
737 (match-beginning y-pos
)
741 (if (and (= (length y-str
) 2)
742 abbreviated-calendar-year
)
744 (extract-calendar-year
745 (calendar-hebrew-from-absolute
746 (calendar-absolute-from-gregorian
747 (calendar-current-date)))))
748 (y (+ (string-to-number y-str
)
749 (* 100 (/ current-y
100)))))
750 (if (> (- y current-y
) 50)
752 (if (> (- current-y y
) 50)
755 (string-to-number y-str
)))))
757 (mark-calendar-days-named
758 (cdr (assoc-string dd-name
760 calendar-day-name-array
761 0 nil calendar-day-abbrev-array
) t
)))
764 (if (string-equal mm-name
"*") 0
769 calendar-hebrew-month-name-array-leap-year
) t
)))))
770 (mark-hebrew-calendar-date-pattern mm dd yy
)))))
773 (defun insert-hebrew-diary-entry (arg)
774 "Insert a diary entry.
775 For the Hebrew date corresponding to the date indicated by point.
776 Prefix arg will make the entry nonmarking."
778 (let* ((calendar-month-name-array
779 calendar-hebrew-month-name-array-leap-year
))
782 hebrew-diary-entry-symbol
783 (calendar-date-string
784 (calendar-hebrew-from-absolute
785 (calendar-absolute-from-gregorian
786 (calendar-cursor-to-date t
)))
790 (defun insert-monthly-hebrew-diary-entry (arg)
791 "Insert a monthly diary entry.
792 For the day of the Hebrew month corresponding to the date indicated by point.
793 Prefix arg will make the entry nonmarking."
795 (let* ((calendar-date-display-form
796 (if european-calendar-style
'(day " * ") '("* " day
)))
797 (calendar-month-name-array
798 calendar-hebrew-month-name-array-leap-year
))
801 hebrew-diary-entry-symbol
802 (calendar-date-string
803 (calendar-hebrew-from-absolute
804 (calendar-absolute-from-gregorian
805 (calendar-cursor-to-date t
)))))
808 (defun insert-yearly-hebrew-diary-entry (arg)
809 "Insert an annual diary entry.
810 For the day of the Hebrew year corresponding to the date indicated by point.
811 Prefix arg will make the entry nonmarking."
813 (let* ((calendar-date-display-form
814 (if european-calendar-style
816 '(monthname " " day
)))
817 (calendar-month-name-array
818 calendar-hebrew-month-name-array-leap-year
))
821 hebrew-diary-entry-symbol
822 (calendar-date-string
823 (calendar-hebrew-from-absolute
824 (calendar-absolute-from-gregorian
825 (calendar-cursor-to-date t
)))))
829 (defun list-yahrzeit-dates (death-date start-year end-year
)
830 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
831 When called interactively from the calendar window, the date of death is taken
832 from the cursor position."
835 (if (equal (current-buffer) (get-buffer calendar-buffer
))
836 (calendar-cursor-to-date)
837 (let* ((today (calendar-current-date))
839 "Year of death (>0): "
840 '(lambda (x) (> x
0))
841 (int-to-string (extract-calendar-year today
))))
842 (month-array calendar-month-name-array
)
843 (completion-ignore-case t
)
844 (month (cdr (assoc-string
846 "Month of death (name): "
847 (mapcar 'list
(append month-array nil
))
849 (calendar-make-alist month-array
1) t
)))
850 (last (calendar-last-day-of-month month year
))
852 (format "Day of death (1-%d): " last
)
853 '(lambda (x) (and (< 0 x
) (<= x last
))))))
854 (list month day year
))))
855 (death-year (extract-calendar-year death-date
))
856 (start-year (calendar-read
857 (format "Starting year of Yahrzeit table (>%d): "
859 '(lambda (x) (> x death-year
))
860 (int-to-string (1+ death-year
))))
861 (end-year (calendar-read
862 (format "Ending year of Yahrzeit table (>=%d): "
864 '(lambda (x) (>= x start-year
)))))
865 (list death-date start-year end-year
)))
866 (message "Computing yahrzeits...")
867 (let* ((yahrzeit-buffer "*Yahrzeits*")
868 (h-date (calendar-hebrew-from-absolute
869 (calendar-absolute-from-gregorian death-date
)))
870 (h-month (extract-calendar-month h-date
))
871 (h-day (extract-calendar-day h-date
))
872 (h-year (extract-calendar-year h-date
)))
873 (set-buffer (get-buffer-create yahrzeit-buffer
))
874 (setq buffer-read-only nil
)
875 (calendar-set-mode-line
876 (format "Yahrzeit dates for %s = %s"
877 (calendar-date-string death-date
)
878 (let ((calendar-month-name-array
879 (if (hebrew-calendar-leap-year-p h-year
)
880 calendar-hebrew-month-name-array-leap-year
881 calendar-hebrew-month-name-array-common-year
)))
882 (calendar-date-string h-date nil t
))))
884 (goto-char (point-min))
885 (calendar-for-loop i from start-year to end-year do
887 (calendar-date-string
888 (calendar-gregorian-from-absolute
889 (hebrew-calendar-yahrzeit
891 (extract-calendar-year
892 (calendar-hebrew-from-absolute
893 (calendar-absolute-from-gregorian (list 1 1 i
))))))) "\n"))
894 (goto-char (point-min))
895 (set-buffer-modified-p nil
)
896 (setq buffer-read-only t
)
897 (display-buffer yahrzeit-buffer
)
898 (message "Computing yahrzeits...done")))
900 (defun diary-hebrew-date ()
901 "Hebrew calendar equivalent of date diary entry."
902 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date
)))
904 (defun diary-omer (&optional mark
)
905 "Omer count diary entry.
906 Entry applies if date is within 50 days after Passover.
908 An optional parameter MARK specifies a face or single-character string to
909 use when highlighting the day in the calendar."
911 (calendar-absolute-from-hebrew
912 (list 1 15 (+ (extract-calendar-year date
) 3760))))
913 (omer (- (calendar-absolute-from-gregorian date
) passover
))
916 (if (and (> omer
0) (< omer
50))
918 (format "Day %d%s of the omer (until sunset)"
922 (format ", that is, %d week%s%s"
924 (if (= week
1) "" "s")
927 (format " and %d day%s"
928 day
(if (= day
1) "" "s"))))))))))
930 (defun diary-yahrzeit (death-month death-day death-year
&optional mark
)
931 "Yahrzeit diary entry--entry applies if date is yahrzeit or the day before.
932 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed
933 to be the name of the person. Date of death is on the *civil* calendar;
934 although the date of death is specified by the civil calendar, the proper
935 Hebrew calendar yahrzeit is determined. If `european-calendar-style' is t, the
936 order of the parameters is changed to DEATH-DAY, DEATH-MONTH, DEATH-YEAR.
938 An optional parameter MARK specifies a face or single-character string to
939 use when highlighting the day in the calendar."
940 (let* ((h-date (calendar-hebrew-from-absolute
941 (calendar-absolute-from-gregorian
942 (if european-calendar-style
943 (list death-day death-month death-year
)
944 (list death-month death-day death-year
)))))
945 (h-month (extract-calendar-month h-date
))
946 (h-day (extract-calendar-day h-date
))
947 (h-year (extract-calendar-year h-date
))
948 (d (calendar-absolute-from-gregorian date
))
949 (yr (extract-calendar-year (calendar-hebrew-from-absolute d
)))
951 (y (hebrew-calendar-yahrzeit h-date yr
)))
952 (if (and (> diff
0) (or (= y d
) (= y
(1+ d
))))
954 (format "Yahrzeit of %s%s: %d%s anniversary"
956 (if (= y d
) "" " (evening)")
958 (cond ((= (% diff
10) 1) "st")
959 ((= (% diff
10) 2) "nd")
960 ((= (% diff
10) 3) "rd")
963 (defun diary-rosh-hodesh (&optional mark
)
964 "Rosh Hodesh diary entry.
965 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before.
967 An optional parameter MARK specifies a face or single-character string to
968 use when highlighting the day in the calendar."
969 (let* ((d (calendar-absolute-from-gregorian date
))
970 (h-date (calendar-hebrew-from-absolute d
))
971 (h-month (extract-calendar-month h-date
))
972 (h-day (extract-calendar-day h-date
))
973 (h-year (extract-calendar-year h-date
))
974 (leap-year (hebrew-calendar-leap-year-p h-year
))
975 (last-day (hebrew-calendar-last-day-of-month h-month h-year
))
978 calendar-hebrew-month-name-array-leap-year
979 calendar-hebrew-month-name-array-common-year
))
980 (this-month (aref h-month-names
(1- h-month
)))
981 (h-yesterday (extract-calendar-day
982 (calendar-hebrew-from-absolute (1- d
)))))
983 (if (or (= h-day
30) (and (= h-day
1) (/= h-month
7)))
990 ;; next month must be in the same year since this
991 ;; month can't be the last month of the year since
993 (aref h-month-names h-month
))
994 (if (= h-yesterday
30)
995 (format "%s (second day)" this-month
)
997 (if (= (% d
7) 6) ;; Saturday--check for Shabbat Mevarchim
999 (cond ((and (> h-day
22) (/= h-month
6) (= 29 last-day
))
1000 (format "Mevarchim Rosh Hodesh %s (%s)"
1003 (hebrew-calendar-last-month-of-year
1006 (aref calendar-day-name-array
(- 29 h-day
))))
1007 ((and (< h-day
30) (> h-day
22) (= 30 last-day
))
1008 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
1009 (aref h-month-names h-month
)
1012 (aref calendar-day-name-array
(- 29 h-day
)))
1013 (aref calendar-day-name-array
1014 (%
(- 30 h-day
) 7))))))
1015 (if (and (= h-day
29) (/= h-month
6))
1017 (format "Erev Rosh Hodesh %s"
1020 (hebrew-calendar-last-month-of-year
1024 (defvar hebrew-calendar-parashiot-names
1025 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
1026 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
1027 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
1028 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
1029 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
1030 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
1031 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
1032 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
1033 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
1034 "The names of the parashiot in the Torah.")
1036 (defun hebrew-calendar-parasha-name (p)
1037 "Name(s) corresponding to parasha P."
1038 (if (arrayp p
);; combined parasha
1040 (aref hebrew-calendar-parashiot-names
(aref p
0))
1041 (aref hebrew-calendar-parashiot-names
(aref p
1)))
1042 (aref hebrew-calendar-parashiot-names p
)))
1044 (defun diary-parasha (&optional mark
)
1045 "Parasha diary entry--entry applies if date is a Saturday.
1047 An optional parameter MARK specifies a face or single-character string to
1048 use when highlighting the day in the calendar."
1049 (let ((d (calendar-absolute-from-gregorian date
)))
1050 (if (= (% d
7) 6) ;; Saturday
1052 ((h-year (extract-calendar-year
1053 (calendar-hebrew-from-absolute d
)))
1055 (calendar-absolute-from-hebrew (list 7 1 h-year
)))
1057 (calendar-absolute-from-hebrew (list 1 15 h-year
)))
1059 (aref calendar-day-name-array
(% rosh-hashanah
7)))
1061 (aref calendar-day-name-array
(% passover
7)))
1062 (long-h (hebrew-calendar-long-heshvan-p h-year
))
1063 (short-k (hebrew-calendar-short-kislev-p h-year
))
1064 (type (cond ((and long-h
(not short-k
)) "complete")
1065 ((and (not long-h
) short-k
) "incomplete")
1069 (intern (format "hebrew-calendar-year-%s-%s-%s" ;; keviah
1070 rosh-hashanah-day type passover-day
))))
1071 (first-saturday ;; of Hebrew year
1072 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah
)))
1073 (saturday ;; which Saturday of the Hebrew year
1074 (/ (- d first-saturday
) 7))
1075 (parasha (aref year-format saturday
)))
1080 (if (listp parasha
) ;; Israel differs from diaspora
1082 (format "%s (diaspora), %s (Israel)"
1083 (hebrew-calendar-parasha-name (car parasha
))
1084 (hebrew-calendar-parasha-name (cdr parasha
)))
1085 (format "%s (Israel)"
1086 (hebrew-calendar-parasha-name (cdr parasha
))))
1087 (hebrew-calendar-parasha-name parasha
)))))))))
1089 ;; The seven ordinary year types (keviot)
1091 (defconst hebrew-calendar-year-Saturday-incomplete-Sunday
1092 [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]
1093 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1094 43 44 45 46 47 48 49 50]
1095 "The structure of the parashiot.
1096 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
1097 29 days), and has Passover start on Sunday.")
1099 (defconst hebrew-calendar-year-Saturday-complete-Tuesday
1100 [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]
1101 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1102 43 44 45 46 47 48 49 [50 51]]
1103 "The structure of the parashiot.
1104 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1105 have 30 days), and has Passover start on Tuesday.")
1107 (defconst hebrew-calendar-year-Monday-incomplete-Tuesday
1108 [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]
1109 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1110 43 44 45 46 47 48 49 [50 51]]
1111 "The structure of the parashiot.
1112 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1113 have 29 days), and has Passover start on Tuesday.")
1115 (defconst hebrew-calendar-year-Monday-complete-Thursday
1116 [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]
1117 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
1118 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1119 "The structure of the parashiot.
1120 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1121 30 days), and has Passover start on Thursday.")
1123 (defconst hebrew-calendar-year-Tuesday-regular-Thursday
1124 [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]
1125 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
1126 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1127 "The structure of the parashiot.
1128 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1129 Kislev has 30 days), and has Passover start on Thursday.")
1131 (defconst hebrew-calendar-year-Thursday-regular-Saturday
1132 [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
1133 24 nil
(nil .
25) (25 .
[26 27]) ([26 27] .
[28 29]) ([28 29] .
30)
1134 (30 .
31) ([31 32] .
32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
1136 "The structure of the parashiot.
1137 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
1138 Kislev has 30 days), and has Passover start on Saturday.")
1140 (defconst hebrew-calendar-year-Thursday-complete-Sunday
1141 [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
1142 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1143 43 44 45 46 47 48 49 50]
1144 "The structure of the parashiot.
1145 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
1146 have 30 days), and has Passover start on Sunday.")
1148 ;; The seven leap year types (keviot)
1150 (defconst hebrew-calendar-year-Saturday-incomplete-Tuesday
1151 [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
1152 23 24 25 26 27 nil
28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
1153 43 44 45 46 47 48 49 [50 51]]
1154 "The structure of the parashiot.
1155 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
1156 have 29 days), and has Passover start on Tuesday.")
1158 (defconst hebrew-calendar-year-Saturday-complete-Thursday
1159 [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
1160 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1161 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1162 "The structure of the parashiot.
1163 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1164 have 30 days), and has Passover start on Thursday.")
1166 (defconst hebrew-calendar-year-Monday-incomplete-Thursday
1167 [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
1168 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1169 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1170 "The structure of the parashiot.
1171 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1172 have 29 days), and has Passover start on Thursday.")
1174 (defconst hebrew-calendar-year-Monday-complete-Saturday
1175 [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
1176 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1177 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1178 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1179 "The structure of the parashiot.
1180 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1181 30 days), and has Passover start on Saturday.")
1183 (defconst hebrew-calendar-year-Tuesday-regular-Saturday
1184 [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
1185 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1186 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1187 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1188 "The structure of the parashiot.
1189 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1190 Kislev has 30 days), and has Passover start on Saturday.")
1192 (defconst hebrew-calendar-year-Thursday-incomplete-Sunday
1193 [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
1194 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1195 43 44 45 46 47 48 49 50]
1196 "The structure of the parashiot.
1197 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
1198 have 29 days), and has Passover start on Sunday.")
1200 (defconst hebrew-calendar-year-Thursday-complete-Tuesday
1201 [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
1202 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1203 43 44 45 46 47 48 49 [50 51]]
1204 "The structure of the parashiot.
1205 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
1206 have 30 days), and has Passover start on Tuesday.")
1208 (provide 'cal-hebrew
)
1210 ;;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c
1211 ;;; cal-hebrew.el ends here