1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008, 2009, 2010 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 of the License, or
17 ;; (at your option) any later version.
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. If not, see <http://www.gnu.org/licenses/>.
35 (define-obsolete-variable-alias 'diary-sabbath-candles-minutes
36 'diary-hebrew-sabbath-candles-minutes
"23.1")
38 (defcustom diary-hebrew-sabbath-candles-minutes
18
39 "Number of minutes before sunset for sabbath candle lighting.
40 Used by `diary-hebrew-sabbath-candles'."
45 ;; End of user options.
47 (defun calendar-hebrew-leap-year-p (year)
48 "Non-nil if YEAR is a Hebrew calendar leap year."
49 (< (%
(1+ (* 7 year
)) 19) 7))
51 (defun calendar-hebrew-last-month-of-year (year)
52 "The last month of the Hebrew calendar YEAR."
53 (if (calendar-hebrew-leap-year-p year
)
57 (defun calendar-hebrew-elapsed-days (year)
58 "Days to mean conjunction of Tishri of Hebrew YEAR.
59 Measured from Sunday before start of Hebrew calendar."
60 (let* ((months-elapsed
61 (+ (* 235 (/ (1- year
) 19)) ; months in complete cycles so far
62 (* 12 (%
(1- year
) 19)) ; regular months in this cycle
63 (/ (1+ (* 7 (%
(1- year
) 19))) 19))) ; leap months this cycle
64 (parts-elapsed (+ 204 (* 793 (% months-elapsed
1080))))
67 (* 793 (/ months-elapsed
1080))
68 (/ parts-elapsed
1080)))
69 (parts ; conjunction parts
70 (+ (* 1080 (% hours-elapsed
24)) (% parts-elapsed
1080)))
71 (day ; conjunction day
72 (+ 1 (* 29 months-elapsed
) (/ hours-elapsed
24)))
74 (if (or (>= parts
19440) ; if the new moon is at or after midday
75 (and (= (% day
7) 2) ; ...or is on a Tuesday...
76 (>= parts
9924) ; at 9 hours, 204 parts or later...
77 ;; of a common year...
78 (not (calendar-hebrew-leap-year-p year
)))
79 (and (= (% day
7) 1) ; ...or is on a Monday...
80 (>= parts
16789) ; at 15 hours, 589 parts or later...
81 ;; at the end of a leap year.
82 (calendar-hebrew-leap-year-p (1- year
))))
83 ;; Then postpone Rosh HaShanah one day.
87 ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
88 (if (memq (% alternative-day
7) (list 0 3 5))
89 ;; Then postpone it one (more) day and return.
94 (defun calendar-hebrew-days-in-year (year)
95 "Number of days in Hebrew YEAR."
96 (- (calendar-hebrew-elapsed-days (1+ year
))
97 (calendar-hebrew-elapsed-days year
)))
99 (defun calendar-hebrew-long-heshvan-p (year)
100 "Non-nil if Heshvan is long in Hebrew YEAR."
101 (= (%
(calendar-hebrew-days-in-year year
) 10) 5))
103 (defun calendar-hebrew-short-kislev-p (year)
104 "Non-nil if Kislev is short in Hebrew YEAR."
105 (= (%
(calendar-hebrew-days-in-year year
) 10) 3))
107 (defun calendar-hebrew-last-day-of-month (month year
)
108 "The last day of MONTH in YEAR."
109 (if (or (memq month
(list 2 4 6 10 13))
110 (and (= month
12) (not (calendar-hebrew-leap-year-p year
)))
111 (and (= month
8) (not (calendar-hebrew-long-heshvan-p year
)))
112 (and (= month
9) (calendar-hebrew-short-kislev-p year
)))
116 (defun calendar-hebrew-to-absolute (date)
117 "Absolute date of Hebrew DATE.
118 The absolute date is the number of days elapsed since the (imaginary)
119 Gregorian date Sunday, December 31, 1 BC."
120 (let ((month (calendar-extract-month date
))
121 (day (calendar-extract-day date
))
122 (year (calendar-extract-year date
)))
123 (+ day
; days so far this month
124 (if (< month
7) ; before Tishri
125 ;; Then add days in prior months this year before and after Nisan.
127 m
7 (<= m
(calendar-hebrew-last-month-of-year year
))
128 (calendar-hebrew-last-day-of-month m year
))
131 (calendar-hebrew-last-day-of-month m year
)))
132 ;; Else add days in prior months this year.
135 (calendar-hebrew-last-day-of-month m year
)))
136 (calendar-hebrew-elapsed-days year
) ; days in prior years
137 -
1373429))) ; days elapsed before absolute date 1
139 (define-obsolete-function-alias 'calendar-absolute-from-hebrew
140 'calendar-hebrew-to-absolute
"23.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 (year (+ 3760 (calendar-extract-year greg-date
)))
148 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
149 (1- (calendar-extract-month greg-date
))))
151 (while (>= date
(calendar-hebrew-to-absolute
152 (list 7 1 (1+ year
))))
153 (setq year
(1+ year
)))
154 (calendar-hebrew-last-month-of-year year
)))
157 (calendar-hebrew-to-absolute
159 (calendar-hebrew-last-day-of-month month year
)
161 (setq month
(1+ (% month length
))))
163 (- date
(calendar-hebrew-to-absolute (list month
1 year
)))))
164 (list month day year
)))
166 (defconst calendar-hebrew-month-name-array-common-year
167 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
168 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]
169 "Array of strings giving the names of the Hebrew months in a common year.")
171 (defconst calendar-hebrew-month-name-array-leap-year
172 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri"
173 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]
174 "Array of strings giving the names of the Hebrew months in a leap year.")
177 (defun calendar-hebrew-date-string (&optional date
)
178 "String of Hebrew date before sunset of Gregorian DATE.
179 Defaults to today's date if DATE is not given.
180 Driven by the variable `calendar-date-display-form'."
181 (let* ((hebrew-date (calendar-hebrew-from-absolute
182 (calendar-absolute-from-gregorian
183 (or date
(calendar-current-date)))))
184 (calendar-month-name-array
185 (if (calendar-hebrew-leap-year-p (calendar-extract-year hebrew-date
))
186 calendar-hebrew-month-name-array-leap-year
187 calendar-hebrew-month-name-array-common-year
)))
188 (calendar-date-string hebrew-date nil t
)))
191 (defun calendar-hebrew-print-date ()
192 "Show the Hebrew calendar equivalent of the date under the cursor."
194 (message "Hebrew date (until sunset): %s"
195 (calendar-hebrew-date-string (calendar-cursor-to-date t
))))
197 (define-obsolete-function-alias 'calendar-print-hebrew-date
198 'calendar-hebrew-print-date
"23.1")
200 (defun calendar-hebrew-yahrzeit (death-date year
)
201 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
202 (let ((death-day (calendar-extract-day death-date
))
203 (death-month (calendar-extract-month death-date
))
204 (death-year (calendar-extract-year death-date
)))
206 ;; If it's Heshvan 30 it depends on the first anniversary; if
207 ;; that was not Heshvan 30, use the day before Kislev 1.
208 ((and (= death-month
8)
210 (not (calendar-hebrew-long-heshvan-p (1+ death-year
))))
211 (1- (calendar-hebrew-to-absolute (list 9 1 year
))))
212 ;; If it's Kislev 30 it depends on the first anniversary; if that
213 ;; was not Kislev 30, use the day before Teveth 1.
214 ((and (= death-month
9)
216 (calendar-hebrew-short-kislev-p (1+ death-year
)))
217 (1- (calendar-hebrew-to-absolute (list 10 1 year
))))
218 ;; If it's Adar II, use the same day in last month of year (Adar
221 (calendar-hebrew-to-absolute
222 (list (calendar-hebrew-last-month-of-year year
) death-day year
)))
223 ;; If it's the 30th in Adar I and year is not a leap year (so
224 ;; Adar has only 29 days), use the last day in Shevat.
225 ((and (= death-day
30)
227 (not (calendar-hebrew-leap-year-p year
)))
228 (calendar-hebrew-to-absolute (list 11 30 year
)))
229 ;; In all other cases, use the normal anniversary of the date of death.
230 (t (calendar-hebrew-to-absolute
231 (list death-month death-day year
))))))
233 (define-obsolete-function-alias 'hebrew-calendar-yahrzeit
234 'calendar-hebrew-yahrzeit
"23.1")
236 (defun calendar-hebrew-read-date ()
237 "Interactively read the arguments for a Hebrew date command.
238 Reads a year, month, and day."
239 (let* ((today (calendar-current-date))
241 "Hebrew calendar year (>3760): "
242 (lambda (x) (> x
3760))
244 (calendar-extract-year
245 (calendar-hebrew-from-absolute
246 (calendar-absolute-from-gregorian today
))))))
247 (month-array (if (calendar-hebrew-leap-year-p year
)
248 calendar-hebrew-month-name-array-leap-year
249 calendar-hebrew-month-name-array-common-year
))
250 (completion-ignore-case t
)
251 (month (cdr (assoc-string
253 "Hebrew calendar month name: "
254 (mapcar 'list
(append month-array nil
))
260 (calendar-make-alist month-array
)
263 (calendar-hebrew-to-absolute
265 (calendar-hebrew-last-day-of-month
269 (calendar-make-alist month-array
1) t
)))
270 (last (calendar-hebrew-last-day-of-month month year
))
271 (first (if (and (= year
3761) (= month
10))
274 (format "Hebrew calendar day (%d-%d): "
276 (lambda (x) (and (<= first x
) (<= x last
))))))
277 (list (list month day year
))))
280 (defun calendar-hebrew-goto-date (date &optional noecho
)
281 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is non-nil."
282 (interactive (calendar-hebrew-read-date))
283 (calendar-goto-date (calendar-gregorian-from-absolute
284 (calendar-hebrew-to-absolute date
)))
285 (or noecho
(calendar-hebrew-print-date)))
287 (define-obsolete-function-alias 'calendar-goto-hebrew-date
288 'calendar-hebrew-goto-date
"23.1")
290 (defvar displayed-month
) ; from calendar-generate
292 (defun calendar-hebrew-date-is-visible-p (month day
)
293 "Return non-nil if Hebrew MONTH DAY is visible in the calendar window.
294 Returns the corresponding Gregorian date."
295 ;; This test is only to speed things up a bit; it works fine without it.
296 (if (memq displayed-month
297 ;; What this is doing is equivalent to +1,2,3,4,5 modulo 12, ie:
298 ;; (mapcar (lambda (n) (let ((x (mod n 12)))
301 ;; (number-sequence (1+ month) (+ 5 month)))
302 ;; Ie it makes a list:
303 ;; 2 3 4 5 6 when month = 1
304 ;; 3 4 5 6 7 when month = 2
306 ;; 8 9 10 11 12 when month = 7
307 ;; 9 10 11 12 1 when month = 8
309 ;; 12 1 2 3 4 when month = 11
310 ;; 1 2 3 4 5 when month = 12
311 ;; This implies that hebrew month N cannot occur outside
312 ;; Gregorian months N:N+6 (the calendar shows
313 ;; displayed-month +/- 1 at any time).
314 ;; So to put it another way:
315 ;; (calendar-interval month 1 displayed-month
316 ;; (if (> month displayed-month) 2 1))
317 ;; must be >= 1 and <= 5. This could be expanded to:
318 ;; (if (> month displayed-month) (+ 12 (- displayed-month month))
319 ;; (- displayed-month month)
321 (if (< 11 month
) (- month
11) (+ month
1))
322 (if (< 10 month
) (- month
10) (+ month
2))
323 (if (< 9 month
) (- month
9) (+ month
3))
324 (if (< 8 month
) (- month
8) (+ month
4))
325 (if (< 7 month
) (- month
7) (+ month
5))))
326 (calendar-nongregorian-visible-p
327 month day
'calendar-hebrew-to-absolute
328 'calendar-hebrew-from-absolute
329 ;; Hebrew new year is start of month 7.
330 ;; If hmonth >= 7, choose the higher year.
331 (lambda (m) (> m
6)))))
333 ;;;###holiday-autoload
334 (defun holiday-hebrew (month day string
)
335 "Holiday on MONTH, DAY (Hebrew) called STRING.
336 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
337 Gregorian date in the form of the list (((month day year) STRING)). Returns
338 nil if it is not visible in the current calendar window."
339 (let ((gdate (calendar-hebrew-date-is-visible-p month day
)))
340 (if gdate
(list (list gdate string
)))))
342 ;; h-r-h-e should be called from holidays code.
343 (declare-function holiday-filter-visible-calendar
"holidays" (l))
345 (defvar displayed-year
)
347 ;;;###holiday-autoload
348 (defun holiday-hebrew-rosh-hashanah (&optional all
)
349 "List of dates related to Rosh Hashanah, as visible in calendar window.
350 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
352 (when (memq displayed-month
'(8 9 10 11))
353 (let ((abs-r-h (calendar-hebrew-to-absolute
354 (list 7 1 (+ displayed-year
3761)))))
355 (holiday-filter-visible-calendar
358 (list (calendar-gregorian-from-absolute abs-r-h
)
359 (format "Rosh HaShanah %d" (+ 3761 displayed-year
)))
360 (list (calendar-gregorian-from-absolute (+ abs-r-h
9))
362 (list (calendar-gregorian-from-absolute (+ abs-r-h
14))
364 (list (calendar-gregorian-from-absolute (+ abs-r-h
21))
366 (list (calendar-gregorian-from-absolute (+ abs-r-h
22))
368 (when (or all calendar-hebrew-all-holidays-flag
)
370 (list (calendar-gregorian-from-absolute
371 (calendar-dayname-on-or-before 6 (- abs-r-h
4)))
373 (list (calendar-gregorian-from-absolute (1- abs-r-h
))
374 "Erev Rosh HaShanah")
375 (list (calendar-gregorian-from-absolute (1+ abs-r-h
))
376 "Rosh HaShanah (second day)")
377 (list (calendar-gregorian-from-absolute
378 (if (= (% abs-r-h
7) 4) (+ abs-r-h
3) (+ abs-r-h
2)))
380 (list (calendar-gregorian-from-absolute
381 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h
)))
383 (list (calendar-gregorian-from-absolute (+ abs-r-h
8))
385 (list (calendar-gregorian-from-absolute (+ abs-r-h
13))
387 (list (calendar-gregorian-from-absolute (+ abs-r-h
15))
388 "Sukkot (second day)")
389 (list (calendar-gregorian-from-absolute (+ abs-r-h
16))
390 "Hol Hamoed Sukkot (first day)")
391 (list (calendar-gregorian-from-absolute (+ abs-r-h
17))
392 "Hol Hamoed Sukkot (second day)")
393 (list (calendar-gregorian-from-absolute (+ abs-r-h
18))
394 "Hol Hamoed Sukkot (third day)")
395 (list (calendar-gregorian-from-absolute (+ abs-r-h
19))
396 "Hol Hamoed Sukkot (fourth day)")
397 (list (calendar-gregorian-from-absolute (+ abs-r-h
20))
398 "Hoshanah Rabbah"))))))))
400 ;;;###holiday-autoload
401 (define-obsolete-function-alias 'holiday-rosh-hashanah-etc
402 'holiday-hebrew-rosh-hashanah
"23.1")
404 ;;;###holiday-autoload
405 (defun holiday-hebrew-hanukkah (&optional all
)
406 "List of dates related to Hanukkah, as visible in calendar window.
407 Shows only Hanukkah, unless `calendar-hebrew-all-holidays-flag' or ALL
409 ;; This test is only to speed things up a bit, it works fine without it.
410 (when (memq displayed-month
'(10 11 12 1 2))
411 (let* ((m displayed-month
)
414 (calendar-increment-month m y
1)
415 (calendar-extract-year
416 (calendar-hebrew-from-absolute
417 (calendar-absolute-from-gregorian
418 (list m
(calendar-last-day-of-month m y
) y
))))))
419 (abs-h (calendar-hebrew-to-absolute (list 9 25 h-y
)))
420 (ord ["first" "second" "third" "fourth" "fifth" "sixth"
423 (holiday-filter-visible-calendar
424 (if (or all calendar-hebrew-all-holidays-flag
)
427 (list (calendar-gregorian-from-absolute (1- abs-h
))
429 (dotimes (i 8 (nreverse han
))
431 (calendar-gregorian-from-absolute (+ abs-h i
))
432 (format "Hanukkah (%s day)" (aref ord i
)))
434 (list (list (calendar-gregorian-from-absolute abs-h
) "Hanukkah")))))))
436 ;;;###holiday-autoload
437 (define-obsolete-function-alias 'holiday-hanukkah
438 'holiday-hebrew-hanukkah
"23.1")
440 ;;;###holiday-autoload
441 (defun holiday-hebrew-passover (&optional all
)
442 "List of dates related to Passover, as visible in calendar window.
443 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
445 (when (< displayed-month
8)
446 (let ((abs-p (calendar-hebrew-to-absolute
447 (list 1 15 (+ displayed-year
3760)))))
448 (holiday-filter-visible-calendar
449 ;; The first two are out of order when the others are added.
452 (list (calendar-gregorian-from-absolute abs-p
) "Passover")
453 (list (calendar-gregorian-from-absolute (+ abs-p
50))
455 (when (or all calendar-hebrew-all-holidays-flag
)
457 (list (calendar-gregorian-from-absolute
458 (calendar-dayname-on-or-before 6 (- abs-p
43)))
460 (list (calendar-gregorian-from-absolute
461 (calendar-dayname-on-or-before 6 (- abs-p
30)))
463 (list (calendar-gregorian-from-absolute
464 (if (= (% abs-p
7) 2) (- abs-p
33) (- abs-p
31)))
466 (list (calendar-gregorian-from-absolute (- abs-p
31))
468 (list (calendar-gregorian-from-absolute (- abs-p
30))
470 (list (calendar-gregorian-from-absolute
471 (if (zerop (% abs-p
7)) (- abs-p
28) (- abs-p
29)))
473 (list (calendar-gregorian-from-absolute
474 (- (calendar-dayname-on-or-before 6 (- abs-p
14)) 7))
476 (list (calendar-gregorian-from-absolute
477 (calendar-dayname-on-or-before 6 (- abs-p
14)))
479 (list (calendar-gregorian-from-absolute
480 (calendar-dayname-on-or-before 6 (1- abs-p
)))
482 (list (calendar-gregorian-from-absolute (1- abs-p
))
484 (list (calendar-gregorian-from-absolute (1+ abs-p
))
485 "Passover (second day)")
486 (list (calendar-gregorian-from-absolute (+ abs-p
2))
487 "Hol Hamoed Passover (first day)")
488 (list (calendar-gregorian-from-absolute (+ abs-p
3))
489 "Hol Hamoed Passover (second day)")
490 (list (calendar-gregorian-from-absolute (+ abs-p
4))
491 "Hol Hamoed Passover (third day)")
492 (list (calendar-gregorian-from-absolute (+ abs-p
5))
493 "Hol Hamoed Passover (fourth day)")
494 (list (calendar-gregorian-from-absolute (+ abs-p
6))
495 "Passover (seventh day)")
496 (list (calendar-gregorian-from-absolute (+ abs-p
7))
497 "Passover (eighth day)")
498 (list (calendar-gregorian-from-absolute
499 (if (zerop (%
(+ abs-p
12) 7))
503 (list (calendar-gregorian-from-absolute
504 (if (zerop (% abs-p
7))
506 (if (= (% abs-p
7) 6)
508 (if (= (% abs-p
7) 2)
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
651 (with-current-buffer calendar-buffer
652 (if (and (not (zerop month
)) (not (zerop day
)))
653 (if (not (zerop year
))
654 ;; Fully specified Hebrew date.
655 (let ((date (calendar-gregorian-from-absolute
656 (calendar-hebrew-to-absolute
657 (list month day year
)))))
658 (if (calendar-date-is-visible-p date
)
659 (calendar-mark-visible-date date color
)))
660 ;; Month and day in any year.
661 (let ((gdate (calendar-hebrew-date-is-visible-p month day
)))
662 (if gdate
(calendar-mark-visible-date gdate color
))))
663 (calendar-mark-complex month day year
664 'calendar-hebrew-from-absolute color
))))
667 (define-obsolete-function-alias 'mark-hebrew-calendar-date-pattern
668 'calendar-hebrew-mark-date-pattern
"23.1")
670 (autoload 'diary-mark-entries-1
"diary-lib")
673 (defun diary-hebrew-mark-entries ()
674 "Mark days in the calendar window that have Hebrew date diary entries.
675 Marks each entry in `diary-file' (or included files) visible in the calendar
676 window. See `list-hebrew-diary-entries' for more information."
677 (diary-mark-entries-1 'calendar-hebrew-mark-date-pattern
678 calendar-hebrew-month-name-array-leap-year
679 diary-hebrew-entry-symbol
680 'calendar-hebrew-from-absolute
))
683 (define-obsolete-function-alias 'mark-hebrew-diary-entries
684 'diary-hebrew-mark-entries
"23.1")
686 (autoload 'diary-insert-entry-1
"diary-lib")
689 (defun diary-hebrew-insert-entry (arg)
690 "Insert a diary entry for the Hebrew date at point.
691 Prefix argument ARG makes the entry nonmarking."
693 (diary-insert-entry-1 nil arg calendar-hebrew-month-name-array-leap-year
694 diary-hebrew-entry-symbol
695 'calendar-hebrew-from-absolute
))
698 (define-obsolete-function-alias 'insert-hebrew-diary-entry
699 'diary-hebrew-insert-entry
"23.1")
702 (defun diary-hebrew-insert-monthly-entry (arg)
703 "Insert a monthly diary entry.
704 For the day of the Hebrew month corresponding to the date indicated by point.
705 Prefix argument ARG makes the entry nonmarking."
707 (diary-insert-entry-1 'monthly arg calendar-hebrew-month-name-array-leap-year
708 diary-hebrew-entry-symbol
709 'calendar-hebrew-from-absolute
))
711 (define-obsolete-function-alias 'insert-monthly-hebrew-diary-entry
712 'diary-hebrew-insert-monthly-entry
"23.1")
715 (defun diary-hebrew-insert-yearly-entry (arg)
716 "Insert an annual diary entry.
717 For the day of the Hebrew year corresponding to the date indicated by point.
718 Prefix argument ARG makes the entry nonmarking."
720 (diary-insert-entry-1 'yearly arg calendar-hebrew-month-name-array-leap-year
721 diary-hebrew-entry-symbol
722 'calendar-hebrew-from-absolute
))
724 (define-obsolete-function-alias 'insert-yearly-hebrew-diary-entry
725 'diary-hebrew-insert-yearly-entry
"23.1")
728 (defun calendar-hebrew-list-yahrzeits (death-date start-year end-year
)
729 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
730 When called interactively from the calendar window, the date of death is taken
731 from the cursor position."
734 (if (equal (current-buffer) (get-buffer calendar-buffer
))
735 (calendar-cursor-to-date)
736 (let* ((today (calendar-current-date))
738 "Year of death (>0): "
740 (number-to-string (calendar-extract-year today
))))
741 (month-array calendar-month-name-array
)
742 (completion-ignore-case t
)
743 (month (cdr (assoc-string
745 "Month of death (name): "
746 (mapcar 'list
(append month-array nil
))
748 (calendar-make-alist month-array
1) t
)))
749 (last (calendar-last-day-of-month month year
))
751 (format "Day of death (1-%d): " last
)
752 (lambda (x) (and (< 0 x
) (<= x last
))))))
753 (list month day year
))))
754 (death-year (calendar-extract-year death-date
))
755 (start-year (calendar-read
756 (format "Starting year of Yahrzeit table (>%d): "
758 (lambda (x) (> x death-year
))
759 (number-to-string (1+ death-year
))))
760 (end-year (calendar-read
761 (format "Ending year of Yahrzeit table (>=%d): "
763 (lambda (x) (>= x start-year
)))))
764 (list death-date start-year end-year
)))
765 (message "Computing Yahrzeits...")
766 (let* ((h-date (calendar-hebrew-from-absolute
767 (calendar-absolute-from-gregorian death-date
)))
768 (h-month (calendar-extract-month h-date
))
769 (h-day (calendar-extract-day h-date
))
770 (h-year (calendar-extract-year h-date
))
772 (calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer
773 (calendar-set-mode-line
774 (format "Yahrzeit dates for %s = %s"
775 (calendar-date-string death-date
)
776 (let ((calendar-month-name-array
777 (if (calendar-hebrew-leap-year-p h-year
)
778 calendar-hebrew-month-name-array-leap-year
779 calendar-hebrew-month-name-array-common-year
)))
780 (calendar-date-string h-date nil t
))))
781 (while (<= (setq i
(1+ i
)) end-year
)
783 (calendar-date-string
784 (calendar-gregorian-from-absolute
785 (calendar-hebrew-yahrzeit
787 (calendar-extract-year
788 (calendar-hebrew-from-absolute
789 (calendar-absolute-from-gregorian (list 1 1 i
))))))) "\n"))))
790 (message "Computing Yahrzeits...done"))
793 (define-obsolete-function-alias 'list-yahrzeit-dates
794 'calendar-hebrew-list-yahrzeits
"23.1")
798 ;; To be called from diary-list-sexp-entries, where DATE is bound.
800 (defun diary-hebrew-date ()
801 "Hebrew calendar equivalent of date diary entry."
802 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date
)))
805 (defun diary-hebrew-omer (&optional mark
)
806 "Omer count diary entry.
807 Entry applies if date is within 50 days after Passover.
809 An optional parameter MARK specifies a face or single-character string to
810 use when highlighting the day in the calendar."
812 (calendar-hebrew-to-absolute
813 (list 1 15 (+ (calendar-extract-year date
) 3760))))
814 (omer (- (calendar-absolute-from-gregorian date
) passover
))
817 (if (and (> omer
0) (< omer
50))
819 (format "Day %d%s of the omer (until sunset)"
823 (format ", that is, %d week%s%s"
825 (if (= week
1) "" "s")
828 (format " and %d day%s"
829 day
(if (= day
1) "" "s"))))))))))
831 (define-obsolete-function-alias 'diary-omer
'diary-hebrew-omer
"23.1")
835 (autoload 'diary-make-date
"diary-lib")
837 (declare-function diary-ordinal-suffix
"diary-lib" (n))
840 (defun diary-hebrew-yahrzeit (death-month death-day death-year
&optional mark
)
841 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before.
842 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary
843 entry is assumed to be the name of the person. Although the date
844 of death is specified by the civil calendar, the proper Hebrew
845 calendar Yahrzeit is determined.
847 The order of the input parameters changes according to `calendar-date-style'
848 \(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style).
850 An optional parameter MARK specifies a face or single-character string to
851 use when highlighting the day in the calendar."
852 (let* ((h-date (calendar-hebrew-from-absolute
853 (calendar-absolute-from-gregorian
854 (diary-make-date death-month death-day death-year
))))
855 (h-month (calendar-extract-month h-date
))
856 (h-day (calendar-extract-day h-date
))
857 (h-year (calendar-extract-year h-date
))
858 (d (calendar-absolute-from-gregorian date
))
859 (yr (calendar-extract-year (calendar-hebrew-from-absolute d
)))
861 (y (calendar-hebrew-yahrzeit h-date yr
)))
862 (if (and (> diff
0) (or (= y d
) (= y
(1+ d
))))
864 (format "Yahrzeit of %s%s: %d%s anniversary"
866 (if (= y d
) "" " (evening)")
868 (diary-ordinal-suffix diff
))))))
871 (define-obsolete-function-alias 'diary-yahrzeit
'diary-hebrew-yahrzeit
"23.1")
874 (defun diary-hebrew-rosh-hodesh (&optional mark
)
875 "Rosh Hodesh diary entry.
876 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before.
878 An optional parameter MARK specifies a face or single-character string to
879 use when highlighting the day in the calendar."
880 (let* ((d (calendar-absolute-from-gregorian date
))
881 (h-date (calendar-hebrew-from-absolute d
))
882 (h-month (calendar-extract-month h-date
))
883 (h-day (calendar-extract-day h-date
))
884 (h-year (calendar-extract-year h-date
))
885 (leap-year (calendar-hebrew-leap-year-p h-year
))
886 (last-day (calendar-hebrew-last-day-of-month h-month h-year
))
889 calendar-hebrew-month-name-array-leap-year
890 calendar-hebrew-month-name-array-common-year
))
891 (this-month (aref h-month-names
(1- h-month
)))
892 (h-yesterday (calendar-extract-day
893 (calendar-hebrew-from-absolute (1- d
)))))
894 (if (or (= h-day
30) (and (= h-day
1) (/= h-month
7)))
901 ;; Next month must be in the same year since this
902 ;; month can't be the last month of the year since
904 (aref h-month-names h-month
))
905 (if (= h-yesterday
30)
906 (format "%s (second day)" this-month
)
908 (if (= (% d
7) 6) ; Saturday--check for Shabbat Mevarchim
910 (cond ((and (> h-day
22) (/= h-month
6) (= 29 last-day
))
911 (format "Mevarchim Rosh Hodesh %s (%s)"
914 (calendar-hebrew-last-month-of-year
917 (aref calendar-day-name-array
(- 29 h-day
))))
918 ((and (< h-day
30) (> h-day
22) (= 30 last-day
))
919 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
920 (aref h-month-names h-month
)
923 (aref calendar-day-name-array
(- 29 h-day
)))
924 (aref calendar-day-name-array
925 (%
(- 30 h-day
) 7))))))
926 (if (and (= h-day
29) (/= h-month
6))
928 (format "Erev Rosh Hodesh %s"
931 (calendar-hebrew-last-month-of-year
935 (define-obsolete-function-alias 'diary-rosh-hodesh
936 'diary-hebrew-rosh-hodesh
"23.1")
938 (defconst calendar-hebrew-parashiot-names
939 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
940 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
941 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
942 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
943 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
944 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
945 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
946 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
947 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
948 "The names of the parashiot in the Torah.")
950 (defun calendar-hebrew-parasha-name (p)
951 "Name(s) corresponding to parasha P."
952 (if (arrayp p
) ; combined parasha
954 (aref calendar-hebrew-parashiot-names
(aref p
0))
955 (aref calendar-hebrew-parashiot-names
(aref p
1)))
956 (aref calendar-hebrew-parashiot-names p
)))
958 ;; Following 14 constants are used in diary-parasha (intern).
960 ;; The seven ordinary year types (keviot).
961 (defconst calendar-hebrew-year-Saturday-incomplete-Sunday
962 [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]
963 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
964 43 44 45 46 47 48 49 50]
965 "The structure of the parashiot.
966 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
967 29 days), and has Passover start on Sunday.")
969 (defconst calendar-hebrew-year-Saturday-complete-Tuesday
970 [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]
971 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
972 43 44 45 46 47 48 49 [50 51]]
973 "The structure of the parashiot.
974 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
975 have 30 days), and has Passover start on Tuesday.")
977 (defconst calendar-hebrew-year-Monday-incomplete-Tuesday
978 [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]
979 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
980 43 44 45 46 47 48 49 [50 51]]
981 "The structure of the parashiot.
982 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
983 have 29 days), and has Passover start on Tuesday.")
985 (defconst calendar-hebrew-year-Monday-complete-Thursday
986 [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]
987 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
988 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
989 "The structure of the parashiot.
990 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
991 30 days), and has Passover start on Thursday.")
993 (defconst calendar-hebrew-year-Tuesday-regular-Thursday
994 [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]
995 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 (nil .
34) (34 .
35) (35 .
36)
996 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
997 "The structure of the parashiot.
998 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
999 Kislev has 30 days), and has Passover start on Thursday.")
1001 (defconst calendar-hebrew-year-Thursday-regular-Saturday
1002 [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
1003 24 nil
(nil .
25) (25 .
[26 27]) ([26 27] .
[28 29]) ([28 29] .
30)
1004 (30 .
31) ([31 32] .
32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
1006 "The structure of the parashiot.
1007 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
1008 Kislev has 30 days), and has Passover start on Saturday.")
1010 (defconst calendar-hebrew-year-Thursday-complete-Sunday
1011 [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
1012 23 24 nil
25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
1013 43 44 45 46 47 48 49 50]
1014 "The structure of the parashiot.
1015 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
1016 have 30 days), and has Passover start on Sunday.")
1018 ;; The seven leap year types (keviot).
1019 (defconst calendar-hebrew-year-Saturday-incomplete-Tuesday
1020 [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
1021 23 24 25 26 27 nil
28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
1022 43 44 45 46 47 48 49 [50 51]]
1023 "The structure of the parashiot.
1024 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
1025 have 29 days), and has Passover start on Tuesday.")
1027 (defconst calendar-hebrew-year-Saturday-complete-Thursday
1028 [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
1029 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1030 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1031 "The structure of the parashiot.
1032 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
1033 have 30 days), and has Passover start on Thursday.")
1035 (defconst calendar-hebrew-year-Monday-incomplete-Thursday
1036 [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
1037 23 24 25 26 27 nil
28 29 30 31 32 33 (nil .
34) (34 .
35) (35 .
36)
1038 (36 .
37) (37 .
38) ([38 39] .
39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
1039 "The structure of the parashiot.
1040 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
1041 have 29 days), and has Passover start on Thursday.")
1043 (defconst calendar-hebrew-year-Monday-complete-Saturday
1044 [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
1045 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1046 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1047 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1048 "The structure of the parashiot.
1049 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
1050 30 days), and has Passover start on Saturday.")
1052 (defconst calendar-hebrew-year-Tuesday-regular-Saturday
1053 [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
1054 23 24 25 26 27 nil
(nil .
28) (28 .
29) (29 .
30) (30 .
31) (31 .
32)
1055 (32 .
33) (33 .
34) (34 .
35) (35 .
36) (36 .
37) (37 .
38) (38 .
39)
1056 (39 .
40) (40 .
41) ([41 42] .
42) 43 44 45 46 47 48 49 50]
1057 "The structure of the parashiot.
1058 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
1059 Kislev has 30 days), and has Passover start on Saturday.")
1061 (defconst calendar-hebrew-year-Thursday-incomplete-Sunday
1062 [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
1063 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1064 43 44 45 46 47 48 49 50]
1065 "The structure of the parashiot.
1066 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
1067 have 29 days), and has Passover start on Sunday.")
1069 (defconst calendar-hebrew-year-Thursday-complete-Tuesday
1070 [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
1071 23 24 25 26 27 28 nil
29 30 31 32 33 34 35 36 37 38 39 40 41 42
1072 43 44 45 46 47 48 49 [50 51]]
1073 "The structure of the parashiot.
1074 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
1075 have 30 days), and has Passover start on Tuesday.")
1077 ;;;###diary-autoload
1078 (defun diary-hebrew-parasha (&optional mark
)
1079 "Parasha diary entry--entry applies if date is a Saturday.
1080 An optional parameter MARK specifies a face or single-character string to
1081 use when highlighting the day in the calendar."
1082 (let ((d (calendar-absolute-from-gregorian date
)))
1083 (if (= (% d
7) 6) ; Saturday
1084 (let* ((h-year (calendar-extract-year
1085 (calendar-hebrew-from-absolute d
)))
1087 (calendar-hebrew-to-absolute (list 7 1 h-year
)))
1089 (calendar-hebrew-to-absolute (list 1 15 h-year
)))
1091 (aref calendar-day-name-array
(% rosh-hashanah
7)))
1093 (aref calendar-day-name-array
(% passover
7)))
1094 (long-h (calendar-hebrew-long-heshvan-p h-year
))
1095 (short-k (calendar-hebrew-short-kislev-p h-year
))
1096 (type (cond ((and long-h
(not short-k
)) "complete")
1097 ((and (not long-h
) short-k
) "incomplete")
1101 (intern (format "calendar-hebrew-year-%s-%s-%s" ; keviah
1102 rosh-hashanah-day type passover-day
))))
1103 (first-saturday ; of Hebrew year
1104 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah
)))
1105 (saturday ; which Saturday of the Hebrew year
1106 (/ (- d first-saturday
) 7))
1107 (parasha (aref year-format saturday
)))
1112 (if (listp parasha
) ; Israel differs from diaspora
1114 (format "%s (diaspora), %s (Israel)"
1115 (calendar-hebrew-parasha-name
1117 (calendar-hebrew-parasha-name
1119 (format "%s (Israel)"
1120 (calendar-hebrew-parasha-name
1122 (calendar-hebrew-parasha-name parasha
)))))))))
1124 (define-obsolete-function-alias 'diary-parasha
'diary-hebrew-parasha
"23.1")
1127 (declare-function solar-setup
"solar" ())
1128 (declare-function solar-sunrise-sunset
"solar" (date))
1129 (defvar calendar-latitude
)
1130 (defvar calendar-longitude
)
1131 (defvar calendar-time-zone
)
1134 ;; To be called from diary-list-sexp-entries, where DATE is bound.
1135 ;;;###diary-autoload
1136 (defun diary-hebrew-sabbath-candles (&optional mark
)
1137 "Local time of candle lighting diary entry--applies if date is a Friday.
1138 No diary entry if there is no sunset on that date. Uses
1139 `diary-hebrew-sabbath-candles-minutes'.
1141 An optional parameter MARK specifies a face or single-character string to
1142 use when highlighting the day in the calendar."
1144 (or (and calendar-latitude calendar-longitude calendar-time-zone
)
1146 (if (= (%
(calendar-absolute-from-gregorian date
) 7) 5) ; Friday
1147 (let ((sunset (cadr (solar-sunrise-sunset date
))))
1150 "%s Sabbath candle lighting"
1151 (apply 'solar-time-string
1152 (cons (- (car sunset
)
1153 (/ diary-hebrew-sabbath-candles-minutes
1155 (cdr sunset
)))))))))
1157 ;;;###diary-autoload
1158 (define-obsolete-function-alias 'diary-sabbath-candles
1159 'diary-hebrew-sabbath-candles
"23.1")
1162 (provide 'cal-hebrew
)
1164 ;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c
1165 ;;; cal-hebrew.el ends here