From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id yJX2Mv/KDWboAwEAqHPOHw:P1 (envelope-from ) for ; Wed, 03 Apr 2024 23:32:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id yJX2Mv/KDWboAwEAqHPOHw (envelope-from ) for ; Wed, 03 Apr 2024 23:32:47 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=rioApvJm; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.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" ARC-Seal: i=2; s=key1; d=yhetil.org; t=1712179967; a=rsa-sha256; cv=pass; b=MEALkFMj+QkqduaVlshVIxoA5cyy4ah+VhdkFGTxK7rGj6E3ZQxyCeH08WK+jVewlf8JrQ vu7K5Gq6gY5DvNoJ8thJzo/yOKxi3+7M0DGbP1QmBIxRWWz4GvEqkEfoTK84R3U1r/sclQ wAaYPhvefVvbRmyHIPuuo4SAKDT0EPUIRuPdZAaD2STpbmyBwUvmcDdfTKqiGvox1oRd7x b3w7EjaM3GB85osrk7ZR+MNtFNu2Qo/JfNUztQj/YW02tnbnUVSv/CCt9B4vq1YXa4eiOJ 3rheywHsx0pcvcsAZSndv8tj5jhDQI0ZkNDwXEX88nGQqdxIr9WQ34DjPQNXIQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=rioApvJm; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.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" ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712179967; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=wvFAU9eJWnPrz6nfqZoM7uW56xfXt+u7I1Hfl8XDRCk=; b=fWqu3Sa/kUyoqI+8LuObgsdeA5HR0BC9cAfZguOSEp5+muwjPoKwmIdJPZzFKmw0Yq5X83 OKltCy7zEGr7nKuYHsu7xpJZsfRoR6kN36VExxCO8uuVgHZalnqZySDKjLdKOc7BHUh0pu ezvIEVnvYvmGHR8fBKOwLMmiRub5F1ciiJYniIJ1mbfGHdhsNynV6Z47J+Spmh4LFkmrii FExiMPzgPY2nNY7Klp4GhwJC8WrHBDvqHIZdhhJiqm18WcvdUCYCGoOxb5ap37O0UEK/HR ddT+iET7O2Njvvj4VKJqbFF+G+KJ8XGRUrFh/ne0MDuTIVBgS6O2mqT5V1QnIA== 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 43F7377B20 for ; Wed, 3 Apr 2024 23:32:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rs8DC-0006Bl-46; Wed, 03 Apr 2024 17:32:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs8D9-0006BH-Tt for emacs-orgmode@gnu.org; Wed, 03 Apr 2024 17:32:00 -0400 Received: from mail-co1nam11olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2c16::801] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs8D7-0007Kb-Dg for emacs-orgmode@gnu.org; Wed, 03 Apr 2024 17:31:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAHloCxjl7Z9t0+JHZW8TavqChvkSiFBKLRsPn/9GTQ8BbYVNA2m5JU6r68+FS75CcB8H2ajPZX7ybckxpS1XokwNZzDkaYWN4WXukECpN7k3Zo2nHoDhgfWDjPnSJtzvX6mRmm0+XgLo5DR9jla4Hs0FzUZpQssAF2Q8MyhpRbvaHqJ93MIe7ELJjpcg47wk2xeH71IVil1cEwg7q9/AXeQb5KQbmv+zc8Aoravu4jJ37r1pA89zR/b21bZAhDCppSDoyGd3gDkLIavPA0QTHCKE9AfD+ee4aoqYujpEpdA1ft4ulbbm1hzjyp0d4gZG54rrYnQaca/w40yyQHrCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wvFAU9eJWnPrz6nfqZoM7uW56xfXt+u7I1Hfl8XDRCk=; b=WyXkCHdGb5HGpMOuP25bZ4aVWDyIpZ7K42vhcCQca0glsaJ98job8+BVn3tSh/2t4bQRzrO3dSuiURes8Jaqba2GZDTq+6Ki3lwer1Oah4oxEY1+FdJL6Ud38VzMr/m7WZCpWo3TtM00GyfGcRA7T3/JTkbJoPNin8UhJwqXr3VmpKizrQG7I1UuVdFCP3/6dtmlImouxAKg/QNQXaw0UrhWzdSoh/Pxs8WGwvYe0oe2ik8a1AKkeo9xko9jvvjanBpCMerBLveUze86BYqD/aoIucJD9qIewPB4xY4ifdmXQfB/W+OWKA9h7xgjFUt7RZoFr4Q8CiHUYLmm7m1sdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wvFAU9eJWnPrz6nfqZoM7uW56xfXt+u7I1Hfl8XDRCk=; b=rioApvJmQStjbW38Wu4CF4L+c0kYrYWuPl10mdu66ezZCQnSV8R2WCb7+cM9V5C8tDA/gxp8vE1YdtVuPu4vgsM/eRFoQEqGs9Hs8vwPpNcKNVVdAu/JkyKTea0teQoGp/WuyfD36318Bk3X2bPn8Q9Wkt95RqdaNCIMBfTexJlGeFKlNJrM5ZbqJA/wfZGuT7P3yGdW5fagmN8QB97bpPJiqIk+7GHT+t9o2lyBu1LW1igKYdEybOCSwoR4yJmUZPdyLenABeToa811rPJRNdVjgsQFk3VU0cgkZ2pn+yV/pyvLslA3NeyGEb5E/BoKSduruwPF9Oj4BUse/t2etw== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by SJ2PR84MB3783.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:a03:590::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.25; Wed, 3 Apr 2024 21:26:52 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45%6]) with mapi id 15.20.7452.019; Wed, 3 Apr 2024 21:26:52 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Cc: Morgan Smith Subject: [PATCH] lisp/org-element.el: Add repeater-deadline support to org-element Date: Wed, 3 Apr 2024 17:21:02 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [mOabE3XQVdsU5MAsGshsQTOfAWlpFTtK] X-ClientProxiedBy: YQBPR0101CA0164.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:f::7) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20240403212100.34756-3-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|SJ2PR84MB3783:EE_ X-MS-Office365-Filtering-Correlation-Id: d9cf829c-6cac-4bf2-69ee-08dc5424c73c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6g4fRkFABvxlyIL4OB8GMmlRzh2ZqVR6qPDyD77EdnMWngswDbJGvy2zAoOCLduwuwokO+2rzxICgWLz1lV0i4aGkJZCP4lhexfwERVoAIInPTkcB2EMWXqNBRaq1mhqXwVA/al7asCm0/Hytkl7AR+EDvEfD9Ml+IicOp3ppZx0PM1rDYjMYYOC3/Ro8dQxe6GQq+6sYohPBqA7zO5h06F/sNhpUjMbahCnyJZUQU5zZKudACYQzXYF42oxxd38EJZz/egozAshQQjCDgAJkTL13KwYwpVD/c6/NNilKwNdkBT9sdwR9vyObevM9m/IiU+dG8sbvG4fXsCUQfItCZie12YCbJbVzbDpM3gytMzhcaKWV4otMsJrrMVW2n5IJ931aENNXwcRz2RbKeLmez2yZ6zqOHWo3F6nM3SpZZmLvYTZm0OfdEfN/9UQJxjW934u5aQY3rvXNbw4oYI0mZ0Pz67zcMNyoHf1GtuwsKRsEXMR7eiAkhQmRsk/4cUtFj+Bq1JrbvQsADqC6LKVLGrcrmt+NlGcmmphx7jFQP4D5VBgDXYidKCQWC8ghEZzBpDMjI8Dm9BP2Ju6mlE1kULa5XzYe6k2pUMGzF7TSXv2BSF2/hzkG5JEp4BtT9Vc X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DSu8mNujwploptV5JHNvLkqAQuV9KBAOct7/p8CTjWjMCYLhlFF57MVg5OxD?= =?us-ascii?Q?bOaYwXXf/lC0LxmnpILfTJ0Gkmub+2NXBYxeIoT/rRreZMDU23+B02+eiWgg?= =?us-ascii?Q?UsMeUR1YvmVc2+LUUqMdJZXzryJPg2gxjYMAqlhq0N2CraZGQMJ2eBpbcC03?= =?us-ascii?Q?qUAhZxwiC6l7VILEYVOYYDtno1G6o5mj1yWnWwIg6luMICLy7KT25UE+Iz4a?= =?us-ascii?Q?+J4jApAvVoxmdQsEh+2uPNXTZ25mM+5TOyD4PaHehBADv1r57v9e0h8BDcAU?= =?us-ascii?Q?lCp7DkUHD9gfM6beK6PGC0afvEZ91hWct00gCHJ/TuWLMtW8k6HFYqpaCAOy?= =?us-ascii?Q?FhmYAi4U4b7oxHtt6dZr6zHpE10K8fs2VzsTp2sTrbZ0NSCjQWg9QDCIgiO9?= =?us-ascii?Q?uYBR/0c1c2eBEQ9ia6hMdFIxw+b9ZhmV37sJn1ql52i1tRcK//1VGusQx0fC?= =?us-ascii?Q?tb9jfwpCVrEaohe/jEwjh2EpA1mBsIU1geAQmUK8ePMQAeTeNLgWhs4hvyzh?= =?us-ascii?Q?Bi5M3/bdKwP07IxwaG5KN/b8EDurTLV0824gXEwogwbug6+yRkjYAe3IHxz0?= =?us-ascii?Q?FLq20XRyfzh+AJw4t6hc/wiRYzuRHqGjTvB3m2Y2HUZ4+iWH/Jai+RdwdRJo?= =?us-ascii?Q?AmVHfEjXxMUHEqPhj0EDKYXi39M/x5lPtaiYK3vlzH0qOGJW2HEIxEoQCGnv?= =?us-ascii?Q?N74la4EIwZF74KHir9X0EWGKKTk317kKhRRycRaJop93ydMIWOlrBZM631nZ?= =?us-ascii?Q?rtMS3il/0z2FMl9cPsna38AFBib726JpSe7xKSe7NT3OwO6TuVHfubsv3KfW?= =?us-ascii?Q?yxkFXIm5wwJClwzdgr0MRSOe+cwtU+51fwoLPhTmbKMofx91Oh+UXHQmHEpf?= =?us-ascii?Q?4oLA76RLVEZ9lKRoaKqouFAT6GyTGE80Yf5v/7uWkJvPU8igOKppXVzLKtmX?= =?us-ascii?Q?I0Tsjllw/GMHqnDPivRN81uWOiFexcHwqm+2qIfSwkYUxjt/kwGQ1OUq4Wtz?= =?us-ascii?Q?B8/tHhouYtJrjRlMvDh0im/kIlOcH9fESUqhqCORJBf1e9WQBMeHb7mK+FYs?= =?us-ascii?Q?+ykMeR96kgUbkad/q9vCiwAptiRsFCHTlTewzhTUoIo/rfQIpqlx7jTtFw07?= =?us-ascii?Q?AD7kqZavtm3O65qfDSazt6rtvCiNcbcyq7YDr3K3PwQx9PkAeJwQqT+PnNwy?= =?us-ascii?Q?h8UDtSJG+5oq1SrVBp0fpkfSYOSuACvMgW1vP0m9W/nVPTvWlKmrGLJCrvvB?= =?us-ascii?Q?w0qWZyyI7XwfRCG9sNG8?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9cf829c-6cac-4bf2-69ee-08dc5424c73c X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 21:26:51.9917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR84MB3783 Received-SPF: pass client-ip=2a01:111:f403:2c16::801; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -9.18 X-Migadu-Queue-Id: 43F7377B20 X-Migadu-Spam-Score: -9.18 X-Migadu-Scanner: mx10.migadu.com X-TUID: yEoz0vv8vxxw * lisp/org-element.el (org-element-timestamp-parser, org-element-timestamp-interpreter): Add support for repeater deadlines. Adds two new properties: ':repeater-deadline-value' and ':repeater-deadline-unit'. * testing/lisp/test-org-element.el (test-org-element/timestamp-parser, test-org-element/timestamp-interpreter): Test support for repeater deadlines. --- Hello! I would like to add some features to org-habit (something I have tried unsuccessfully in the past). Before I do that, I would like to switch org-habit over to the org-element api. Before I do that, I would like to extend org-element to support the org-habit syntax. Let me know what you think! All the tests pass on my machine. Thanks, Morgan lisp/org-element.el | 58 +++++++++++++++++++++----------- testing/lisp/test-org-element.el | 38 +++++++++++++++++++-- 2 files changed, 74 insertions(+), 22 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index f4eec1695..8d3b8ce44 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -4288,12 +4288,13 @@ Assume point is at the target." "Parse time stamp at point, if any. When at a time stamp, return a new syntax node of `timestamp' type -containing `:type', `:range-type', `:raw-value', `:year-start', `:month-start', -`:day-start', `:hour-start', `:minute-start', `:year-end', -`:month-end', `:day-end', `:hour-end', `:minute-end', +containing `:type', `:range-type', `:raw-value', `:year-start', +`:month-start', `:day-start', `:hour-start', `:minute-start', +`:year-end', `:month-end', `:day-end', `:hour-end', `:minute-end', `:repeater-type', `:repeater-value', `:repeater-unit', -`:warning-type', `:warning-value', `:warning-unit', `:begin', `:end' -and `:post-blank' properties. Otherwise, return nil. +`:repeater-deadline-value', `:repeater-deadline-unit', `:warning-type', +`:warning-value', `:warning-unit', `:begin', `:end' and `:post-blank' +properties. Otherwise, return nil. Assume point is at the beginning of the timestamp." (when (looking-at-p org-element--timestamp-regexp) @@ -4326,20 +4327,28 @@ Assume point is at the beginning of the timestamp." (date-end 'daterange) (time-range 'timerange) (t nil))) - (repeater-props - (and (not diaryp) - (string-match "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)" - raw-value) - (list - :repeater-type - (let ((type (match-string 1 raw-value))) - (cond ((equal "++" type) 'catch-up) - ((equal ".+" type) 'restart) - (t 'cumulate))) - :repeater-value (string-to-number (match-string 2 raw-value)) - :repeater-unit - (pcase (string-to-char (match-string 3 raw-value)) - (?h 'hour) (?d 'day) (?w 'week) (?m 'month) (_ 'year))))) + (repeater-props + (and (not diaryp) + (string-match + "\\([.+]?\\+\\)\\([0-9]+\\)\\([hdwmy]\\)/?\\([0-9]+\\)?\\([hdwmy]\\)?" + raw-value) + (nconc + (list + :repeater-type + (let ((type (match-string 1 raw-value))) + (cond ((equal "++" type) 'catch-up) + ((equal ".+" type) 'restart) + (t 'cumulate))) + :repeater-value (string-to-number (match-string 2 raw-value)) + :repeater-unit + (pcase (string-to-char (match-string 3 raw-value)) + (?h 'hour) (?d 'day) (?w 'week) (?m 'month) (_ 'year))) + (when (and (match-string 4 raw-value) (match-string 5 raw-value)) + (list + :repeater-deadline-value (string-to-number (match-string 4 raw-value)) + :repeater-deadline-unit + (pcase (string-to-char (match-string 5 raw-value)) + (?h 'hour) (?d 'day) (?w 'week) (?m 'month) (_ 'year))))))) (warning-props (and (not diaryp) (string-match "\\(-\\)?-\\([0-9]+\\)\\([hdwmy]\\)" raw-value) @@ -4407,7 +4416,16 @@ Assume point is at the beginning of the timestamp." (let ((val (org-element-property :repeater-value timestamp))) (and val (number-to-string val))) (pcase (org-element-property :repeater-unit timestamp) - (`hour "h") (`day "d") (`week "w") (`month "m") (`year "y")))) + (`hour "h") (`day "d") (`week "w") (`month "m") (`year "y")) + (let ((deadline-value (org-element-property :repeater-deadline-value timestamp)) + (deadline-unit (org-element-property :repeater-deadline-unit timestamp))) + (if (and deadline-value deadline-unit) + (concat + "/" + (number-to-string deadline-value) + (pcase deadline-unit + (`hour "h") (`day "d") (`week "w") (`month "m") (`year "y"))) + "")))) (range-type (org-element-property :range-type timestamp)) (warning-string (concat diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index c49dc80d1..ddd601690 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3208,11 +3208,18 @@ Outside list" (let ((timestamp (org-element-context))) (or (org-element-property :hour-end timestamp) (org-element-property :minute-end timestamp))))) - ;; With repeater, warning delay and both. + ;; With repeater, repeater deadline, warning delay and combinations. (should (eq 'catch-up (org-test-with-temp-text "<2012-03-29 Thu ++1y>" (org-element-property :repeater-type (org-element-context))))) + (should + (equal '(catch-up 2 year) + (org-test-with-temp-text "<2012-03-29 Thu ++1y/2y>" + (let ((ts (org-element-context))) + (list (org-element-property :repeater-type ts) + (org-element-property :repeater-deadline-value ts) + (org-element-property :repeater-deadline-unit ts)))))) (should (eq 'first (org-test-with-temp-text "<2012-03-29 Thu --1y>" @@ -3223,6 +3230,14 @@ Outside list" (let ((ts (org-element-context))) (list (org-element-property :repeater-type ts) (org-element-property :warning-type ts)))))) + (should + (equal '(cumulate all 2 year) + (org-test-with-temp-text "<2012-03-29 Thu +1y/2y -1y>" + (let ((ts (org-element-context))) + (list (org-element-property :repeater-type ts) + (org-element-property :warning-type ts) + (org-element-property :repeater-deadline-value ts) + (org-element-property :repeater-deadline-unit ts)))))) ;; :range-type property (should (eq @@ -3963,7 +3978,7 @@ DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu ;; Diary. (should (equal (org-test-parse-and-interpret "<%%diary-float t 4 2>") "<%%diary-float t 4 2>\n")) - ;; Timestamp with repeater interval, with delay, with both. + ;; Timestamp with repeater interval, repeater deadline, with delay, with combinations. (should (string-match "<2012-03-29 .* \\+1y>" (org-test-parse-and-interpret "<2012-03-29 thu. +1y>"))) @@ -3975,6 +3990,15 @@ DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu (:type active :year-start 2012 :month-start 3 :day-start 29 :repeater-type cumulate :repeater-value 1 :repeater-unit year)) nil))) + (should + (string-match + "<2012-03-29 .* \\+1y/2y>" + (org-element-timestamp-interpreter + '(timestamp + (:type active :year-start 2012 :month-start 3 :day-start 29 + :repeater-type cumulate :repeater-value 1 :repeater-unit year + :repeater-deadline-value 2 :repeater-deadline-unit year)) + nil))) (should (string-match "<2012-03-29 .* -1y>" @@ -3992,6 +4016,16 @@ DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu :warning-type all :warning-value 1 :warning-unit year :repeater-type cumulate :repeater-value 1 :repeater-unit year)) nil))) + (should + (string-match + "<2012-03-29 .* \\+1y/2y -1y>" + (org-element-timestamp-interpreter + '(timestamp + (:type active :year-start 2012 :month-start 3 :day-start 29 + :warning-type all :warning-value 1 :warning-unit year + :repeater-type cumulate :repeater-value 1 :repeater-unit year + :repeater-deadline-value 2 :repeater-deadline-unit year)) + nil))) ;; Timestamp range with repeater interval (should (string-match "<2012-03-29 .* \\+1y>--<2012-03-30 .* \\+1y>" -- 2.41.0