org-read-date: Do not consider `org-extend-today-until' with default time

* lisp/org.el (org-read-date): When DEFAULT-TIME time provided, prefer
it even when `org-extend-today-until' dictates -1 day shift.  We
should only consider `org-extend-today-until' for actual today times,
not for future dates, where is becomes confusing.

Reported-by: Tim Ruffing <crypto@timruffing.de>
Link: https://orgmode.org/list/3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de
This commit is contained in:
Ihor Radchenko 2023-01-22 14:37:47 +03:00
parent 6ab611720d
commit d6e75d0eeb
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 1 deletions

View File

@ -13714,7 +13714,11 @@ user."
(calendar-view-holidays-initially-flag nil) (calendar-view-holidays-initially-flag nil)
ans (org-ans0 "") org-ans1 org-ans2 final cal-frame) ans (org-ans0 "") org-ans1 org-ans2 final cal-frame)
;; Rationalize `org-def' and `org-defdecode', if required. ;; Rationalize `org-def' and `org-defdecode', if required.
(when (< (nth 2 org-defdecode) org-extend-today-until) ;; Only consider `org-extend-today-until' when explicit reference
;; time is not given.
(when (and (not default-time)
(not org-overriding-default-time)
(< (nth 2 org-defdecode) org-extend-today-until))
(setf (nth 2 org-defdecode) -1) (setf (nth 2 org-defdecode) -1)
(setf (nth 1 org-defdecode) 59) (setf (nth 1 org-defdecode) 59)
(setq org-def (org-encode-time org-defdecode)) (setq org-def (org-encode-time org-defdecode))