From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MBvGIFHGwGGPsAAAgWs5BA (envelope-from ) for ; Mon, 20 Dec 2021 19:07:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iMOIHFHGwGFUVwAAB5/wlQ (envelope-from ) for ; Mon, 20 Dec 2021 18:07:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 341AB1369C for ; Mon, 20 Dec 2021 19:07:13 +0100 (CET) Received: from localhost ([::1]:43516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzN44-0006xN-Ap for larch@yhetil.org; Mon, 20 Dec 2021 13:07:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKkF-0004nQ-9V for emacs-orgmode@gnu.org; Mon, 20 Dec 2021 10:38:38 -0500 Received: from [2607:f8b0:4864:20::536] (port=43595 helo=mail-pg1-x536.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzKkA-0007F3-CN for emacs-orgmode@gnu.org; Mon, 20 Dec 2021 10:38:32 -0500 Received: by mail-pg1-x536.google.com with SMTP id 8so2153269pgc.10 for ; Mon, 20 Dec 2021 07:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=cJ0z08lS/zfkchsvB/zaj+wLJvxEGqJjVwyjWlkkL+U=; b=cZnE2lHkq+s5akFrHT+yZxN4SfLcL8ShpGspg0185HkwI1E4r9Yr6MiuKlzLelOzed TXM+31SZ6c2jK533CTWRJWZLvFa5/QTy3S2Vybkndqiha+0k723qqwsUc+NO25KdEobK qMugzHVq9tQSjD6BZ+0S/PKQCeKAQoflCwXtFsHMqk6XLpt4NezVuD3ZFMtywgHzZ1KZ Db9cX4/zhWkGzpM5tM8iInMm4aUga4A5g74P1GAwHkPIAGVycD5netXpzpCTlqSOoRja mZ60MTRuWa/oIlK9/Wz2Kkz3kLZkKu0sRpOSmVdA79EVFSZW2l1T+HQcDRjWEMD4O303 Ailw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=cJ0z08lS/zfkchsvB/zaj+wLJvxEGqJjVwyjWlkkL+U=; b=JZJJprvsZEaR9vL/g+9i2XpAjGJSQg8j3P19SZ/2YYUHAr+9xn2TfkZSwY2mUQj2C8 ghEv6BvQcXU81vDka70DAbQMJEHmNnA2gMbXtMtv4E3zzXMvzFf0czCtjuSLCKVr5JjP F+YP9d3vSElCP+TfdhdXeHOKtWeMyKmfgAbZnOgtVY8dWIlwTVWk+yd8PpkMhvjWs68i uQf7uVOyLSdMzIYJjYXnvbo9GPhMJqGQ/ctKSEERxcvvNvGvzuIsx55yR/kvpMHqIXkr jhZOQPWZMU5DyFYtIuj+fbR11QVBorNosAuxDWlTPBCaQdq7lTzpB/An8bW/TgKervxC PfwQ== X-Gm-Message-State: AOAM532Uu5YbpDU7jAp+J8piZNaYaTrNrZfNdeWqb3xcgLUpEjiETbds eZPJ0GqkQTiNxuBZJ8Hs4KfvisgshQES0tic1sM= X-Google-Smtp-Source: ABdhPJxpSmbXzIble8RVAhcXumVtx041W/Ba11rvtOdrcj1uhk7ySy+UI94Uw7bVwq3ogrKmMlJpbg== X-Received: by 2002:a63:91c2:: with SMTP id l185mr14994646pge.395.1640010490416; Mon, 20 Dec 2021 06:28:10 -0800 (PST) Received: from localhost ([210.3.160.226]) by smtp.gmail.com with ESMTPSA id qe12sm20458830pjb.29.2021.12.20.06.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 06:28:09 -0800 (PST) From: Ihor Radchenko To: erimius@web.de Subject: [PATCH] Re: Bug: org-deadline drops warning periods from TIME [9.4.6 (9.4.6-10-gee652a-elpaplus @ /home/fap/.emacs.d/elpa/org-plus-contrib-20210712/)] In-Reply-To: <83b84e24-bf18-8b2c-0e8e-84abbd2915c8@web.de> References: <83b84e24-bf18-8b2c-0e8e-84abbd2915c8@web.de> Date: Mon, 20 Dec 2021 22:29:33 +0800 Message-ID: <87o85bl582.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::536 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=yantar92@gmail.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640023633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cJ0z08lS/zfkchsvB/zaj+wLJvxEGqJjVwyjWlkkL+U=; b=mY3mnJHHxkBq9XmTiEciRwzX/QA5V1YcMjl7d1xccX+nhKfySFVpaaNrmrQcWe4URHpPm/ BrOVux/1KSB/VbjVfUL+hb83I4NNH+lgJDoN3SrHLnUeZlBLrt7rzU2IopLQ64YO3yeDCb GWbBh1kjXa0oRApJ3s7z4ZLVF8KuRVwvy28tOqWgxeiqThHY//JR6I1qoy6gh+yR40R97B UspCC/nHa0ueAq/I6oD2pEZRh94Pb6CpOf+1ZFTgBwlyqk64bihoo0JXoxa4Br2U64SnlC OIGTuYDVEdKdNzTQF8Ffh9mjzTlZkXMBIxNpD+PEoquOzcawBNlDQgzCj1QZWA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640023633; a=rsa-sha256; cv=none; b=gkqhptI2p+n1OApP5mZKY8YHyiqijLII84GygVmPbNs50LlNW0Il4ZEtbnzN4J64izkOMO gU71M0N+ye7rzxJ/lUhe6GuUhfQMZWuVVYWaJcSqeZ3RluH5BZuLprkFulVvoOUcIb8QAS qasr7NPAFVuB/Bk0+989k4WNUNI+J5WtGM9prCQ0fazXaCWkWVgHdqXfObrAeauDpCmejD QQbPSUekF4gUL1cubcojf3znIbKwt2fJyvaq1bUc7BdAGIpo106Z84DttvaJjORkMTHexI NebhlhAVnrKjqvyPconGD975hD4vYo2eyeyyurwPGvtT/7qZZ0yrJv6hek+gew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cZnE2lHk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.22 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=cZnE2lHk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 341AB1369C X-Spam-Score: -4.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0UI1l2WdUzI/ --=-=-= Content-Type: text/plain erimius@web.de writes: > * Reproduction > > Call ~org-deadline~ with a warning period like so: > > > (org-deadline nil "<2021-07-20 Tue -1d>") > ;; => DEADLINE: <2021-07-20 Tue> > > * Expected > > Deadline gets added with the warning period provided. Can you try the attached patch? Also, note that warning period is still not supported when reading deadline interactively. Not sure if we need it though. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-deadline-or-schedule-Allow-warning-period-in-TIM.patch >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 --=-=-=--