From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CK7dJR2+GmYEXgEAqHPOHw:P1 (envelope-from ) for ; Sat, 13 Apr 2024 19:17:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CK7dJR2+GmYEXgEAqHPOHw (envelope-from ) for ; Sat, 13 Apr 2024 19:17:17 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ZroXYYHq; dmarc=pass (policy=none) header.from=posteo.net; 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713028637; 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=go2ziaMNQMZmWUhrYy1z6ZWkPrBQ2PfRiU42Mc82fSI=; b=IC+fGIDwSAF/fEEjZDtzh6Grp8hUH7G6ujUeJAhSBXhHr9hu8FekUynHtE72JjrZ4zAYf1 3YbybuJUwHtJ3oFxSO8f+hYI0lzulhFFDe6j1q6xv+daM4+PZquU3LVXPmxXEAdXd5twNF DHRkXIV6zTenFhFra7pzf4MHWGiuyWYXR/AKUBmy6EvdoAFRrqX2wsVQ5qKdYrAsQEG8Zo mY3VmKb7EVDpQeNt/dot0fzkIAHygwTk9xRijSVPotUq+5Q4pdtgRFVi/edMjqxrLexnXE b3Ncrqfu4MEDQ3oPL6C5trhflVVEZlvWOQS19eAPa2zKDwHWhbVH4Px+hAfB8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ZroXYYHq; dmarc=pass (policy=none) header.from=posteo.net; 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=1; s=key1; d=yhetil.org; t=1713028637; a=rsa-sha256; cv=none; b=oVJOcvSvtDutdSRORcjNaJmHetwuOaFPefkPL9LTMp+6dEgm9+SNgMB9RF1fQE2UrvB/5w Eidke7y3g3n3Ps6TDL3R5WBXMFxLW5vfpx7epxKQyNlUp3k2MuXOXF0gJDxxF4ZmiHWuiJ SKvXvOUy46a343Jx/GGr31o8hLsi9YkyGxcw4wBqTiOGXbI4HAS+rUBjFfFKx9YsLEns3R XY2a1MCNm5nJZtTB8GpESwXkPfJz8mOqhckmJihdCNHsfF0FE3hNcqEmKGMboVJcj9u7l/ oqA7QXHDzLAWoP/6KGfXLKRN0EOxO+DCQ00wyjXCXdK9NT4OmztsrNiRx2ZSyA== 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 5F4F8AA83 for ; Sat, 13 Apr 2024 19:17:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvgYK-0002GC-JO; Sat, 13 Apr 2024 12:48:32 -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 1rvgYG-0002FH-Cr for emacs-orgmode@gnu.org; Sat, 13 Apr 2024 12:48:28 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvgYE-0002Pb-5i for emacs-orgmode@gnu.org; Sat, 13 Apr 2024 12:48:28 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C5AAA240028 for ; Sat, 13 Apr 2024 18:48:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713026903; bh=MwehL0ipWeQ5KzjTL8TPs7LrXDJuY/vJvld9zlSq4TQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=ZroXYYHqUXGDiDT4dpzJzxXINBZfLxvKNNQ5B4TSyIKU+p3wLNF2g9RqcaIg29O2n w8bK7LUb8l8rbUMBKLnjPXW6eJQc+k/f8+hBR8ggZSzecCe0zDFIRrW2of/uNGfV7T Je5CyPXZ+TZ+gtHvUaQ56lmmkGQs/EmNVDjEft+Qae3de075zuDMPrPdR/bdWiAkiw 11DnARb/ISOobbr4/vsgH8kM1aj2g6kop1/UBBpp2Co1TQy5c6ZUzrSHAV4XovsU4P gyJLGj3Jie+Z5D2YiqAY1/ccV0NnKcMtByZbsnudOKi04LTbkKaTYnNxNZVmhn0b9K 5nmyar6Uuu+Ig== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VGzs31NyXz9rwn; Sat, 13 Apr 2024 18:48:23 +0200 (CEST) From: Ihor Radchenko To: Morgan Smith Cc: emacs-orgmode@gnu.org, Sanel Zukan Subject: Re: [PATCH] lisp/org-clock.el (org-clock-sum): Rewrite regex using rx In-Reply-To: References: <87r0f9b9n2.fsf@localhost> Date: Sat, 13 Apr 2024 16:48:52 +0000 Message-ID: <87frvpyzrf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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-Migadu-Spam-Score: -8.27 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -8.27 X-Migadu-Queue-Id: 5F4F8AA83 X-TUID: 1VZISgY5xAUF Morgan Smith writes: >>> - (goto-line 2) >>> + (insert (org-test-clock-create-clock ". 1:00" ". 2:00") >>> + "CLOCK: => 1:00\n") >> >> This is not a valid clock format. Matching such lines is a bug. >> See https://list.orgmode.org/orgmode/87wpkkhafc.fsf@saiph.selenimh/ > > Let me preface this defense with the fact that I don't like this format > and I don't think we should support it. Rewriting `org-clock-sum' would > be much easier if we drop support for it. However, I do believe we > currently support it. > > First of all, it currently does work. > > Accord to the "Version 4.78" release notes as found on worg, this is > valid. > > ``` > - You may specify clocking times by hand (i.e. without > clocking in and out) using this syntax. > > : CLOCK: => 2:00 > > Thanks to Scott Jaderholm for this proposal. > ``` This is convincing. I did not know that this format is explicitly mentioned in the news. Our general rule is that we do not drop existing features in Org mode except extraordinary circumstances: https://bzg.fr/en/the-software-maintainers-pledge/ Especially when they are documented. So, in the message I linked, Nicolas (the major Org mode contributor) was not right. I hence need to fix the parser and update Org syntax page. This includes fixing `org-element-clock-line-re' to account for CLOCK: => 1:00 syntax. Luckily, it does not look like we are going to break the existing external exporter packages as long as they are using ox.el API - `org-export-translate' works just fine with missing timestamps. > Also last time I went to rewrite `org-clock-sum' you said > (https://list.orgmode.org/orgmode/87bkg7xbxo.fsf@localhost/): > > ``` > Further, you dropped the > > ((match-end 4) > ;; A naked time. > > branch of the code, which accounts for CLOCK: => HH:MM lines that are not clock elements. > ``` Yup. Although I did not see Nicolas' message that time. My judgment was simply based on looking at the code and seeing that CLOCK: => HH:MM matching was clearly intentional. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at