Mercurial > emacs
comparison lisp/calendar/cal-move.el @ 24337:d9aef2d7c503
(scroll-calendar-left): Don't set
displayed-month and displayed-year here, let generate-calendar do
it, after range checking.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Wed, 17 Feb 1999 10:32:01 +0000 |
parents | b3d4cde6e4c3 |
children | 0d68ae69cd8c |
comparison
equal
deleted
inserted
replaced
24336:3c68ad53545e | 24337:d9aef2d7c503 |
---|---|
91 (interactive "p") | 91 (interactive "p") |
92 (calendar-cursor-to-nearest-date) | 92 (calendar-cursor-to-nearest-date) |
93 (let ((old-date (calendar-cursor-to-date)) | 93 (let ((old-date (calendar-cursor-to-date)) |
94 (today (calendar-current-date))) | 94 (today (calendar-current-date))) |
95 (if (/= arg 0) | 95 (if (/= arg 0) |
96 (progn | 96 (let ((month displayed-month) |
97 (increment-calendar-month displayed-month displayed-year arg) | 97 (year displayed-year)) |
98 (generate-calendar-window displayed-month displayed-year) | 98 (increment-calendar-month month year arg) |
99 (generate-calendar-window month year) | |
99 (calendar-cursor-to-visible-date | 100 (calendar-cursor-to-visible-date |
100 (cond | 101 (cond |
101 ((calendar-date-is-visible-p old-date) old-date) | 102 ((calendar-date-is-visible-p old-date) old-date) |
102 ((calendar-date-is-visible-p today) today) | 103 ((calendar-date-is-visible-p today) today) |
103 (t (list displayed-month 1 displayed-year)))))))) | 104 (t (list month 1 year)))))))) |
104 | 105 |
105 (defun scroll-calendar-right (arg) | 106 (defun scroll-calendar-right (arg) |
106 "Scroll the displayed calendar window right by ARG months. | 107 "Scroll the displayed calendar window right by ARG months. |
107 If ARG is negative the calendar is scrolled left. Maintains the relative | 108 If ARG is negative the calendar is scrolled left. Maintains the relative |
108 position of the cursor with respect to the calendar as well as possible." | 109 position of the cursor with respect to the calendar as well as possible." |