1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008 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.
37 (define-obsolete-variable-alias 'diary-sabbath-candles-minutes
38 'diary-hebrew-sabbath-candles-minutes
"23.1")
40 (defcustom diary-hebrew-sabbath-candles-minutes
18
41 "Number of minutes before sunset for sabbath candle lighting.
42 Used by `diary-hebrew-sabbath-candles'."
47 ;; End of user options.
49 (defun calendar-hebrew-leap-year-p (year)
50 "Non-nil if YEAR is a Hebrew calendar leap year."
51 (< (%
(1+ (* 7 year
)) 19) 7))
53 (defun calendar-hebrew-last-month-of-year (year)
54 "The last month of the Hebrew calendar YEAR."
55 (if (calendar-hebrew-leap-year-p year
)
59 (defun calendar-hebrew-elapsed-days (year)
60 "Days to mean conjunction of Tishri of Hebrew YEAR.
61 Measured from Sunday before start of Hebrew calendar."
62 (let* ((months-elapsed
63 (+ (* 235 (/ (1- year
) 19)) ; months in complete cycles so far
64 (* 12 (%
(1- year
) 19)) ; regular months in this cycle
65 (/ (1+ (* 7 (%
(1- year
) 19))) 19))) ; leap months this cycle
66 (parts-elapsed (+ 204 (* 793 (% months-elapsed
1080))))
69 (* 793 (/ months-elapsed
1080))
70 (/ parts-elapsed
1080)))
71 (parts ; conjunction parts
72 (+ (* 1080 (% hours-elapsed
24)) (% parts-elapsed
1080)))
73 (day ; conjunction day
74 (+ 1 (* 29 months-elapsed
) (/ hours-elapsed
24)))
76 (if (or (>= parts
19440) ; if the new moon is at or after midday
77 (and (= (% day
7) 2) ; ...or is on a Tuesday...
78 (>= parts
9924) ; at 9 hours, 204 parts or later...
79 ;; of a common year...
80 (not (calendar-hebrew-leap-year-p year
)))
81 (and (= (% day
7) 1) ; ...or is on a Monday...
82 (>= parts
16789) ; at 15 hours, 589 parts or later...
83 ;; at the end of a leap year.
84 (calendar-hebrew-leap-year-p (1- year
))))
85 ;; Then postpone Rosh HaShanah one day.
89 ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
90 (if (memq (% alternative-day
7) (list 0 3 5))
91 ;; Then postpone it one (more) day and return.
96 (defun calendar-hebrew-days-in-year (year)
97 "Number of days in Hebrew YEAR."
98 (- (calendar-hebrew-elapsed-days (1+ year
))
99 (calendar-hebrew-elapsed-days year
)))
101 (defun calendar-hebrew-long-heshvan-p (year)
102 "Non-nil if Heshvan is long in Hebrew YEAR."
103 (= (%
(calendar-hebrew-days-in-year year
) 10) 5))
105 (defun calendar-hebrew-short-kislev-p (year)
106 "Non-nil if Kislev is short in Hebrew YEAR."
107 (= (%
(calendar-hebrew-days-in-year year
) 10) 3))
109 (defun calendar-hebrew-last-day-of-month (month year
)
110 "The last day of MONTH in YEAR."
111 (if (or (memq month
(list 2 4 6 10 13))
112 (and (= month
12) (not (calendar-hebrew-leap-year-p year
)))
113 (and (= month
8) (not (calendar-hebrew-long-heshvan-p year
)))
114 (and (= month
9) (calendar-hebrew-short-kislev-p year
)))
118 (defun calendar-hebrew-to-absolute (date)
119 "Absolute date of Hebrew DATE.
120 The absolute date is the number of days elapsed since the (imaginary)
121 Gregorian date Sunday, December 31, 1 BC."
122 (let ((month (calendar-extract-month date
))
123 (day (calendar-extract-day date
))
124 (year (calendar-extract-year date
)))
125 (+ day
; days so far this month
126 (if (< month
7) ; before Tishri
127 ;; Then add days in prior months this year before and after Nisan.
129 m
7 (<= m
(calendar-hebrew-last-month-of-year year
))
130 (calendar-hebrew-last-day-of-month m year
))
133 (calendar-hebrew-last-day-of-month m year
)))
134 ;; Else add days in prior months this year.
137 (calendar-hebrew-last-day-of-month m year
)))
138 (calendar-hebrew-elapsed-days year
) ; days in prior years
139 -
1373429))) ; days elapsed before absolute date 1
141 (define-obsolete-function-alias 'calendar-absolute-from-hebrew
142 'calendar-hebrew-to-absolute
"23.1")
144 (defun calendar-hebrew-from-absolute (date)
145 "Compute the Hebrew date (month day year) corresponding to absolute DATE.
146 The absolute date is the number of days elapsed since the (imaginary)
147 Gregorian date Sunday, December 31, 1 BC."
148 (let* ((greg-date (calendar-gregorian-from-absolute date
))
149 (year (+ 3760 (calendar-extract-year greg-date
)))
150 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
151 (1- (calendar-extract-month greg-date
))))
153 (while (>= date
(calendar-hebrew-to-absolute
154 (list 7 1 (1+ year
))))
155 (setq year
(1+ year
)))
156 (calendar-hebrew-last-month-of-year year
)))
159 (calendar-hebrew-to-absolute
161 (calendar-hebrew-last-day-of-month month year
)
163 (setq month
(1+ (% month length
))))
165 (- date
(calendar-hebrew-to-absolute (list month
1 year
)))))
166 (list month day year
)))
168 (defconst calendar-hebrew-month-name-array-common-year
169 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
170 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]
171 "Array of strings giving the names of the Hebrew months in a common year.")
173 (defconst calendar-hebrew-month-name-array-leap-year
174 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
175 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]
176 "Array of strings giving the names of the Hebrew months in a leap year.")
179 (defun calendar-hebrew-date-string (&optional date
)
180 "String of Hebrew date before sunset of Gregorian DATE.
181 Defaults to today's date if DATE is not given.
182 Driven by the variable `calendar-date-display-form'."
183 (let* ((hebrew-date (calendar-hebrew-from-absolute
184 (calendar-absolute-from-gregorian
185 (or date
(calendar-current-date)))))
186 (calendar-month-name-array
187 (if (calendar-hebrew-leap-year-p (calendar-extract-year hebrew-date
))
188 calendar-hebrew-month-name-array-leap-year
189 calendar-hebrew-month-name-array-common-year
)))
190 (calendar-date-string hebrew-date nil t
)))
193 (defun calendar-hebrew-print-date ()
194 "Show the Hebrew calendar equivalent of the date under the cursor."
196 (message "Hebrew date (until sunset): %s"
197 (calendar-hebrew-date-string (calendar-cursor-to-date t
))))
199 (define-obsolete-function-alias 'calendar-print-hebrew-date
200 'calendar-hebrew-print-date
"23.1")
202 (defun calendar-hebrew-yahrzeit (death-date year
)
203 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
204 (let ((death-day (calendar-extract-day death-date
))
205 (death-month (calendar-extract-month death-date
))
206 (death-year (calendar-extract-year death-date
)))
208 ;; If it's Heshvan 30 it depends on the first anniversary; if
209 ;; that was not Heshvan 30, use the day before Kislev 1.
210 ((and (= death-month
8)
212 (not (calendar-hebrew-long-heshvan-p (1+ death-year
))))
213 (1- (calendar-hebrew-to-absolute (list 9 1 year
))))
214 ;; If it's Kislev 30 it depends on the first anniversary; if that
215 ;; was not Kislev 30, use the day before Teveth 1.
216 ((and (= death-month
9)
218 (calendar-hebrew-short-kislev-p (1+ death-year
)))
219 (1- (calendar-hebrew-to-absolute (list 10 1 year
))))
220 ;; If it's Adar II, use the same day in last month of year (Adar
223 (calendar-hebrew-to-absolute
224 (list (calendar-hebrew-last-month-of-year year
) death-day year
)))
225 ;; If it's the 30th in Adar I and year is not a leap year (so
226 ;; Adar has only 29 days), use the last day in Shevat.
227 ((and (= death-day
30)
229 (not (calendar-hebrew-leap-year-p year
)))
230 (calendar-hebrew-to-absolute (list 11 30 year
)))
231 ;; In all other cases, use the normal anniversary of the date of death.
232 (t (calendar-hebrew-to-absolute
233 (list death-month death-day year
))))))
235 (define-obsolete-function-alias 'hebrew-calendar-yahrzeit
236 'calendar-hebrew-yahrzeit
"23.1")
238 (defun calendar-hebrew-read-date ()
239 "Interactively read the arguments for a Hebrew date command.
240 Reads a year, month, and day."
241 (let* ((today (calendar-current-date))
243 "Hebrew calendar year (>3760): "
244 (lambda (x) (> x
3760))
246 (calendar-extract-year
247 (calendar-hebrew-from-absolute
248 (calendar-absolute-from-gregorian today
))))))
249 (month-array (if (calendar-hebrew-leap-year-p year
)
250 calendar-hebrew-month-name-array-leap-year
251 calendar-hebrew-month-name-array-common-year
))
252 (completion-ignore-case t
)
253 (month (cdr (assoc-string
255 "Hebrew calendar month name: "
256 (mapcar 'list
(append month-array nil
))
262 (calendar-make-alist month-array
)
265 (calendar-hebrew-to-absolute
267 (calendar-hebrew-last-day-of-month
271 (calendar-make-alist month-array
1) t
)))
272 (last (calendar-hebrew-last-day-of-month month year
))
273 (first (if (and (= year
3761) (= month
10))
276 (format "Hebrew calendar day (%d-%d): "
278 (lambda (x) (and (<= first x
) (<= x last
))))))
279 (list (list month day year
))))
282 (defun calendar-hebrew-goto-date (date &optional noecho
)
283 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is non-nil."
284 (interactive (calendar-hebrew-read-date))
285 (calendar-goto-date (calendar-gregorian-from-absolute
286 (calendar-hebrew-to-absolute date
)))
287 (or noecho
(calendar-hebrew-print-date)))
289 (define-obsolete-function-alias 'calendar-goto-hebrew-date
290 'calendar-hebrew-goto-date
"23.1")
292 (defvar displayed-month
) ; from calendar-generate
294 (defun calendar-hebrew-date-is-visible-p (month day
)
295 "Return non-nil if Hebrew MONTH DAY is visible in the calendar window.
296 Returns the corresponding Gregorian date."
297 ;; This test is only to speed things up a bit; it works fine without it.
298 (if (memq displayed-month
299 ;; What this is doing is equivalent to +1,2,3,4,5 modulo 12, ie:
300 ;; (mapcar (lambda (n) (let ((x (mod n 12)))
303 ;; (number-sequence (1+ month) (+ 5 month)))
304 ;; Ie it makes a list:
305 ;; 2 3 4 5 6 when month = 1
306 ;; 3 4 5 6 7 when month = 2
308 ;; 8 9 10 11 12 when month = 7
309 ;; 9 10 11 12 1 when month = 8
311 ;; 12 1 2 3 4 when month = 11
312 ;; 1 2 3 4 5 when month = 12
313 ;; This implies that hebrew month N cannot occur outside
314 ;; Gregorian months N:N+6 (the calendar shows
315 ;; displayed-month +/- 1 at any time).
316 ;; So to put it another way:
317 ;; (calendar-interval month 1 displayed-month
318 ;; (if (> month displayed-month) 2 1))
319 ;; must be >= 1 and <= 5. This could be expanded to:
320 ;; (if (> month displayed-month) (+ 12 (- displayed-month month))
321 ;; (- displayed-month month)
323 (if (< 11 month
) (- month
11) (+ month
1))
324 (if (< 10 month
) (- month
10) (+ month
2))
325 (if (< 9 month
) (- month
9) (+ month
3))
326 (if (< 8 month
) (- month
8) (+ month
4))
327 (if (< 7 month
) (- month
7) (+ month
5))))
328 (calendar-nongregorian-visible-p
329 month day
'calendar-hebrew-to-absolute
330 'calendar-hebrew-from-absolute
331 ;; Hebrew new year is start of month 7.
332 ;; If hmonth >= 7, choose the higher year.
333 (lambda (m) (> m
6)))))
335 ;;;###holiday-autoload
336 (defun holiday-hebrew (month day string
)
337 "Holiday on MONTH, DAY (Hebrew) called STRING.
338 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
339 Gregorian date in the form of the list (((month day year) STRING)). Returns
340 nil if it is not visible in the current calendar window."
341 (let ((gdate (calendar-hebrew-date-is-visible-p month day
)))
342 (if gdate
(list (list gdate string
)))))
344 ;; h-r-h-e should be called from holidays code.
345 (declare-function holiday-filter-visible-calendar
"holidays" (l))
347 (defvar displayed-year
)
349 ;;;###holiday-autoload
350 (defun holiday-hebrew-rosh-hashanah (&optional all
)
351 "List of dates related to Rosh Hashanah, as visible in calendar window.
352 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
354 (when (memq displayed-month
'(8 9 10 11))
355 (let ((abs-r-h (calendar-hebrew-to-absolute
356 (list 7 1 (+ displayed-year
3761)))))
357 (holiday-filter-visible-calendar
360 (list (calendar-gregorian-from-absolute abs-r-h
)
361 (format "Rosh HaShanah %d" (+ 3761 displayed-year
)))
362 (list (calendar-gregorian-from-absolute (+ abs-r-h
9))
364 (list (calendar-gregorian-from-absolute (+ abs-r-h
14))
366 (list (calendar-gregorian-from-absolute (+ abs-r-h
21))
368 (list (calendar-gregorian-from-absolute (+ abs-r-h
22))
370 (when (or all calendar-hebrew-all-holidays-flag
)
372 (list (calendar-gregorian-from-absolute
373 (calendar-dayname-on-or-before 6 (- abs-r-h
4)))
375 (list (calendar-gregorian-from-absolute (1- abs-r-h
))
376 "Erev Rosh HaShanah")
377 (list (calendar-gregorian-from-absolute (1+ abs-r-h
))
378 "Rosh HaShanah (second day)")
379 (list (calendar-gregorian-from-absolute
380 (if (= (% abs-r-h
7) 4) (+ abs-r-h
3) (+ abs-r-h
2)))
382 (list (calendar-gregorian-from-absolute
383 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h
)))
385 (list (calendar-gregorian-from-absolute (+ abs-r-h
8))
387 (list (calendar-gregorian-from-absolute (+ abs-r-h
13))
389 (list (calendar-gregorian-from-absolute (+ abs-r-h
15))
390 "Sukkot (second day)")
391 (list (calendar-gregorian-from-absolute (+ abs-r-h
16))
392 "Hol Hamoed Sukkot (first day)")
393 (list (calendar-gregorian-from-absolute (+ abs-r-h
17))
394 "Hol Hamoed Sukkot (second day)")
395 (list (calendar-gregorian-from-absolute (+ abs-r-h
18))
396 "Hol Hamoed Sukkot (third day)")
397 (list (calendar-gregorian-from-absolute (+ abs-r-h
19))
398 "Hol Hamoed Sukkot (fourth day)")
399 (list (calendar-gregorian-from-absolute (+ abs-r-h
20))
400 "Hoshanah Rabbah"))))))))
402 ;;;###holiday-autoload
403 (define-obsolete-function-alias 'holiday-rosh-hashanah-etc
404 'holiday-hebrew-rosh-hashanah
"23.1")
406 ;;;###holiday-autoload
407 (defun holiday-hebrew-hanukkah (&optional all
)
408 "List of dates related to Hanukkah, as visible in calendar window.
409 Shows only Hanukkah, unless `calendar-hebrew-all-holidays-flag' or ALL
411 ;; This test is only to speed things up a bit, it works fine without it.
412 (when (memq displayed-month
'(10 11 12 1 2))
413 (let* ((m displayed-month
)
416 (calendar-increment-month m y
1)
417 (calendar-extract-year
418 (calendar-hebrew-from-absolute
419 (calendar-absolute-from-gregorian
420 (list m
(calendar-last-day-of-month m y
) y
))))))
421 (abs-h (calendar-hebrew-to-absolute (list 9 25 h-y
)))
422 (ord ["first" "second" "third" "fourth" "fifth" "sixth"
425 (holiday-filter-visible-calendar
426 (if (or all calendar-hebrew-all-holidays-flag
)
429 (list (calendar-gregorian-from-absolute (1- abs-h
))
431 (dotimes (i 8 (nreverse han
))
433 (calendar-gregorian-from-absolute (+ abs-h i
))
434 (format "Hanukkah (%s day)" (aref ord i
)))
436 (list (list (calendar-gregorian-from-absolute abs-h
) "Hanukkah")))))))
438 ;;;###holiday-autoload
439 (define-obsolete-function-alias 'holiday-hanukkah
440 'holiday-hebrew-hanukkah
"23.1")
442 ;;;###holiday-autoload
443 (defun holiday-hebrew-passover (&optional all
)
444 "List of dates related to Passover, as visible in calendar window.
445 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
447 (when (< displayed-month
8)
448 (let ((abs-p (calendar-hebrew-to-absolute
449 (list 1 15 (+ displayed-year
3760)))))
450 (holiday-filter-visible-calendar
451 ;; The first two are out of order when the others are added.
454 (list (calendar-gregorian-from-absolute abs-p
) "Passover")
455 (list (calendar-gregorian-from-absolute (+ abs-p
50))
457 (when (or all calendar-hebrew-all-holidays-flag
)
459 (list (calendar-gregorian-from-absolute
460 (calendar-dayname-on-or-before 6 (- abs-p
43)))
462 (list (calendar-gregorian-from-absolute
463 (calendar-dayname-on-or-before 6 (- abs-p
30)))
465 (list (calendar-gregorian-from-absolute
466 (if (= (% abs-p
7) 2) (- abs-p
33) (- abs-p
31)))
468 (list (calendar-gregorian-from-absolute (- abs-p
31))
470 (list (calendar-gregorian-from-absolute (- abs-p
30))
472 (list (calendar-gregorian-from-absolute
473 (if (zerop (% abs-p
7)) (- abs-p
28) (- abs-p
29)))
475 (list (calendar-gregorian-from-absolute
476 (- (calendar-dayname-on-or-before 6 (- abs-p
14)) 7))
478 (list (calendar-gregorian-from-absolute
479 (calendar-dayname-on-or-before 6 (- abs-p
14)))
481 (list (calendar-gregorian-from-absolute
482 (calendar-dayname-on-or-before 6 (1- abs-p
)))
484 (list (calendar-gregorian-from-absolute (1- abs-p
))
486 (list (calendar-gregorian-from-absolute (1+ abs-p
))
487 "Passover (second day)")
488 (list (calendar-gregorian-from-absolute (+ abs-p
2))
489 "Hol Hamoed Passover (first day)")
490 (list (calendar-gregorian-from-absolute (+ abs-p
3))
491 "Hol Hamoed Passover (second day)")
492 (list (calendar-gregorian-from-absolute (+ abs-p
4))
493 "Hol Hamoed Passover (third day)")
494 (list (calendar-gregorian-from-absolute (+ abs-p
5))
495 "Hol Hamoed Passover (fourth day)")
496 (list (calendar-gregorian-from-absolute (+ abs-p
6))
497 "Passover (seventh day)")
498 (list (calendar-gregorian-from-absolute (+ abs-p
7))
499 "Passover (eighth day)")
500 (list (calendar-gregorian-from-absolute
501 (if (zerop (%
(+ abs-p
12) 7))
505 (list (calendar-gregorian-from-absolute
506 (if (zerop (% abs-p
7))
508 (if (= (% abs-p
7) 6)
512 (list (calendar-gregorian-from-absolute (+ abs-p
33))
514 (list (calendar-gregorian-from-absolute (+ abs-p
43))
516 (list (calendar-gregorian-from-absolute (+ abs-p
49))
518 (list (calendar-gregorian-from-absolute (+ abs-p
51))
519 "Shavuot (second day)"))))))))
521 ;;;###holiday-autoload
522 (define-obsolete-function-alias 'holiday-passover-etc
523 'holiday-hebrew-passover
"23.1")
525 ;;;###holiday-autoload
526 (defun holiday-hebrew-tisha-b-av ()
527 "List of dates around Tisha B'Av, as visible in calendar window."
528 (when (memq displayed-month
'(5 6 7 8 9))
529 (let ((abs-t-a (calendar-hebrew-to-absolute
530 (list 5 9 (+ displayed-year
3760)))))
531 (holiday-filter-visible-calendar
533 (list (calendar-gregorian-from-absolute
534 (if (= (% abs-t-a
7) 6) (- abs-t-a
20) (- abs-t-a
21)))
536 (list (calendar-gregorian-from-absolute
537 (calendar-dayname-on-or-before 6 abs-t-a
))
539 (list (calendar-gregorian-from-absolute
540 (if (= (% abs-t-a
7) 6) (1+ abs-t-a
) abs-t-a
))
542 (list (calendar-gregorian-from-absolute
543 (calendar-dayname-on-or-before 6 (+ abs-t-a
7)))
544 "Shabbat Nahamu"))))))
546 ;;;###holiday-autoload
547 (define-obsolete-function-alias 'holiday-tisha-b-av-etc
548 'holiday-hebrew-tisha-b-av
"23.1")
550 (autoload 'holiday-julian
"cal-julian")
552 ;;;###holiday-autoload
553 (defun holiday-hebrew-misc ()
554 "Miscellaneous Hebrew holidays, if visible in calendar window.
555 Includes: Tal Umatar, Tzom Teveth, Tu B'Shevat, Shabbat Shirah, and
557 (let ((m displayed-month
)
564 (calendar-increment-month m y -
1)
565 (setq year
(calendar-extract-year
566 (calendar-julian-from-absolute
567 (calendar-absolute-from-gregorian (list m
1 y
)))))
568 (if (zerop (%
(1+ year
) 4))
570 21)) "\"Tal Umatar\" (evening)")
574 (setq h-year
(calendar-extract-year
575 (calendar-hebrew-from-absolute
576 (calendar-absolute-from-gregorian
577 (list displayed-month
28 displayed-year
)))))
578 (if (= 6 (%
(calendar-hebrew-to-absolute (list 10 10 h-year
))
582 (holiday-hebrew 11 15 "Tu B'Shevat")
586 (setq m displayed-month
589 (calendar-increment-month m y
1)
590 (calendar-extract-year
591 (calendar-hebrew-from-absolute
592 (calendar-absolute-from-gregorian
593 (list m
(calendar-last-day-of-month m y
) y
)))))
595 (calendar-hebrew-from-absolute
597 (%
(calendar-hebrew-to-absolute
600 (calendar-dayname-on-or-before
601 6 (calendar-hebrew-to-absolute
602 (list 11 17 h-year
)))
603 (calendar-dayname-on-or-before
604 6 (calendar-hebrew-to-absolute
605 (list 11 16 h-year
))))))
606 (calendar-extract-day s-s
))
609 (setq m displayed-month
612 (calendar-increment-month m y -
1)
613 (calendar-extract-year
614 (calendar-julian-from-absolute
615 (calendar-absolute-from-gregorian (list m
1 y
))))))
617 (holiday-julian 3 26 "Kiddush HaHamah")))))
620 (autoload 'diary-list-entries-1
"diary-lib")
623 (defun diary-hebrew-list-entries ()
624 "Add any Hebrew date entries from the diary file to `diary-entries-list'.
625 Hebrew date diary entries must be prefaced by `diary-hebrew-entry-symbol'
626 \(normally an `H'). The same diary date forms govern the style
627 of the Hebrew calendar entries, except that the Hebrew month
628 names cannot be abbreviated. The Hebrew months are numbered
629 from 1 to 13 with Nisan being 1, 12 being Adar I and 13 being
630 Adar II; you must use `Adar I' if you want Adar of a common
631 Hebrew year. If a Hebrew date diary entry begins with
632 `diary-nonmarking-symbol', the entry will appear in the diary
633 listing, but will not be marked in the calendar. This function
634 is provided for use with `diary-nongregorian-listing-hook'."
635 (diary-list-entries-1 calendar-hebrew-month-name-array-leap-year
636 diary-hebrew-entry-symbol
637 'calendar-hebrew-from-absolute
))
639 (define-obsolete-function-alias 'list-hebrew-diary-entries
640 'diary-hebrew-list-entries
"23.1")
642 (autoload 'calendar-mark-complex
"diary-lib")
645 (defun calendar-hebrew-mark-date-pattern (month day year
&optional color
)
646 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
647 A value of 0 in any position is a wildcard. Optional argument COLOR is
648 passed to `calendar-mark-visible-date' as MARK."
649 ;; FIXME not the same as the Bahai and Islamic cases, so can't use
652 (set-buffer calendar-buffer
)
653 (if (and (not (zerop month
)) (not (zerop day
)))
654 (if (not (zerop year
))
655 ;; Fully specified Hebrew date.
656 (let ((date (calendar-gregorian-from-absolute
657 (calendar-hebrew-to-absolute
658 (list month day year
)))))
659 (if (calendar-date-is-visible-p date
)
660 (calendar-mark-visible-date date color
)))
661 ;; Month and day in any year.
662 (let ((gdate (calendar-hebrew-date-is-visible-p month day
)))
663 (if gdate
(calendar-mark-visible-date gdate color
))))
664 (calendar-mark-complex month day year
665 'calendar-hebrew-from-absolute color
))))
668 (define-obsolete-function-alias 'mark-hebrew-calendar-date-pattern
669 'calendar-hebrew-mark-date-pattern
"23.1")
671 (autoload 'diary-mark-entries-1
"diary-lib")
674 (defun diary-hebrew-mark-entries ()
675 "Mark days in the calendar window that have Hebrew date diary entries.
676 Marks each entry in `diary-file' (or included files) visible in the calendar
677 window. See `list-hebrew-diary-entries' for more information."
678 (diary-mark-entries-1 'calendar-hebrew-mark-date-pattern
679 calendar-hebrew-month-name-array-leap-year
680 diary-hebrew-entry-symbol
681 'calendar-hebrew-from-absolute
))
684 (define-obsolete-function-alias 'mark-hebrew-diary-entries
685 'diary-hebrew-mark-entries
"23.1")
687 (autoload 'diary-insert-entry-1
"diary-lib")
690 (defun diary-hebrew-insert-entry (arg)
691 "Insert a diary entry for the Hebrew date at point.
692 Prefix argument ARG makes the entry nonmarking."
694 (diary-insert-entry-1 nil arg calendar-hebrew-month-name-array-leap-year
695 diary-hebrew-entry-symbol
696 'calendar-hebrew-from-absolute
))
699 (define-obsolete-function-alias 'insert-hebrew-diary-entry
700 'diary-hebrew-insert-entry
"23.1")
703 (defun diary-hebrew-insert-monthly-entry (arg)
704 "Insert a monthly diary entry.
705 For the day of the Hebrew month corresponding to the date indicated by point.
706 Prefix argument ARG makes the entry nonmarking."
708 (diary-insert-entry-1 'monthly arg calendar-hebrew-month-name-array-leap-year
709 diary-hebrew-entry-symbol
710 'calendar-hebrew-from-absolute
))
712 (define-obsolete-function-alias 'insert-monthly-hebrew-diary-entry
713 'diary-hebrew-insert-monthly-entry
"23.1")
716 (defun diary-hebrew-insert-yearly-entry (arg)
717 "Insert an annual diary entry.
718 For the day of the Hebrew year corresponding to the date indicated by point.
719 Prefix argument ARG makes the entry nonmarking."
721 (diary-insert-entry-1 'yearly arg calendar-hebrew-month-name-array-leap-year
722 diary-hebrew-entry-symbol
723 'calendar-hebrew-from-absolute
))
725 (define-obsolete-function-alias 'insert-yearly-hebrew-diary-entry
726 'diary-hebrew-insert-yearly-entry
"23.1")
729 (defun calendar-hebrew-list-yahrzeits (death-date start-year end-year
)
730 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
731 When called interactively from the calendar window, the date of death is taken
732 from the cursor position."
735 (if (equal (current-buffer) (get-buffer calendar-buffer
))
736 (calendar-cursor-to-date)
737 (let* ((today (calendar-current-date))
739 "Year of death (>0): "
741 (number-to-string (calendar-extract-year today
))))
742 (month-array calendar-month-name-array
)
743 (completion-ignore-case t
)
744 (month (cdr (assoc-string
746 "Month of death (name): "
747 (mapcar 'list
(append month-array nil
))
749 (calendar-make-alist month-array
1) t
)))
750 (last (calendar-last-day-of-month month year
))
752 (format "Day of death (1-%d): " last
)
753 (lambda (x) (and (< 0 x
) (<= x last
))))))
754 (list month day year
))))
755 (death-year (calendar-extract-year death-date
))
756 (start-year (calendar-read
757 (format "Starting year of Yahrzeit table (>%d): "
759 (lambda (x) (> x death-year
))
760 (number-to-string (1+ death-year
))))
761 (end-year (calendar-read
762 (format "Ending year of Yahrzeit table (>=%d): "
764 (lambda (x) (>= x start-year
)))))
765 (list death-date start-year end-year
)))
766 (message "Computing Yahrzeits...")
767 (let* ((h-date (calendar-hebrew-from-absolute
768 (calendar-absolute-from-gregorian death-date
)))
769 (h-month (calendar-extract-month h-date
))
770 (h-day (calendar-extract-day h-date
))
771 (h-year (calendar-extract-year h-date
))
773 (calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer
774 (calendar-set-mode-line
775 (format "Yahrzeit dates for %s = %s"
776 (calendar-date-string death-date
)
777 (let ((calendar-month-name-array
778 (if (calendar-hebrew-leap-year-p h-year
)
779 calendar-hebrew-month-name-array-leap-year
780 calendar-hebrew-month-name-array-common-year
)))
781 (calendar-date-string h-date nil t
))))
782 (while (<= (setq i
(1+ i
)) end-year
)
784 (calendar-date-string
785 (calendar-gregorian-from-absolute
786 (calendar-hebrew-yahrzeit
788 (calendar-extract-year
789 (calendar-hebrew-from-absolute
790 (calendar-absolute-from-gregorian (list 1 1 i
))))))) "\n"))))
791 (message "Computing Yahrzeits...done"))
794 (define-obsolete-function-alias 'list-yahrzeit-dates
795 'calendar-hebrew-list-yahrzeits
"23.1")
799 ;; To be called from diary-list-sexp-entries, where DATE is bound.
801 (defun diary-hebrew-date ()
802 "Hebrew calendar equivalent of date diary entry."
803 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date
)))
806 (defun diary-hebrew-omer (&optional mark
)
807 "Omer count diary entry.
808 Entry applies if date is within 50 days after Passover.
810 An optional parameter MARK specifies a face or single-character string to
811 use when highlighting the day in the calendar."
813 (calendar-hebrew-to-absolute
814 (list 1 15 (+ (calendar-extract-year date
) 3760))))
815 (omer (- (calendar-absolute-from-gregorian date
) passover
))
818 (if (and (> omer
0) (< omer
50))
820 (format "Day %d%s of the omer (until sunset)"
824 (format ", that is, %d week%s%s"
826 (if (= week
1) "" "s")
829 (format " and %d day%s"
830 day
(if (= day
1) "" "s"))))))))))
832 (define-obsolete-function-alias 'diary-omer
'diary-hebrew-omer
"23.1")
836 (autoload 'diary-make-date
"diary-lib")
839 (defun diary-hebrew-yahrzeit (death-month death-day death-year
&optional mark
)
840 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before.
841 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary
842 entry is assumed to be the name of the person. Although the date
843 of death is specified by the civil calendar, the proper Hebrew
844 calendar Yahrzeit is determined.
846 The order of the input parameters changes according to `calendar-date-style'
847 \(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style).
849 An optional parameter MARK specifies a face or single-character string to
850 use when highlighting the day in the calendar."
851 (let* ((h-date (calendar-hebrew-from-absolute
852 (calendar-absolute-from-gregorian
853 (diary-make-date death-month death-day death-year
))))
854 (h-month (calendar-extract-month h-date
))
855 (h-day (calendar-extract-day h-date
))
856 (h-year (calendar-extract-year h-date
))
857 (d (calendar-absolute-from-gregorian date
))
858 (yr (calendar-extract-year (calendar-hebrew-from-absolute d
)))
860 (y (calendar-hebrew-yahrzeit h-date yr
)))
861 (if (and (> diff
0) (or (= y d
) (= y
(1+ d
))))
863 (format "Yahrzeit of %s%s: %d%s anniversary"
865 (if (= y d
) "" " (evening)")
867 (cond ((= (% diff
10) 1) "st")
868 ((= (% diff
10) 2) "nd")
869 ((= (% diff
10) 3) "rd")
872 (define-obsolete-function-alias 'diary-yahrzeit
'diary-hebrew-yahrzeit
"23.1")
875 (defun diary-hebrew-rosh-hodesh (&optional mark
)
876 "Rosh Hodesh diary entry.
877 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before.
879 An optional parameter MARK specifies a face or single-character string to
880 use when highlighting the day in the calendar."
881 (let* ((d (calendar-absolute-from-gregorian date
))
882 (h-date (calendar-hebrew-from-absolute d
))
883 (h-month (calendar-extract-month h-date
))
884 (h-day (calendar-extract-day h-date
))
885 (h-year (calendar-extract-year h-date
))
886 (leap-year (calendar-hebrew-leap-year-p h-year
))
887 (last-day (calendar-hebrew-last-day-of-month h-month h-year
))
890 calendar-hebrew-month-name-array-leap-year
891 calendar-hebrew-month-name-array-common-year
))
892 (this-month (aref h-month-names
(1- h-month
)))
893 (h-yesterday (calendar-extract-day
894 (calendar-hebrew-from-absolute (1- d
)))))
895 (if (or (= h-day
30) (and (= h-day
1) (/= h-month
7)))
902 ;; Next month must be in the same year since this
903 ;; month can't be the last month of the year since
905 (aref h-month-names h-month
))
906 (if (= h-yesterday
30)
907 (format "%s (second day)" this-month
)
909 (if (= (% d
7) 6) ; Saturday--check for Shabbat Mevarchim
911 (cond ((and (> h-day
22) (/= h-month
6) (= 29 last-day
))
912 (format "Mevarchim Rosh Hodesh %s (%s)"
915 (calendar-hebrew-last-month-of-year
918 (aref calendar-day-name-array
(- 29 h-day
))))
919 ((and (< h-day
30) (> h-day
22) (= 30 last-day
))
920 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
921 (aref h-month-names h-month
)
924 (aref calendar-day-name-array
(- 29 h-day
)))
925 (aref calendar-day-name-array
926 (%
(- 30 h-day
) 7))))))
927 (if (and (= h-day
29) (/= h-month
6))
929 (format "Erev Rosh Hodesh %s"
932 (calendar-hebrew-last-month-of-year
936 (define-obsolete-function-alias 'diary-rosh-hodesh
937 'diary-hebrew-rosh-hodesh
"23.1")
939 (defconst calendar-hebrew-parashiot-names
940 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
941 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
942 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
943 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
944 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
945 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
946 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
947 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
948 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
949 "The names of the parashiot in the Torah.")
951 (defun calendar-hebrew-parasha-name (p)
952 "Name(s) corresponding to parasha P."
953 (if (arrayp p
) ; combined parasha
955 (aref calendar-hebrew-parashiot-names
(aref p
0))
956 (aref calendar-hebrew-parashiot-names
(aref p
1)))
957 (aref calendar-hebrew-parashiot-names p
)))
959 ;; Following 14 constants are used in diary-parasha (intern).
961 ;; The seven ordinary year types (keviot).
962 (defconst calendar-hebrew-year-Saturday-incomplete-Sunday
963 [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]
964 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
965 43 44 45 46 47 48 49 50]
966 "The structure of the parashiot.
967 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
968 29 days), and has Passover start on Sunday.")
970 (defconst calendar-hebrew-year-Saturday-complete-Tuesday
971 [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]
972 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
973 43 44 45 46 47 48 49 [50 51]]
974 "The structure of the parashiot.
975 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
976 have 30 days), and has Passover start on Tuesday.")
978 (defconst calendar-hebrew-year-Monday-incomplete-Tuesday
979 [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]
980 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
981 43 44 45 46 47 48 49 [50 51]]
982 "The structure of the parashiot.
983 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
984 have 29 days), and has Passover start on Tuesday.")
986 (defconst calendar-hebrew-year-Monday-complete-Thursday
987 [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]
988 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
989 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
990 "The structure of the parashiot.
991 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
992 30 days), and has Passover start on Thursday.")
994 (defconst calendar-hebrew-year-Tuesday-regular-Thursday
995 [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]
996 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
997 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
998 "The structure of the parashiot.
999 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1000 Kislev has 30 days), and has Passover start on Thursday.")
1002 (defconst calendar-hebrew-year-Thursday-regular-Saturday
1003 [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
1004 24 nil
(nil .
25) (25 .
[26 27]) ([26 27] .
[28 29]) ([28 29] .
30)
1005 (30 .
31) ([31 32] .
32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
1007 "The structure of the parashiot.
1008 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
1009 Kislev has 30 days), and has Passover start on Saturday.")
1011 (defconst calendar-hebrew-year-Thursday-complete-Sunday
1012 [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
1013 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1014 43 44 45 46 47 48 49 50]
1015 "The structure of the parashiot.
1016 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
1017 have 30 days), and has Passover start on Sunday.")
1019 ;; The seven leap year types (keviot).
1020 (defconst calendar-hebrew-year-Saturday-incomplete-Tuesday
1021 [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
1022 23 24 25 26 27 nil
28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
1023 43 44 45 46 47 48 49 [50 51]]
1024 "The structure of the parashiot.
1025 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
1026 have 29 days), and has Passover start on Tuesday.")
1028 (defconst calendar-hebrew-year-Saturday-complete-Thursday
1029 [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
1030 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1031 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1032 "The structure of the parashiot.
1033 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1034 have 30 days), and has Passover start on Thursday.")
1036 (defconst calendar-hebrew-year-Monday-incomplete-Thursday
1037 [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
1038 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1039 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1040 "The structure of the parashiot.
1041 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1042 have 29 days), and has Passover start on Thursday.")
1044 (defconst calendar-hebrew-year-Monday-complete-Saturday
1045 [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
1046 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1047 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1048 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1049 "The structure of the parashiot.
1050 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1051 30 days), and has Passover start on Saturday.")
1053 (defconst calendar-hebrew-year-Tuesday-regular-Saturday
1054 [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
1055 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1056 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1057 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1058 "The structure of the parashiot.
1059 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1060 Kislev has 30 days), and has Passover start on Saturday.")
1062 (defconst calendar-hebrew-year-Thursday-incomplete-Sunday
1063 [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
1064 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1065 43 44 45 46 47 48 49 50]
1066 "The structure of the parashiot.
1067 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
1068 have 29 days), and has Passover start on Sunday.")
1070 (defconst calendar-hebrew-year-Thursday-complete-Tuesday
1071 [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
1072 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1073 43 44 45 46 47 48 49 [50 51]]
1074 "The structure of the parashiot.
1075 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
1076 have 30 days), and has Passover start on Tuesday.")
1078 ;;;###diary-autoload
1079 (defun diary-hebrew-parasha (&optional mark
)
1080 "Parasha diary entry--entry applies if date is a Saturday.
1081 An optional parameter MARK specifies a face or single-character string to
1082 use when highlighting the day in the calendar."
1083 (let ((d (calendar-absolute-from-gregorian date
)))
1084 (if (= (% d
7) 6) ; Saturday
1085 (let* ((h-year (calendar-extract-year
1086 (calendar-hebrew-from-absolute d
)))
1088 (calendar-hebrew-to-absolute (list 7 1 h-year
)))
1090 (calendar-hebrew-to-absolute (list 1 15 h-year
)))
1092 (aref calendar-day-name-array
(% rosh-hashanah
7)))
1094 (aref calendar-day-name-array
(% passover
7)))
1095 (long-h (calendar-hebrew-long-heshvan-p h-year
))
1096 (short-k (calendar-hebrew-short-kislev-p h-year
))
1097 (type (cond ((and long-h
(not short-k
)) "complete")
1098 ((and (not long-h
) short-k
) "incomplete")
1102 (intern (format "calendar-hebrew-year-%s-%s-%s" ; keviah
1103 rosh-hashanah-day type passover-day
))))
1104 (first-saturday ; of Hebrew year
1105 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah
)))
1106 (saturday ; which Saturday of the Hebrew year
1107 (/ (- d first-saturday
) 7))
1108 (parasha (aref year-format saturday
)))
1113 (if (listp parasha
) ; Israel differs from diaspora
1115 (format "%s (diaspora), %s (Israel)"
1116 (calendar-hebrew-parasha-name
1118 (calendar-hebrew-parasha-name
1120 (format "%s (Israel)"
1121 (calendar-hebrew-parasha-name
1123 (calendar-hebrew-parasha-name parasha
)))))))))
1125 (define-obsolete-function-alias 'diary-parasha
'diary-hebrew-parasha
"23.1")
1128 (declare-function solar-setup
"solar" ())
1129 (declare-function solar-sunrise-sunset
"solar" (date))
1130 (defvar calendar-latitude
)
1131 (defvar calendar-longitude
)
1132 (defvar calendar-time-zone
)
1135 ;; To be called from diary-list-sexp-entries, where DATE is bound.
1136 ;;;###diary-autoload
1137 (defun diary-hebrew-sabbath-candles (&optional mark
)
1138 "Local time of candle lighting diary entry--applies if date is a Friday.
1139 No diary entry if there is no sunset on that date. Uses
1140 `diary-hebrew-sabbath-candles-minutes'.
1142 An optional parameter MARK specifies a face or single-character string to
1143 use when highlighting the day in the calendar."
1145 (or (and calendar-latitude calendar-longitude calendar-time-zone
)
1147 (if (= (%
(calendar-absolute-from-gregorian date
) 7) 5) ; Friday
1148 (let ((sunset (cadr (solar-sunrise-sunset date
))))
1151 "%s Sabbath candle lighting"
1152 (apply 'solar-time-string
1153 (cons (- (car sunset
)
1154 (/ diary-hebrew-sabbath-candles-minutes
1156 (cdr sunset
)))))))))
1158 ;;;###diary-autoload
1159 (define-obsolete-function-alias 'diary-sabbath-candles
1160 'diary-hebrew-sabbath-candles
"23.1")
1163 (provide 'cal-hebrew
)
1165 ;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c
1166 ;;; cal-hebrew.el ends here