]> git.eshelyaron.com Git - emacs.git/commitdiff
Saner defaults for `calendar-read-sexp' (Bug#78964)
authorManuel Giraud <manuel@ledu-giraud.fr>
Sat, 5 Jul 2025 19:17:00 +0000 (21:17 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:08:00 +0000 (10:08 +0200)
* lisp/calendar/cal-bahai.el (calendar-bahai-read-date):
* lisp/calendar/cal-china.el (calendar-chinese-goto-date):
* lisp/calendar/cal-coptic.el (calendar-coptic-read-date):
* lisp/calendar/cal-french.el (calendar-french-goto-date):
* lisp/calendar/cal-hebrew.el (calendar-hebrew-read-date):
* lisp/calendar/cal-islam.el (calendar-islamic-read-date):
* lisp/calendar/cal-iso.el (calendar-iso-read-date):
* lisp/calendar/cal-julian.el (calendar-julian-goto-date)
(calendar-astro-goto-day-number):
* lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date)
(calendar-mayan-read-tzolkin-date):
* lisp/calendar/cal-persia.el (calendar-persian-read-date):
* lisp/calendar/diary-lib.el (diary-insert-cyclic-entry): Use
first day as default.
* lisp/calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits):
Set the default of end-year as start-year plus ten years.

(cherry picked from commit eb252e645492069621e633d9269a02b778a80678)

lisp/calendar/cal-bahai.el
lisp/calendar/cal-china.el
lisp/calendar/cal-coptic.el
lisp/calendar/cal-french.el
lisp/calendar/cal-hebrew.el
lisp/calendar/cal-islam.el
lisp/calendar/cal-iso.el
lisp/calendar/cal-julian.el
lisp/calendar/cal-mayan.el
lisp/calendar/cal-persia.el
lisp/calendar/diary-lib.el

index 073d04e7707fde42ad2c79108b48c301992eb050..fd0faf1e2ce657dae7d964691681655193033b80 100644 (file)
@@ -169,7 +169,8 @@ Reads a year, month and day."
                       (calendar-make-alist calendar-bahai-month-name-array
                                            1))))
          (day (calendar-read-sexp "Bahá’í calendar day (1-19)"
-                                  (lambda (x) (and (< 0 x) (<= x 19))))))
+                                  (lambda (x) (and (< 0 x) (<= x 19)))
+                                  1)))
     (list (list month day year))))
 
 ;;;###cal-autoload
index 776d1d287bf6529b1d6e09f4c543e386618bfcba..8d080e36072897db1f6d12782cc5450c90e5b1a9 100644 (file)
@@ -630,7 +630,7 @@ Echo Chinese date unless NOECHO is non-nil."
           (day (calendar-read-sexp
                 "Chinese calendar day (1-%d)"
                 (lambda (x) (and (<= 1 x) (<= x last)))
-                nil
+                1
                 last)))
      (list (list cycle year month day))))
   (calendar-goto-date (calendar-gregorian-from-absolute
index 11b244c930dc1dcabff066aa7424433a39e8aba1..04ef239897e533a9af80020110dd89e27c8a01dd 100644 (file)
@@ -157,7 +157,7 @@ Reads a year, month, and day."
          (day (calendar-read-sexp
                "%s calendar day (1-%d)"
                (lambda (x) (and (< 0 x) (<= x last)))
-               nil
+               1
                calendar-coptic-name last)))
     (list (list month day year))))
 
index 3c7906e5620cf934198065307ec4d34c291aeca2..3b98ea302162a1b136d5354f5e2d3bc178f6fa4f 100644 (file)
@@ -363,8 +363,10 @@ Echo French Revolutionary date unless NOECHO is non-nil."
           (day (if (> month 13)
                    (- month 13)
                  (calendar-read-sexp
-                  (format "Jour (1-%d): " last-day)
-                  (lambda (x) (<= 1 x last-day)))))
+                  "Jour (1-%d): "
+                  (lambda (x) (<= 1 x last-day))
+                  1
+                  last-day)))
           ;; All days in Vendémiaire and numbered 1 to 365 e.g., "Pomme"
           ;; gives 31 Vendémiaire automatically normalized to 1 Brumaire
           ;; "Céleri" gives 32 Vnd normalized to 2 Bru, "Raiponce" gives
index 69fac1d751d617db9285d4047c9820dc3893cae0..160f9e0a761dc200725242714d5b292b30aa17b5 100644 (file)
@@ -259,7 +259,7 @@ Reads a year, month, and day."
          (day (calendar-read-sexp
                "Hebrew calendar day (%d-%d)"
                (lambda (x) (and (<= first x) (<= x last)))
-               nil
+               first
                first last)))
     (list (list month day year))))
 
@@ -696,7 +696,7 @@ from the cursor position."
                     (day (calendar-read-sexp
                           "Day of death (1-%d)"
                           (lambda (x) (and (< 0 x) (<= x last)))
-                          nil
+                          1
                           last)))
                (list month day year))))
           (death-year (calendar-extract-year death-date))
@@ -708,7 +708,7 @@ from the cursor position."
           (end-year (calendar-read-sexp
                      "Ending year of Yahrzeit table (>=%d)"
                      (lambda (x) (>= x start-year))
-                     nil
+                     (+ 10 start-year)
                      start-year)))
      (list death-date start-year end-year)))
   (message "Computing Yahrzeits...")
index 2053852add03144bfd2b480f90140f11ae513b75..1cefdc805a4d75e106f2886385234079bee12f52 100644 (file)
@@ -160,7 +160,7 @@ Reads a year, month, and day."
          (day (calendar-read-sexp
                "Islamic calendar day (1-%d)"
                (lambda (x) (and (< 0 x) (<= x last)))
-               nil
+               1
                last)))
     (list (list month day year))))
 
index 8697a0f2b1fdd361b8a3c407f031eb1932d7213c..5f8e835749e729f4c9b07ed74317fe4b5a0eb117 100644 (file)
@@ -105,11 +105,12 @@ taken to be 1)."
          (week (calendar-read-sexp
                 "ISO calendar week (1-%d)"
                 (lambda (x) (and (> x 0) (<= x no-weeks)))
-                nil
+                1
                 no-weeks))
          (day (if dayflag (calendar-read-sexp
                            "ISO day (1-7)"
-                           (lambda (x) (and (<= 1 x) (<= x 7))))
+                           (lambda (x) (and (<= 1 x) (<= x 7)))
+                           1)
                 1)))
     (list (list week day year))))
 
index 6ab9626c7e3e1f96469896cd013a67528e449ca0..d580a8f3605a294f84924e1081138557d0717994 100644 (file)
@@ -118,7 +118,7 @@ Driven by the variable `calendar-date-display-form'."
                 (lambda (x)
                   (and (< (if (and (= year 1) (= month 1)) 2 0) x)
                        (<= x last)))
