From 5ea33ca79c1c9fa60e960fcc4508fbfc5358b95f Mon Sep 17 00:00:00 2001 Message-Id: <5ea33ca79c1c9fa60e960fcc4508fbfc5358b95f.1640010497.git.yantar92@gmail.com> From: Ihor Radchenko Date: Mon, 20 Dec 2021 22:26:56 +0800 Subject: [PATCH] org--deadline-or-schedule: Allow warning period in TIME argument * lisp/org.el (org--deadline-or-schedule): Match warning period if provided in TIME arg. Fixes https://orgmode.org/list/83b84e24-bf18-8b2c-0e8e-84abbd2915c8@web.de --- lisp/org.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index ce4e08eab..29e1d4d0e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10652,7 +10652,13 @@ (defun org--deadline-or-schedule (arg type time) ;; We use `org-repeat-re' because we need ;; to tell the difference between a real ;; repeater and a time delta, e.g. "+2d". - (string-match org-repeat-re time) + (or (string-match org-repeat-re time) + ;; `org-repeat-re' is not sufficient + ;; to match warning periods. + (and (string-match-p org-ts-regexp-both time) + (string-match "\\([.+-]+[0-9]+[hdwmy]\ +\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\)" + time))) (match-string 1 time)) (and (org-string-nw-p old-date) (string-match "\\([.+-]+[0-9]+[hdwmy]\ -- 2.32.0