From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Why is ":CLOCK => hh:mm" allowed as a clock entry? Date: Sat, 20 Oct 2018 10:26:13 +0200 Message-ID: <8736t1hvmi.fsf@nicolasgoaziou.fr> References: <87ftx3wvyi.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDmal-0003Za-03 for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 04:26:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDmaf-00008J-LY for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 04:26:38 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:47447) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDmaY-0008Hf-HG for emacs-orgmode@gnu.org; Sat, 20 Oct 2018 04:26:29 -0400 In-Reply-To: <87ftx3wvyi.fsf@mbork.pl> (Marcin Borkowski's message of "Thu, 18 Oct 2018 09:33:09 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Marcin Borkowski Cc: Org-Mode mailing list Hello, Marcin Borkowski writes: > I am studying the `org-clock-sum' function (I need to parse an Org file > and extract clocking data), and I noticed that ":CLOCK =3D> hh:mm" is > allowed as a clock entry. The Org syntax at > https://orgmode.org/worg/dev/org-syntax.html#Clock,_Diary_Sexp_and_Planni= ng > confirms this. CLOCK: and CLOCK: =3D> hh:mm are simply empty clocks. > What is the rationale behind this? Treating them as regular text would complicate parsing unnecessarily, e.g., to determine when to stop a paragraph.=20 There are other cases that can lead to odd clocks: CLOCK: INACTIVE-TIMESTAMP =3D> HH:MM where INACTIVE-TIMESTAMP is not a timestamp range. > I want not only to sum the clocks (org-clock-sum does that, of > course), but I want more detailed information (like how many clocks > were that in the given period etc.). The format with only the duration > makes this troublesome, and I'd like to ignore such entries (I have > never seen them in my files, of course). I'm wondering what scenario > could lead to their existence? Hand-writing a clock information? In any case, you can simply ignore them whenever you find them =E2=80=93 wh= ich shouldn't happen, right? We can also add a checker in Org Lint for those problematic cases. > BTW, the syntax draft says that there can be any TIMESTAMP object before > the DURATION, but `org-clock-sum' assumes that its timestamps are > inactive. Isn't that a bug? This is an oversight. Clock timestamps must be inactive. I will fix it. Thank you. Regards, --=20 Nicolas Goaziou