Function: calendar-hebrew-list-yahrzeits

calendar-hebrew-list-yahrzeits is an autoloaded, interactive and byte-compiled function defined in cal-hebrew.el.gz.

Signature

(calendar-hebrew-list-yahrzeits DEATH-DATE START-YEAR END-YEAR)

Documentation

List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.

When called interactively from the calendar window, the date of death is taken from the cursor position.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-hebrew.el.gz
;;;###autoload
(defun calendar-hebrew-list-yahrzeits (death-date start-year end-year)
  "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
When called interactively from the calendar window, the date of death is taken
from the cursor position."
  (interactive
   (let* ((death-date
           (if (equal (current-buffer) (get-buffer calendar-buffer))
               (calendar-cursor-to-date t)
             (let* ((today (calendar-current-date))
                    (year (calendar-read-sexp
                           "Year of death (>0)"
                           (lambda (x) (> x 0))
                           (calendar-extract-year today)))
                    (month-array calendar-month-name-array)
                    (completion-ignore-case t)
                    (month (cdr (assoc-string
                                 (completing-read
                                  "Month of death (name): "
                                  (mapcar 'list (append month-array nil))
                                  nil t)
                                 (calendar-make-alist month-array 1) t)))
                    (last (calendar-last-day-of-month month year))
                    (day (calendar-read-sexp
                          "Day of death (1-%d)"
                          (lambda (x) (and (< 0 x) (<= x last)))
                          nil
                          last)))
               (list month day year))))
          (death-year (calendar-extract-year death-date))
          (start-year (calendar-read-sexp
                       "Starting year of Yahrzeit table (>%d)"
                       (lambda (x) (> x death-year))
                       (1+ death-year)
                       death-year))
          (end-year (calendar-read-sexp
                     "Ending year of Yahrzeit table (>=%d)"
                     (lambda (x) (>= x start-year))
                     nil
                     start-year)))
     (list death-date start-year end-year)))
  (message "Computing Yahrzeits...")
  (let* ((h-date (calendar-hebrew-from-absolute
                  (calendar-absolute-from-gregorian death-date)))
         (h-year (calendar-extract-year h-date))
         (i (1- start-year)))
    (calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer
      (calendar-set-mode-line
       (format "Yahrzeit dates for %s = %s"
               (calendar-date-string death-date)
               (let ((calendar-month-name-array
                      (if (calendar-hebrew-leap-year-p h-year)
                          calendar-hebrew-month-name-array-leap-year
                        calendar-hebrew-month-name-array-common-year)))
                 (calendar-date-string h-date nil t))))
      (while (<= (setq i (1+ i)) end-year)
        (insert
         (calendar-date-string
          (calendar-gregorian-from-absolute
           (calendar-hebrew-yahrzeit
            h-date
            (calendar-extract-year
             (calendar-hebrew-from-absolute
              (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n"))))
  (message "Computing Yahrzeits...done"))