[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9287: Mention `displayed-month' and `displayed-year' in `diary-mark-

From: Štěpán Němec
Subject: bug#9287: Mention `displayed-month' and `displayed-year' in `diary-mark-entries-hook' documentation
Date: Fri, 12 Aug 2011 11:29:44 +0200

The two variables, which fortunately do appear to be dynamically bound
to the middle month and year currently displayed in the calendar window
at the time of running `diary-mark-entries-hook', are _crucial_ for
being able to define useful marking functions[1]. Please document this
(AFAICT they are currently not mentioned anywhere; I had to read much of
calendar.el and holidays.el to figure it out).

[1] Example:

(defun calendar-mark-lunar-phases ()
  (with-current-buffer calendar-buffer
    (mapc (lambda (phase)
             ;; http://en.wikipedia.org/wiki/Astronomical_symbols
             ;; "🌚🌛🌝🌜" "🌑🌓🌕🌗"
             (car phase) (string (aref "●◐○◑" (nth 2 phase)))))
          (let ((m displayed-month)
                (y displayed-year))
            (calendar-increment-month m y -1)
            (lunar-phase-list m y)))))

(add-hook 'diary-mark-entries-hook 'calendar-mark-lunar-phases)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]