From 2b2d8ce41edee0ef8f27ccf5c7b5e4233b3f20bc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 4 Oct 2022 12:57:04 +0300 Subject: [PATCH] Avoid errors in interactive calls of 'calendar-goto-day-of-year' * 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el index 4febad53fc5..211e0f1e62d 100644 --- a/lisp/calendar/cal-move.el +++ b/lisp/calendar/cal-move.el @@ -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 -- 2.39.2