cal-hebrew addition from bug#8190.
authorEd Reingold <reingold@emr.cs.iit.edu>
Mon, 7 Mar 2011 07:48:32 +0000 (23:48 -0800)
committerGlenn Morris <rgm@gnu.org>
Mon, 7 Mar 2011 07:48:32 +0000 (23:48 -0800)
* lisp/calendar/cal-hebrew.el (diary-hebrew-yahrzeit):
Add optional `after-sunset' argument.

lisp/ChangeLog
lisp/calendar/cal-hebrew.el

index 38d9283..d855918 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-07  Ed Reingold  <reingold@emr.cs.iit.edu>
+
+       * calendar/cal-hebrew.el (diary-hebrew-yahrzeit):
+       Add optional `after-sunset' argument.  (Bug#8190)
+
 2011-03-07  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
 
        * play/morse.el (nato-alphabet, nato-region, denato-region):
index 63e7484..e5373a2 100644 (file)
@@ -879,21 +879,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))))
+                  (+ (calendar-absolute-from-gregorian
+                      (diary-make-date death-month death-day death-year))
+                     (if after-sunset 1 0))))
          (h-month (calendar-extract-month h-date))
          (h-day (calendar-extract-day h-date))
          (h-year (calendar-extract-year h-date))