From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Clock time implied as 00:00 Date: Fri, 30 Dec 2011 17:27:47 -0500 Message-ID: <26531.1325284067@alphaville.dokosmarshall.org> References: <87pqf7b9jt.fsf@iro.umontreal.ca> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgkvX-0007B1-Vb for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 17:27:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgkvW-0001ZF-W3 for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 17:27:51 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:46049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgkvW-0001ZB-Qe for emacs-orgmode@gnu.org; Fri, 30 Dec 2011 17:27:50 -0500 In-Reply-To: Message from pinard@iro.umontreal.ca (=?us-ascii?Q?=3D=3Futf-?= =?us-ascii?Q?8=3FQ=3FFran=3DC3=3DA7ois=3F=3D?= Pinard) of "Thu\, 29 Dec 2011 11\:57\:10 EST." <87pqf7b9jt.fsf@iro.umontreal.ca> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?us-ascii?Q?=3D=3Futf-8=3FQ=3FFran=3DC3=3DA7?= =?us-ascii?Q?ois=3F=3D?= Pinard Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Fran=C3=A7ois Pinard wrote: > Hi, Org people. >=20 > This morning, I just noticed this line: >=20 > CLOCK: [2011-12-29 jeu 9:30]--[2011-12-29 jeu 11:44] =3D> 11:44 >=20 > because of the strange 11:44 total. My error is clear, as I wrote 9:30 > instead of 09:30. Correcting it gives a move reasonable total: >=20 > CLOCK: [2011-12-29 jeu 09:30]--[2011-12-29 jeu 11:44] =3D> 2:14 >=20 > Yet, forgetting a leading 0 is an easy mistake (I know I should not make > mistakes!), and then, maybe (I'm not sure) Org mode could deliver > unexpected or misleading statistics out of a silent error. Not such a > problem for me, yet it could have become one if I missed it. >=20 > Would it be reasonable to suggest that Org mode be more lenient about > missing leading zeroes? >=20 There are two regexps that match timestamps, org-ts-regexp0 and org-ts-regexp1 (and two more, derived from the first two). In each case the part that matches the HH:MM part is as follows: "... \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)..." in words: "exactly two digits, followed by a colon, followed by exactly two digits". Modifying them so that the HH part can be "one or two digits" seems to make org-parse-time-string work correctly with the above input: "... \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)..." Whether this has undesirable consequences[fn:1], I don't know. Actually it's only regexp0 that is used in org-parse-time-string, so strictly speaking, only it needs to be modified. Nick Footnotes: [fn:1] In particular, org-ts-regexp0 is explicitly used in org-odt.el, so a= t least that part needs to be checked for breakage, something that I have not done.