aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/cal-move.el12
1 files changed, 5 insertions, 7 deletions
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 2aef750db68..8c43c1a47fe 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -39,9 +39,8 @@
39 "Move the cursor to the closest date. 39 "Move the cursor to the closest date.
40The position of the cursor is unchanged if it is already on a date. 40The position of the cursor is unchanged if it is already on a date.
41Returns the list (month day year) giving the cursor position." 41Returns the list (month day year) giving the cursor position."
42 (let ((date (calendar-cursor-to-date)) 42 (or (calendar-cursor-to-date)
43 (column (current-column))) 43 (let ((column (current-column)))
44 (or date
45 (when (> 3 (count-lines (point-min) (point))) 44 (when (> 3 (count-lines (point-min) (point)))
46 (goto-line 3) 45 (goto-line 3)
47 (move-to-column column)) 46 (move-to-column column))
@@ -64,10 +63,9 @@ Returns the list (month day year) giving the cursor position."
64;;;###cal-autoload 63;;;###cal-autoload
65(defun calendar-cursor-to-visible-date (date) 64(defun calendar-cursor-to-visible-date (date)
66 "Move the cursor to DATE that is on the screen." 65 "Move the cursor to DATE that is on the screen."
67 (let* ((month (extract-calendar-month date)) 66 (let ((month (extract-calendar-month date))
68 (day (extract-calendar-day date)) 67 (day (extract-calendar-day date))
69 (year (extract-calendar-year date)) 68 (year (extract-calendar-year date)))
70 (first-of-month-weekday (calendar-day-of-week (list month 1 year))))
71 (goto-line (+ 3 69 (goto-line (+ 3
72 (/ (+ day -1 70 (/ (+ day -1
73 (mod 71 (mod