Function: calendar-scroll-left

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

Signature

(calendar-scroll-left &optional ARG EVENT)

Documentation

Scroll the displayed calendar left by ARG months.

If ARG is negative the calendar is scrolled right. Maintains the relative position of the cursor with respect to the calendar as well as possible. EVENT is an event like last-nonmenu-event.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-move.el.gz
;;;###cal-autoload
(defun calendar-scroll-left (&optional arg event)
  "Scroll the displayed calendar left by ARG months.
If ARG is negative the calendar is scrolled right.  Maintains the relative
position of the cursor with respect to the calendar as well as possible.
EVENT is an event like `last-nonmenu-event'."
  (interactive (list (prefix-numeric-value current-prefix-arg)
                     last-nonmenu-event))
  (unless arg (setq arg 1))
  (save-current-buffer
    (when (event-start event)
      (set-buffer (calendar-event-buffer event)))
    (calendar-cursor-to-nearest-date)
    (unless (zerop arg)
      (let ((old-date (calendar-cursor-to-date))
            (today (calendar-current-date))
            (month displayed-month)
            (year displayed-year))
        (calendar-increment-month month year arg)
        (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))))))
    (run-hooks 'calendar-move-hook)))