Function: diary-hebrew-omer

diary-hebrew-omer is an autoloaded and byte-compiled function defined in cal-hebrew.el.gz.

Signature

(diary-hebrew-omer &optional MARK)

Documentation

Omer count diary entry.

Entry applies if date is within 50 days after Passover.

An optional parameter MARK specifies a face or single-character string to use when highlighting the day in the calendar.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-hebrew.el.gz
;;;###diary-autoload
(defun diary-hebrew-omer (&optional mark)
  "Omer count diary entry.
Entry applies if date is within 50 days after Passover.

An optional parameter MARK specifies a face or single-character string to
use when highlighting the day in the calendar."
  (let* ((passover
          (calendar-hebrew-to-absolute
           (list 1 15 (+ (calendar-extract-year date) 3760))))
         (omer (- (calendar-absolute-from-gregorian date) passover))
         (week (/ omer 7))
         (day (% omer 7)))
    (if (and (> omer 0) (< omer 50))
        (cons mark
              (format "Day %d%s of the omer (until sunset) %s she'be'%s"
                      omer
                      (if (zerop week)
                          ""
                        (format ", that is, %d week%s%s"
                                week
                                (if (= week 1) "" "s")
                                (if (zerop day)
                                    ""
                                  (format " and %d day%s"
                                          day (if (= day 1) "" "s")))))
                      (aref diary-hebrew-omer-sefirot (% (+ 6 day) 7))
                      (aref diary-hebrew-omer-sefirot
                            (+ (if (zerop day) -1 0) week)))))))