Function: calendar-mark-complex

calendar-mark-complex is a byte-compiled function defined in diary-lib.el.gz.

Signature

(calendar-mark-complex MONTH DAY YEAR FROMABS &optional COLOR)

Documentation

Mark dates in the calendar conforming to MONTH DAY YEAR of some system.

The function FROMABS converts absolute dates to the appropriate date system. Optional argument COLOR is passed to calendar-mark-visible-date as MARK.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-lib.el.gz
;; Bahá’í, Hebrew, Islamic.
(defun calendar-mark-complex (month day year fromabs &optional color)
  "Mark dates in the calendar conforming to MONTH DAY YEAR of some system.
The function FROMABS converts absolute dates to the appropriate date system.
Optional argument COLOR is passed to `calendar-mark-visible-date' as MARK."
  ;; Not one of the simple cases--check all visible dates for match.
  ;; Actually, the following code takes care of ALL of the cases, but
  ;; it's much too slow to be used for the simple (common) cases.
  (let* ((m displayed-month)
         (y displayed-year)
         (first-date (progn
                       (calendar-increment-month m y -1)
                       (calendar-absolute-from-gregorian (list m 1 y))))
         (last-date (progn
                      (calendar-increment-month m y 2)
                      (calendar-absolute-from-gregorian
                       (list m (calendar-last-day-of-month m y) y))))
         (date (1- first-date))
         local-date)
    (while (<= (setq date (1+ date)) last-date)
      (setq local-date (funcall fromabs date))
      (and (or (zerop month)
               (= month (calendar-extract-month local-date)))
           (or (zerop day)
               (= day (calendar-extract-day local-date)))
           (or (zerop year)
               (= year (calendar-extract-year local-date)))
           (calendar-mark-visible-date
            (calendar-gregorian-from-absolute date) color)))))