1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-03 04:21:28 -08:00

(calendar-cursor-to-nearest-date): Remove un-needed local `date'.

(calendar-cursor-to-visible-date): Use let rather than let*.
Remove un-needed local `first-of-month-weekday'.
This commit is contained in:
Glenn Morris 2008-03-28 02:45:58 +00:00
parent fdbe82c9af
commit 3e0e034bb5

View file

@ -39,9 +39,8 @@
"Move the cursor to the closest date.
The position of the cursor is unchanged if it is already on a date.
Returns the list (month day year) giving the cursor position."
(let ((date (calendar-cursor-to-date))
(column (current-column)))
(or date
(or (calendar-cursor-to-date)
(let ((column (current-column)))
(when (> 3 (count-lines (point-min) (point)))
(goto-line 3)
(move-to-column column))
@ -64,10 +63,9 @@ Returns the list (month day year) giving the cursor position."
;;;###cal-autoload
(defun calendar-cursor-to-visible-date (date)
"Move the cursor to DATE that is on the screen."
(let* ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date))
(first-of-month-weekday (calendar-day-of-week (list month 1 year))))
(let ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(goto-line (+ 3
(/ (+ day -1
(mod