X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0d6459dfb52188481bfd6bb53f1b2f653ecd6a5d..bc81e2c4e885787603da3e0314d6ea45a43f7862:/lisp/calendar/cal-hebrew.el diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index 63e7484e12..52bf442915 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -764,8 +764,6 @@ from the cursor position." (message "Computing Yahrzeits...") (let* ((h-date (calendar-hebrew-from-absolute (calendar-absolute-from-gregorian death-date))) - (h-month (calendar-extract-month h-date)) - (h-day (calendar-extract-day h-date)) (h-year (calendar-extract-year h-date)) (i (1- start-year))) (calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer @@ -879,23 +877,27 @@ use when highlighting the day in the calendar." (declare-function diary-ordinal-suffix "diary-lib" (n)) ;;;###diary-autoload -(defun diary-hebrew-yahrzeit (death-month death-day death-year &optional mark) +(defun diary-hebrew-yahrzeit (death-month death-day death-year + &optional mark after-sunset) "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed to be the name of the person. Although the date of death is specified by the civil calendar, the proper Hebrew calendar Yahrzeit is determined. +If the death occurred after local sunset on the given civil date, +the following civil date corresponds to the Hebrew date of +death--set the optional parameter AFTER-SUNSET non-nil in this case. + The order of the input parameters changes according to `calendar-date-style' \(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style). An optional parameter MARK specifies a face or single-character string to use when highlighting the day in the calendar." (let* ((h-date (calendar-hebrew-from-absolute - (calendar-absolute-from-gregorian - (diary-make-date death-month death-day death-year)))) - (h-month (calendar-extract-month h-date)) - (h-day (calendar-extract-day h-date)) + (+ (calendar-absolute-from-gregorian + (diary-make-date death-month death-day death-year)) + (if after-sunset 1 0)))) (h-year (calendar-extract-year h-date)) (d (calendar-absolute-from-gregorian date)) (yr (calendar-extract-year (calendar-hebrew-from-absolute d))) @@ -948,16 +950,17 @@ use when highlighting the day in the calendar." (format "%s (second day)" this-month) this-month)))) (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim - (cons mark - (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) + (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) + (cons mark (format "Mevarchim Rosh Hodesh %s (%s)" (aref h-month-names (if (= h-month (calendar-hebrew-last-month-of-year h-year)) 0 h-month)) - (aref calendar-day-name-array (- 29 h-day)))) - ((and (< h-day 30) (> h-day 22) (= 30 last-day)) + (aref calendar-day-name-array (- 29 h-day))))) + ((and (< h-day 30) (> h-day 22) (= 30 last-day)) + (cons mark (format "Mevarchim Rosh Hodesh %s (%s-%s)" (aref h-month-names h-month) (if (= h-day 29)