-                nil
+                (if (and (= year 1) (= month 1)) 3 1)
                 (if (and (= year 1) (= month 1)) 3 1) last)))
      (list (list month day year))))
   (calendar-goto-date (calendar-gregorian-from-absolute
@@ -174,7 +174,8 @@ Defaults to today's date if DATE is not given."
 Echo astronomical (Julian) day number unless NOECHO is non-nil."
   (interactive (list (calendar-read-sexp
                       "Astronomical (Julian) day number (>1721425)"
-                      (lambda (x) (> x 1721425)))))
+                      (lambda (x) (> x 1721425))
+                      1721426)))
   (calendar-goto-date
    (calendar-gregorian-from-absolute
     (floor
index 4bbd1a7a3cdd718c3764f90a97c4d31edf3a4ab6..52330e17280ebb0a091b22d3af56e5b32d097df9 100644 (file)
@@ -136,7 +136,8 @@ but some use 1137140.  Using 1232041 gives you Spinden's correlation; using
   "Prompt for a Mayan haab date."
   (let* ((haab-day (calendar-read-sexp
                     "Haab kin (0-19)"
-                    (lambda (x) (and (>= x 0) (< x 20)))))
+                    (lambda (x) (and (>= x 0) (< x 20)))
+                    0))
          (haab-month-list (append calendar-mayan-haab-month-name-array
                                   (and (< haab-day 5) '("Uayeb"))))
          (haab-month (cdr
@@ -152,7 +153,8 @@ but some use 1137140.  Using 1232041 gives you Spinden's correlation; using
   "Prompt for a Mayan tzolkin date."
   (let* ((tzolkin-count (calendar-read-sexp
                          "Tzolkin kin (1-13)"
-                         (lambda (x) (and (> x 0) (< x 14)))))
+                         (lambda (x) (and (> x 0) (< x 14)))
+                         1))
          (tzolkin-name-list (append calendar-mayan-tzolkin-names-array nil))
          (tzolkin-name (cdr
                         (assoc-string
index 5305607d31523a2fa3b3a74a57fdfa0a1e251b7d..d572d2f57fb13e01354b92f0d0b5d36821ea61a2 100644 (file)
@@ -177,7 +177,7 @@ Reads a year, month, and day."
          (day (calendar-read-sexp
                "Persian calendar day (1-%d)"
                (lambda (x) (and (< 0 x) (<= x last)))
-               nil
+               1
                last)))
     (list (list month day year))))
 
index 8fb6fadfe4c9dc60720761df010538811c5427e5..3d8d827417e5cd7e2338316f594d106f79c8b7fa 100644 (file)
@@ -2234,7 +2234,8 @@ Prefix argument ARG makes the entry nonmarking."
      (format "%s(diary-cyclic %d %s)"
              diary-sexp-entry-symbol
              (calendar-read-sexp "Repeat every how many days"
-                                 (lambda (x) (> x 0)))
+                                 (lambda (x) (> x 0))
+                                 1)
              (calendar-date-string (calendar-cursor-to-date t) nil t))
      arg)))