all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9287: Mention `displayed-month' and `displayed-year' in `diary-mark-entries-hook' documentation
@ 2011-08-12  9:29 Štěpán Němec
  2011-09-11  2:11 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Štěpán Němec @ 2011-08-12  9:29 UTC (permalink / raw)
  To: 9287


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)
            (calendar-mark-visible-date
             ;; 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)

-- 
Štěpán





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-10-12  5:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12  9:29 bug#9287: Mention `displayed-month' and `displayed-year' in `diary-mark-entries-hook' documentation Štěpán Němec
2011-09-11  2:11 ` Lars Magne Ingebrigtsen
2011-09-11  3:02   ` Štěpán Němec
2011-09-11 18:48     ` Glenn Morris
2011-09-11 18:50       ` Glenn Morris
2011-09-11 19:26         ` Štěpán Němec
2011-09-11 19:35         ` Andreas Schwab
2011-09-13  0:40           ` Stefan Monnier
2011-09-11 19:21       ` Štěpán Němec
2011-09-11 23:25         ` Glenn Morris
2019-10-12  5:07         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.