comparison lisp/calendar/cal-move.el @ 103269:9e868e938ebb

(calendar-forward-day): Fix 2008-06-21 change - always move cursor to new date. (Bug#3338)
author Glenn Morris <rgm@gnu.org>
date Thu, 21 May 2009 04:40:08 +0000
parents 8d9cf977e8f5
children bc2e79adb401
comparison
equal deleted inserted replaced
103268:fd266a506f8e 103269:9e868e938ebb
228 (new-cursor-date 228 (new-cursor-date
229 (calendar-gregorian-from-absolute 229 (calendar-gregorian-from-absolute
230 (+ (calendar-absolute-from-gregorian cursor-date) arg))) 230 (+ (calendar-absolute-from-gregorian cursor-date) arg)))
231 (new-display-month (calendar-extract-month new-cursor-date)) 231 (new-display-month (calendar-extract-month new-cursor-date))
232 (new-display-year (calendar-extract-year new-cursor-date))) 232 (new-display-year (calendar-extract-year new-cursor-date)))
233 ;; Put the new month on the screen, if needed, and go to the new date. 233 ;; Put the new month on the screen, if needed.
234 (if (calendar-date-is-visible-p new-cursor-date) 234 (unless (calendar-date-is-visible-p new-cursor-date)
235 (calendar-cursor-to-visible-date new-cursor-date)
236 ;; The next line gives smoother scrolling IMO (one month at a 235 ;; The next line gives smoother scrolling IMO (one month at a
237 ;; time rather than two). 236 ;; time rather than two).
238 (calendar-increment-month new-display-month new-display-year 237 (calendar-increment-month new-display-month new-display-year
239 (if (< arg 0) 1 -1)) 238 (if (< arg 0) 1 -1))
240 (calendar-other-month new-display-month new-display-year)))) 239 (calendar-other-month new-display-month new-display-year))
240 ;; Go to the new date.
241 (calendar-cursor-to-visible-date new-cursor-date)))
241 (run-hooks 'calendar-move-hook)) 242 (run-hooks 'calendar-move-hook))
242 243
243 ;;;###cal-autoload 244 ;;;###cal-autoload
244 (defun calendar-backward-day (arg) 245 (defun calendar-backward-day (arg)
245 "Move the cursor back ARG days. 246 "Move the cursor back ARG days.