From d6e75d0eeb572a6bf55d72b29c466c2534c795f8 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 22 Jan 2023 14:37:47 +0300 Subject: [PATCH] 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 Link: https://orgmode.org/list/3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de --- lisp/org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 4e276bd13..b27dc1b18 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13714,7 +13714,11 @@ user." (calendar-view-holidays-initially-flag nil) ans (org-ans0 "") org-ans1 org-ans2 final cal-frame) ;; 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 1 org-defdecode) 59) (setq org-def (org-encode-time org-defdecode))