Function: calendar

calendar is an autoloaded, interactive and byte-compiled function defined in calendar.el.gz.

Signature

(calendar &optional ARG)

Documentation

Display a three-month Gregorian calendar.

The three months appear side by side, with the current month in the middle surrounded by the previous and next months. The cursor is put on today's date. If optional prefix argument ARG is non-nil, prompts for the central month and year.

Once in the calendar window, future or past months can be moved into view. Arbitrary months can be displayed, or the calendar can be scrolled forward or backward. The cursor can be moved forward or backward by one day, one week, one month, or one year. All of these commands take prefix arguments which, when negative, cause movement in the opposite direction. For convenience, the digit keys and the minus sign are automatically prefixes. Use C-h m (describe-mode) for details of the key bindings in the calendar window.

Displays the calendar in a separate window, or optionally in a separate frame, depending on the value of calendar-setup.

If calendar-view-diary-initially-flag is non-nil, also displays the diary entries for the current date (or however many days diary-number-of-entries specifies). This variable can be overridden by calendar-setup. As well as being displayed, diary entries can also be marked on the calendar (see calendar-mark-diary-entries-flag).

Runs the following hooks:

calendar-today-visible-hook, calendar-today-invisible-hook - after
   generating a calendar, if today's date is visible or not, respectively
calendar-initial-window-hook - after first creating a calendar

This function is suitable for execution in an init file.

View in manual

Probably introduced at or before Emacs version 18.50.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
              (calendar-day-number '(12 31 -1))))))) ; days in year 1 BC

;;;###autoload
(defun calendar (&optional arg)
  "Display a three-month Gregorian calendar.
The three months appear side by side, with the current month in
the middle surrounded by the previous and next months.  The
cursor is put on today's date.  If optional prefix argument ARG
is non-nil, prompts for the central month and year.

Once in the calendar window, future or past months can be moved
into view.  Arbitrary months can be displayed, or the calendar
can be scrolled forward or backward.  The cursor can be moved
forward or backward by one day, one week, one month, or one year.
All of these commands take prefix arguments which, when negative,
cause movement in the opposite direction.  For convenience, the
digit keys and the minus sign are automatically prefixes.  Use
\\[describe-mode] for details of the key bindings in the calendar
window.

Displays the calendar in a separate window, or optionally in a
separate frame, depending on the value of `calendar-setup'.

If `calendar-view-diary-initially-flag' is non-nil, also displays the
diary entries for the current date (or however many days
`diary-number-of-entries' specifies).  This variable can be
overridden by `calendar-setup'.  As well as being displayed,
diary entries can also be marked on the calendar (see
`calendar-mark-diary-entries-flag').

Runs the following hooks:

`calendar-today-visible-hook', `calendar-today-invisible-hook' - after
   generating a calendar, if today's date is visible or not, respectively
`calendar-initial-window-hook' - after first creating a calendar

This function is suitable for execution in an init file."
  (interactive "P")
  ;; Avoid loading cal-x unless it will be used.
  (if (and (memq calendar-setup '(one-frame two-frames calendar-only))
           (display-multi-frame-p))
      ;; Calendar does its own frame setup.
      (let ((pop-up-frames nil))
        (calendar-frame-setup calendar-setup arg))
    (calendar-basic-setup arg)))