aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-04-01 02:43:05 +0000
committerGlenn Morris2008-04-01 02:43:05 +0000
commitb36e906dd003adfb10e0c07cde2e8ba3a282b632 (patch)
tree4a264db2081b76e9b4496af4c61e2e4c76c3a71b
parent714b503452afa994e423b1f42ff7362c606df377 (diff)
downloademacs-b36e906dd003adfb10e0c07cde2e8ba3a282b632.tar.gz
emacs-b36e906dd003adfb10e0c07cde2e8ba3a282b632.zip
(Commentary): Point to calendar.el.
(calendar-forward-month, calendar-end-of-month): Reduce nesting of some lets.
-rw-r--r--lisp/calendar/cal-move.el48
1 files changed, 24 insertions, 24 deletions
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 8c43c1a47fe..77edd16e219 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -27,8 +27,7 @@
27 27
28;;; Commentary: 28;;; Commentary:
29 29
30;; This collection of functions implements movement in the calendar for 30;; See calendar.el.
31;; calendar.el.
32 31
33;;; Code: 32;;; Code:
34 33
@@ -102,16 +101,16 @@ Movement is backward if ARG is negative."
102 (let* ((cursor-date (calendar-cursor-to-date t)) 101 (let* ((cursor-date (calendar-cursor-to-date t))
103 (month (extract-calendar-month cursor-date)) 102 (month (extract-calendar-month cursor-date))
104 (day (extract-calendar-day cursor-date)) 103 (day (extract-calendar-day cursor-date))
105 (year (extract-calendar-year cursor-date))) 104 (year (extract-calendar-year cursor-date))
106 (increment-calendar-month month year arg) 105 (last (progn
107 (let ((last (calendar-last-day-of-month month year))) 106 (increment-calendar-month month year arg)
108 (if (< last day) 107 (calendar-last-day-of-month month year)))
109 (setq day last))) 108 (day (min last day))
110 ;; Put the new month on the screen, if needed, and go to the new date. 109 ;; Put the new month on the screen, if needed, and go to the new date.
111 (let ((new-cursor-date (list month day year))) 110 (new-cursor-date (list month day year)))
112 (if (not (calendar-date-is-visible-p new-cursor-date)) 111 (if (not (calendar-date-is-visible-p new-cursor-date))
113 (calendar-other-month month year)) 112 (calendar-other-month month year))
114 (calendar-cursor-to-visible-date new-cursor-date))) 113 (calendar-cursor-to-visible-date new-cursor-date))
115 (run-hooks 'calendar-move-hook)) 114 (run-hooks 'calendar-move-hook))
116 115
117;;;###cal-autoload 116;;;###cal-autoload
@@ -288,18 +287,19 @@ Moves forward if ARG is negative."
288 (month (extract-calendar-month date)) 287 (month (extract-calendar-month date))
289 (day (extract-calendar-day date)) 288 (day (extract-calendar-day date))
290 (year (extract-calendar-year date)) 289 (year (extract-calendar-year date))
291 (last-day (calendar-last-day-of-month month year))) 290 (last-day (calendar-last-day-of-month month year))
292 (unless (= day last-day) 291 (last-day (progn
293 (calendar-cursor-to-visible-date (list month last-day year)) 292 (unless (= day last-day)
294 (setq arg (1- arg))) 293 (calendar-cursor-to-visible-date
295 (increment-calendar-month month year arg) 294 (list month last-day year))
296 (let ((last-day (list 295 (setq arg (1- arg)))
297 month 296 (increment-calendar-month month year arg)
298 (calendar-last-day-of-month month year) 297 (list month
299 year))) 298 (calendar-last-day-of-month month year)
300 (if (not (calendar-date-is-visible-p last-day)) 299 year))))
301 (calendar-other-month month year) 300 (if (not (calendar-date-is-visible-p last-day))
302 (calendar-cursor-to-visible-date last-day)))) 301 (calendar-other-month month year)
302 (calendar-cursor-to-visible-date last-day)))
303 (run-hooks 'calendar-move-hook)) 303 (run-hooks 'calendar-move-hook))
304 304
305;;;###cal-autoload 305;;;###cal-autoload