Function: holiday-fixed

holiday-fixed is an autoloaded and byte-compiled function defined in holidays.el.gz.

Signature

(holiday-fixed MONTH DAY STRING)

Documentation

Holiday on MONTH, DAY (Gregorian) called STRING.

If MONTH, DAY is visible, the value returned is the list (((MONTH DAY year) STRING)). Returns nil if it is not visible in the current calendar window.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/holidays.el.gz
;; Below are the functions that calculate the dates of holidays; these
;; are eval'ed in the function calendar-holiday-list.  If you
;; write other such functions, be sure to imitate the style used below.
;; Remember that each function must return a list of items of the form
;; ((month day year) string) of VISIBLE dates in the calendar window.

(defun holiday-fixed (month day string)
  "Holiday on MONTH, DAY (Gregorian) called STRING.
If MONTH, DAY is visible, the value returned is the list (((MONTH DAY year)
STRING)).  Returns nil if it is not visible in the current calendar window."
  ;; This determines whether a given month is visible in the calendar.
  ;; cf calendar-date-is-visible-p (which also checks the year part).
  ;; The day is irrelevant since only full months are displayed.
  ;; Since the calendar displays three months at a time, month N
  ;; is visible if displayed-month = N-1, N, N+1.
  ;; In particular, November is visible if d-m = 10, 11, 12.
  ;; This is useful, because we can do a one-sided test:
  ;; November is visible if d-m > 9. (Similarly, February is visible if
  ;; d-m < 4.)
  ;; To determine if December is visible, we can shift the calendar
  ;; back a month and ask if November is visible; to determine if
  ;; October is visible, we can shift it forward a month and ask if
  ;; November is visible; etc.
  (let ((m displayed-month)
        (y displayed-year))
    (calendar-increment-month m y (- 11 month))
    (if (> m 9)                         ; Is November visible?
        (list (list (list month day y) string)))))