Function: calendar-other-month

calendar-other-month is an interactive and byte-compiled function defined in calendar.el.gz.

Signature

(calendar-other-month MONTH YEAR &optional EVENT)

Documentation

Display a three-month calendar centered around MONTH and YEAR.

EVENT is an event like last-nonmenu-event.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-other-month (month year &optional event)
  "Display a three-month calendar centered around MONTH and YEAR.
EVENT is an event like `last-nonmenu-event'."
  (interactive (let ((event (list last-nonmenu-event)))
                 (append (calendar-read-date 'noday) event)))
  (with-current-buffer (or (and (not event) (current-buffer))
                           (calendar-event-buffer event))
    (unless (and (= month displayed-month)
                 (= year displayed-year))
      (let ((old-date (calendar-cursor-to-date))
            (today (calendar-current-date)))
        (calendar-generate-window month year)
        (calendar-cursor-to-visible-date
         (cond
          ((calendar-date-is-visible-p old-date) old-date)
          ((calendar-date-is-visible-p today) today)
          (t (list month 1 year))))))))