aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/cal-move.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index c7d163982ac..f0dca007a58 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -86,11 +86,12 @@ Movement is forward is ARG is negative."
86 (interactive "p") 86 (interactive "p")
87 (calendar-forward-month (* -12 arg))) 87 (calendar-forward-month (* -12 arg)))
88 88
89(defun scroll-calendar-left (arg) 89(defun scroll-calendar-left (&optional arg)
90 "Scroll the displayed calendar left by ARG months. 90 "Scroll the displayed calendar left by ARG months.
91If ARG is negative the calendar is scrolled right. Maintains the relative 91If ARG is negative the calendar is scrolled right. Maintains the relative
92position of the cursor with respect to the calendar as well as possible." 92position of the cursor with respect to the calendar as well as possible."
93 (interactive "p") 93 (interactive "p")
94 (unless arg (setq arg 1))
94 (calendar-cursor-to-nearest-date) 95 (calendar-cursor-to-nearest-date)
95 (let ((old-date (calendar-cursor-to-date)) 96 (let ((old-date (calendar-cursor-to-date))
96 (today (calendar-current-date))) 97 (today (calendar-current-date)))
@@ -106,12 +107,12 @@ position of the cursor with respect to the calendar as well as possible."
106 (t (list month 1 year))))))) 107 (t (list month 1 year)))))))
107 (run-hooks 'calendar-move-hook)) 108 (run-hooks 'calendar-move-hook))
108 109
109(defun scroll-calendar-right (arg) 110(defun scroll-calendar-right (&optional arg)
110 "Scroll the displayed calendar window right by ARG months. 111 "Scroll the displayed calendar window right by ARG months.
111If ARG is negative the calendar is scrolled left. Maintains the relative 112If ARG is negative the calendar is scrolled left. Maintains the relative
112position of the cursor with respect to the calendar as well as possible." 113position of the cursor with respect to the calendar as well as possible."
113 (interactive "p") 114 (interactive "p")
114 (scroll-calendar-left (- arg))) 115 (scroll-calendar-left (- (or arg 1))))
115 116
116(defun scroll-calendar-left-three-months (arg) 117(defun scroll-calendar-left-three-months (arg)
117 "Scroll the displayed calendar window left by 3*ARG months. 118 "Scroll the displayed calendar window left by 3*ARG months.