Fix: (org-ql--normalize-from-to-on) Tolerate "-" input

Avoids errors while typing a query (e.g. a negative number) into
org-ql-find, which interrupts completion altogether.
This commit is contained in:
Adam Porter 2023-09-06 20:50:39 -05:00
parent 3622b92403
commit f65b1d91a4
2 changed files with 8 additions and 1 deletions

View file

@ -1286,6 +1286,9 @@ result form."
to on))
(when from
(setq from (pcase from
("-"
;; Ignore, because it means the user is typing a negative number.
nil)
((or 'today "today") (->> (ts-now)
(ts-apply :hour 0 :minute 0 :second 0)))
((pred numberp) (->> (ts-now)
@ -1302,6 +1305,9 @@ result form."
((pred ts-p) from))))
(when to
(setq to (pcase to
("-"
;; Ignore, because it means the user is typing a negative number.
nil)
((or 'today "today") (->> (ts-now)
(ts-apply :hour 23 :minute 59 :second 59)))
((pred numberp) (->> (ts-now)