(lemacs.info)Calendar Customizing


Next: Holiday Customizing Up: Calendar Customization

Customizing the Calendar
........................

   If you set the variable `view-diary-entries-initially' to `t',
calling up the calendar automatically displays the diary entries for
the current date as well.  The diary dates appear only if the current
date is visible.  If you add both of the following lines to your
`.emacs' file:

     (setq view-diary-entries-initially t)
     (calendar)

they display both the calendar and diary windows whenever you start
Emacs.

   Similarly, if you set the variable
`view-calendar-holidays-initially' to `t', entering the calendar
automatically displays a list of holidays for the current three month
period.  The holiday list appears in a separate window.

   You can set the variable `mark-diary-entries-in-calendar' to `t' in
order to place a plus sign (`+') beside any dates with diary entries.
Whenever the calendar window is displayed or redisplayed, the diary
entries are automatically marked for holidays.

   Similarly, setting the variable `mark-holidays-in-calendar' to `t'
places an asterisk (`*') after all holiday dates visible in the
calendar window.

   There are many customizations that you can make with the hooks
provided.  For example, the variable `calendar-load-hook', whose
default value is `nil', is a normal hook run when the calendar package
is first loaded (before actually starting to display the calendar).

   The variable `initial-calendar-window-hook', whose default value is
`nil', is a normal hook run the first time the calendar window is
displayed.  The function is invoked only when you first enter Calendar
mode, not when you redisplay an existing Calendar window.  But if you
leave the calendar with the `q' command and reenter it, the hook runs
again.

   The variable `today-visible-calendar-hook', whose default value is
`nil', is a normal hook run after the calendar buffer has been prepared
with the calendar when the current date is visible in the window.  One
use of this hook is to replace today's date with asterisks; a function
`calendar-star-date' is included for this purpose.  In your `.emacs'
file, put:

     (setq today-visible-calendar-hook 'calendar-star-date)

Another standard hook function adds asterisks around the current date.
Here's how to use it:

     (setq today-visible-calendar-hook 'calendar-mark-today)

A corresponding variable, `today-invisible-calendar-hook', whose
default value is `nil', is a normal hook run after the calendar buffer
text has been prepared, if the current date is *not* visible in the
window.


automatically generated by info2www