Function: calendar-chinese-number-months

calendar-chinese-number-months is a byte-compiled function defined in cal-china.el.gz.

Signature

(calendar-chinese-number-months LIST START)

Documentation

Assign month numbers to the lunar months in LIST, starting with START.

Numbers are assigned sequentially, START, START+1, ..., 11, with half numbers used for leap months. First and last months of list are never leap months.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-china.el.gz
(defun calendar-chinese-number-months (list start)
  "Assign month numbers to the lunar months in LIST, starting with START.
Numbers are assigned sequentially, START, START+1, ..., 11, with
half numbers used for leap months.  First and last months of list
are never leap months."
  (when list
    (cons (list start (car list))       ; first month
          ;; Remaining months.
          (if (zerop (- 12 start (length list)))
              ;; List is too short for a leap month.
              (calendar-chinese-number-months (cdr list) (1+ start))
            (if (and (cddr list)        ; at least two more months...
                     (<= (nth 2 list)
                         (calendar-chinese-zodiac-sign-on-or-after
                          (cadr list))))
                ;; Next month is a leap month.
                (cons (list (+ start 0.5) (cadr list))
                      (calendar-chinese-number-months (cddr list) (1+ start)))
              ;; Next month is not a leap month.
              (calendar-chinese-number-months (cdr list) (1+ start)))))))