From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Why is ":CLOCK => hh:mm" allowed as a clock entry? Date: Sun, 21 Oct 2018 21:50:19 +0200 Message-ID: <8736szt6ys.fsf@mbork.pl> References: <87ftx3wvyi.fsf@mbork.pl> <8736t1hvmi.fsf@nicolasgoaziou.fr> 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]:36265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEJrB-0003Ln-Bx for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 15:57:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEJlO-0000HX-30 for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 15:51:53 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:50352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEJlN-0000HB-R7 for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 15:51:50 -0400 In-reply-to: <8736t1hvmi.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: Org-Mode mailing list On 2018-10-20, at 10:26, Nicolas Goaziou wrote: > 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_Plann= ing >> 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 OK, I don't fully get it, but I believe you. :-) > 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 = which > shouldn't happen, right? Yes, that's what I thought. > We can also add a checker in Org Lint for those problematic cases. Might be a good idea, though definitely very low priority. >> 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. Thanks. Best, --=20 Marcin Borkowski http://mbork.pl