mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Saner defaults for `calendar-read-sexp' (Bug#78964)
* 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.
This commit is contained in:
parent
256dfdf11f
commit
eb252e6454
11 changed files with 25 additions and 17 deletions
|
|
@ -170,7 +170,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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -158,7 +158,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))))
|
||||
|
||||
|
|
|
|||
|
|
@ -364,8 +364,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
|
||||
|
|
|
|||
|
|
@ -260,7 +260,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))))
|
||||
|
||||
|
|
@ -698,7 +698,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))
|
||||
|
|
@ -710,7 +710,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...")
|
||||
|
|
|
|||
|
|
@ -161,7 +161,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))))
|
||||
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,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
|
||||
|
|
@ -175,7 +175,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
|
||||
|
|
|
|||
|
|
@ -137,7 +137,8 @@ but some use 1137140. Using 1232041 gives you Spinden's correlation; using
|
|||
(let* ((completion-ignore-case t)
|
||||
(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
|
||||
|
|
@ -153,7 +154,8 @@ but some use 1137140. Using 1232041 gives you Spinden's correlation; using
|
|||
(let* ((completion-ignore-case t)
|
||||
(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
|
||||
|
|
|
|||
|
|
@ -178,7 +178,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))))
|
||||
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue