From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aKVPOYkic2Yd2QAAe85BDQ:P1 (envelope-from ) for ; Wed, 19 Jun 2024 18:25:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id aKVPOYkic2Yd2QAAe85BDQ (envelope-from ) for ; Wed, 19 Jun 2024 20:25:14 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=LxRpR8G1; 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"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718821513; 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=jdsUGl2Vz1Rf8pr7uFeAe8RTADeYd6HYqZoffQD0BsU=; b=qtIh8hIc3SzOhxqz+ly79SccYS8uMdBp03ykMgAJdL00cwDsgRv2k6Iv6IY87n5nIhLCfM S3Acs9x7yqeH/LQxHXycvLepjpjJR1eGL3qefQMcay+ZS+x6ayielAM4D7O6fFZMUZGslJ aA1bcoNgerISXbPskhhIhiDXKfF5WhmSmWYH1Mvhn7f2DJ3i87Sj0cGszx51kmWKzwT35g HN87pnEAlgw/6cOEogv1OqZ0ULtSpsRaLUvOqlqxItmdv8k1xWKy2ZcYBpWkLAJwIQCJMv qr6bB8b+xMYuu44P4qmBWRHiJkX3Fyg1E/U+XoC5AuxQEO6xVsH5b+jzqkJzXQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=LxRpR8G1; 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"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1718821513; a=rsa-sha256; cv=pass; b=s5g3tDwnYMSWGSwl1wtvVpDov1hK2k17bVjzbzWoLvjxULWS6DlJaUSOUfzeV0fIry8Rf8 ume7R3YZdwqEB1Vai0P0lOQS3Xb++Hk6+CL2bnzhbrSh3o0ZYAkkEbJYwmFxbZcOvcX0dM jZG7kD1Bhd5u3J0h/k48qDOX2o3ttW5JEdnY8KoaCxcbEhp2VWTuLvlsKOIn8QqbfXRTFi KMl5Fei9Udp4iZg3jrF80yf5uKQWELkt4Ap2rUbleiBCKUmf3/9+1uL5I2ANkVpwUeIYBR /qvjX31xJ3nP8QCRdmipbIF687enscgCmrnI8ZC7cxJdmjOwA8vSBtLvjyvPeg== 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 6C69716F8B for ; Wed, 19 Jun 2024 20:25:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJzyw-0006Ss-UE; Wed, 19 Jun 2024 14:24:30 -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 1sJzys-0006SI-DI for emacs-orgmode@gnu.org; Wed, 19 Jun 2024 14:24:27 -0400 Received: from mail-mw2nam10olkn2080f.outbound.protection.outlook.com ([2a01:111:f403:2c12::80f] helo=NAM10-MW2-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 1sJzyo-0005a5-Q5 for emacs-orgmode@gnu.org; Wed, 19 Jun 2024 14:24:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FTIwYm9T8ivxF6iiIuSmlNjNPTHcBpvRbAaYuN2ipevtPlhkfHMa6JoLxM8um1LucgjlGQ2TWvinVXvBxwmbMNjSBce3Jt9c7KuTm6YVfiFlxDXyc+uC54Q84dsRAFuA0UTlB9LxngAEnJ0bURlRBLgK6/FgTrJ36Q1qdu7y5nCT3J+QzqVrXJ3kqkFj3w/AsV/FgTuif/kUzyd5vbCokqHssWlFO2mmMWT9f8TeprilB/tNkyC7/vjE4TELmGVBOxR0HnsQ6Udl2IhxFZZsffq+cuRIT5Kv2UTpQOzBEUK1eG8CVbWQSF98WfmZ/jc4aiPIMRd5mJSCKuX/E91Lsg== 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=jdsUGl2Vz1Rf8pr7uFeAe8RTADeYd6HYqZoffQD0BsU=; b=FoUTtmbYg0h15g9mqRG7za+CVelkMmjp7NoJpmqNeFGoZGtbc2VkTva+u/BbT2cgUWhYruOUuDGmgStQXkokKwl0BfbuVZudXQr+XmkfEURd1qAgw8sI1+3ZI2fG1x0+PLkBOSxEV80gB0/C4sqqgXBYCV99GcMOBNOa2e+jF5ZSAm9MMK6B3T0wzD5e/VyV8iSLMWrBs1ku4/7mOZZr1Kr+lR5u8jpUkwUYFq9mAYjczDWN7/MNFCPMy50IaMEhRNmYcbXSWRN1RgTsmWdIgZayH0LaePSIgxQliwZyFywnkix9M5GnAPk6iVWzn1suuYc+ef51PJFEOf87jV3+VQ== 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=jdsUGl2Vz1Rf8pr7uFeAe8RTADeYd6HYqZoffQD0BsU=; b=LxRpR8G1MjXw9SRaQuz5tHOjolaxryicTpIzQRH7X2lBVIfw3+5o5w//z2+4/kAKayp0kOG5f0KBQz8PDN4bT1unkxR6EOT3D1fMJoHRkCj4fDuiUWl+i4ce5I8HeZxbPA46A2TM0+ycZVAXMooXsWAgTfyvvgSYNDpRW5S5A0GuMPnJgpXWJraVBduC87fGrFHZUN0tsmGYZXhK3YXv7OZMJUnuOcH2akk/ZzG8dtyNTCfhyz82QyCHkLnAOwr+EnS6LmVwN9MCbZNOR9HIB+kzoagG+aAw3WiV2zN7Y9AkDvgQctPRo40Z49a1QNGbsE6IHKDcEioabjEelu/hBQ== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by SJ0PR84MB2230.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:a03:438::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 18:24:13 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%3]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 18:24:13 +0000 From: Morgan Smith To: Ihor Radchenko Cc: emacs-orgmode@gnu.org, Sanel Zukan Subject: Re: [PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx In-Reply-To: <87bk3x9bpv.fsf@localhost> (Ihor Radchenko's message of "Wed, 19 Jun 2024 15:46:52 +0000") References: <87r0f9b9n2.fsf@localhost> <87frvpyzrf.fsf@localhost> <875xu6aee8.fsf@localhost> <87bk3x9bpv.fsf@localhost> X-Hashcash: 1:20:240619:emacs-orgmode@gnu.org::cKNt67lPOi5MwSMs:0UQm X-Hashcash: 1:20:240619:yantar92@posteo.net::9+oLvoWaQBBmqpT9:7U97 X-Hashcash: 1:20:240619:sanelz@gmail.com::Bk0ozAQi07DbNdwf:8uwI Date: Wed, 19 Jun 2024 14:24:08 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TMN: [d4gMwO0M7r2TK7fXF2/jmQz2lolpv+lI] X-ClientProxiedBy: YQBPR0101CA0214.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:67::20) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <87a5jgvliv.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|SJ0PR84MB2230:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f486a2e-020c-4300-ffaf-08dc908d0529 X-MS-Exchange-SLBlob-MailProps: AlkLxVwsndmW5W0oIq6iXGuZj3IFwUhCO/TJL6SPiyJv7PPzVQedd8qq4YtT3UA1pMo/YNt3F4KV5xML0ucSAS7vrgR0N72NgW5YAEABrN/vDf7EJ/+hewGV5v2e3kzmENhf5junm1qLVmD3nkkTK+gy6icr07LJ5sXVA1bDZeGmP9wwn4b9RJk2DPthbu7lxjsOkq2GJiG38tfp8TpVoHcX9TrUseaiEvoQLcSYnxAKPV2jmPCeIAi4fmIPWULSW9NGV1gNi3335+9sozwOnzvEbGe9nPlQfZUGxV4555P8BJQtQBGCqRSpgTAv0r8AjOiJg0SQHnE80qPdy+Nh5uD13pLEImZZ81gfsQxqUu5PTvi/MOrsmS+u5irN9mRltnlwD3rfJ8pOeEejMnqm8KF1MUFfJF8dBgMZbO5i79GtQMtUct9hXhCI1X8GqYbHG4LO3Xp8Mec2AT3nFYfeeSMKNDDLyWb+1ZWCyNY0FpB42TB41qWdIcJZkai7cLnst9yzrKUWPLasWyOnz3MSW7wdYElbzLDKwXZMGkTKZvL68oPDjDSeKNiaTKGzXE7DvdLAI2/rS8M3yzvXAJcLLMr1CrKFWqvIcbfcra91zFlhGDLmp3Afic08lyboaoRXzgnGa254n6QHdu1HHMyAM5kNVs5l2VHpLKlhGWj3QfLeQ/4oCLgIAIjPW00A0By5M8RAjkeKSllXGHhrGqq9zbmhhdiHNQ45QJV38wEuxYxUssl2Z+KKqynvtwxepGfwhi8emK4azLHRtGqZPMMhFiSRc+WmOjO3 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199025|56899030|440099025|3412199022; X-Microsoft-Antispam-Message-Info: FtsfvIzgaKokOTJ/hJFQYEqNZrNggBoD4YMF8Pv1yHJA3U2VJBtTnMJhy/LMF9pTRG2wm2KlHz3/1nU1Eh943QlX1ZNP9FGztAjV7UKKHL47i2cXqP2TfjL6z8y9QGblRad0y10M58bYTlwxKWB1e91hOpzBwx7rstP//JjWh+z4bAGncKKx1sRvN3qI8fM+5Gh0/cS/TUka3zPp/IEq8vHK/RJVH7vcE5Mznbx4il9ubwj1KIGWPkS8WqdxdH3sAA/DO3x2h0BkeNv35E5/bwTNILkNnXrw4WSGGVHGjExRM5x4VYfzGpv/2JNgH6imCgnMq59+sVru1/sIFMIPmTsbqVV7SLA79KniMhhrdUOvftDRR1zOgLG0LthYs1SF9UZocNVM1ScOd3UFoW3Aj4KaPhX5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iep0N0?= =?us-ascii?Q?v/qaPDFTcgiSUPP1o5ySJvhhcPPzMOGhIWs2M48ioho0HNdx1X8su3y8gl7g?= =?us-ascii?Q?95bnpfXS2OyBK28xRACqM0Mxd8FzCN7jbmcO7RkZT40IUIY3qygTDyt6Dt/m?= =?us-ascii?Q?g/oHGq0Q8wpiLkDbiZbKeeqrkjM/nwFIdYuDOCQ0dccCuP5W7hr8obu7qKHg?= =?us-ascii?Q?0/7lKPkmBXgV8s2vR/+SvSiZNFwBPgdqL4cgqN7YzkaRYHTV4XCWQhjvU7BK?= =?us-ascii?Q?ya5rZz6hkp9WjyGrRJC6xN50DB03bgCss+M/jKJYLlgUYXCMRGSHjGdaSStK?= =?us-ascii?Q?su14PZx/Wy/6ODgCSGu1n9hlAIYlO7AnzNNzxVOzXPBiVKJSe7Pn4MPxtNcJ?= =?us-ascii?Q?ncxCj73EOjRRl/E08S1L5vsOp0WfQkTRvwq/3grJYrwM+cOf0KuHGVsAQi77?= =?us-ascii?Q?wGef2aFQDnA4P8DC6sGb3+lETEtmY42smZAzP+Nt+X+a2nL7dgjiIc47VAla?= =?us-ascii?Q?cF/E6rVr7mJihcWcmRVBrch5BIHPXsng+6E1teAGv6wtoEPvfcTX1aWi3swv?= =?us-ascii?Q?Qi6c9ViF2GCytPOtqHA3eVOI36grDZNAgIL4vAy44Js4BmQb6vnLqtU05kE2?= =?us-ascii?Q?4On34sShea/ilQzCzvaH?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f486a2e-020c-4300-ffaf-08dc908d0529 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 18:24:13.6031 (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: SJ0PR84MB2230 Received-SPF: pass client-ip=2a01:111:f403:2c12::80f; envelope-from=morgan.j.smith@outlook.com; helo=NAM10-MW2-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, T_SCC_BODY_TEXT_LINE=-0.01 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 6C69716F8B X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -8.49 X-Spam-Score: -8.49 X-TUID: LWUPZExjkQ85 Ihor Radchenko writes: >> Ideally the fix in that commit should be ported to the org-element API. >> Notably, the malformed clock from the email thread from that commit is >> parsed a little strangely by org-element. I'm not sure what effect this >> has on my rewrite patch but regardless, we should probably fix this. >> Notice how ":day-end" and ":minute-end" are set but not ":hour-start" or >> ":minute-start". > > That's expected. > We have the following _syntax_ description for clock lines: > > https://orgmode.org/worg/org-syntax.html#Clocks... > clock: INACTIVE-TIMESTAMP-RANGE DURATION > > And [2012-01-01 sun. 00rr:01] is a perfectly valid timestamp without > time part. Org does allow arbitrary additional text in the timestamps. > (it is by design, to allow future extensions of the syntax, like the > planned timezone support) My specific issue is that the ":*-end" stuff can be set when the "*-start" stuff is not. Running the following snippet on the following file results in this: ======= snippet (org-element-cache-map (lambda (clock) "Calculate end-time - start-time" (let ((timestamp (org-element-property :value clock))) (- (float-time (org-timestamp-to-time timestamp t)) (float-time (org-timestamp-to-time timestamp))))) :granularity 'element :restrict-elements 'clock) ======== ======== file * Test CLOCK: [2023-11-15 Wed 15:26]--[2023-11-15 Wed 16:12] => 0:46 calculated time: 2760.0 CLOCK: [2023-11-15 Wed 15rr:26]--[2023-11-15 Wed 16:12] => 0:46 calculated time: 58320.0 CLOCK: [2023-11-15 Wed 15:26]--[2023-11-15 Wed 16rr:12] => 0:46 calculated time: 0.0 CLOCK: [2023-11-15 Wed 15rr:26]--[2023-11-15 Wed 16rr:12] => 0:46 calculated time: 0.0 ======= ======= results (2760.0 58320.0 0.0 0.0) ====== What this shows is that an invalid end will cause the entry to be ignored, but an invalid start will not. We can totally claim that this is a feature, not a bug, if you would like. As this essentially treats "CLOCK: [2023-11-15 Wed 15rr:26]--[2023-11-15 Wed 16:12] => 0:46" as "CLOCK: [2023-11-15 Wed]--[2023-11-15 Wed 16:12] => 16:12" If this is a feature then my previous patch is actually ready to merge.