]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid errors in interactive calls of 'calendar-goto-day-of-year'
authorEli Zaretskii <eliz@gnu.org>
Tue, 4 Oct 2022 09:57:04 +0000 (12:57 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 4 Oct 2022 09:57:04 +0000 (12:57 +0300)
* lisp/calendar/cal-move.el (calendar-goto-day-of-year): Fix the
default value of DAY; doc fix.  (Bug#58283)

lisp/calendar/cal-move.el

index 4febad53fc5076276faad83c6a8ee85964d3181a..211e0f1e62da3c3cf78b9a95e3ab027f6aff8ae5 100644 (file)
@@ -384,7 +384,8 @@ Moves forward if ARG is negative."
 ;;;###cal-autoload
 (defun calendar-goto-day-of-year (year day &optional noecho)
   "Move cursor to YEAR, DAY number; echo DAY/YEAR unless NOECHO is non-nil.
-Negative DAY counts backward from end of year."
+Negative DAY counts backward from end of year.
+Interactively, prompt for YEAR and DAY number."
   (interactive
    (let* ((year (calendar-read-sexp
                  "Year (>0)"
@@ -394,7 +395,7 @@ Negative DAY counts backward from end of year."
           (day (calendar-read-sexp
                 "Day number (+/- 1-%d)"
                 (lambda (x) (and (<= 1 (abs x)) (<= (abs x) last)))
-                nil
+                (calendar-day-number (calendar-current-date))
                 last)))
      (list year day)))
   (calendar-goto-date