From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bug: org-read-date: problem with year in dotted european date input [7.9.2 (release_7.9.2-436-g9b11e6 @ /home/grfz/src/org-mode/lisp/)] Date: Sun, 14 Oct 2012 01:31:33 -0400 Message-ID: <14809.1350192693@alphaville> References: <20121011125146.GA24007@boo.workgroup> <20121012151423.GC14562@boo.workgroup> <87sj9j1wv9.fsf@gmail.com> <20121013081221.GA8868@boo.workgroup> <87lifa1y3v.fsf@gmail.com> <20121013184423.GB28000@boo.workgroup> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNGnY-0001AT-Vm for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 01:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNGnY-0005Vp-0b for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 01:31:36 -0400 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:18113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNGnX-0005Vl-RX for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 01:31:35 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g5t0008.atlanta.hp.com (Postfix) with ESMTP id E02F6240EF for ; Sun, 14 Oct 2012 05:31:34 +0000 (UTC) Received: from pierrot.usa.hp.com (openvpn.lnx.usa.hp.com [16.125.113.33]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 7A2DC2011A for ; Sun, 14 Oct 2012 05:31:34 +0000 (UTC) Received: from alphaville (localhost [127.0.0.1]) by pierrot.usa.hp.com (Postfix) with ESMTP id 6E06440A73 for ; Sun, 14 Oct 2012 01:31:33 -0400 (EDT) In-Reply-To: Message from Gregor Zattler of "Sat, 13 Oct 2012 20:44:23 +0200." <20121013184423.GB28000@boo.workgroup> 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: emacs-orgmode Gregor Zattler wrote: > Hi Nicolas, org-mode users and developers, > * Nicolas Goaziou [13. Oct. 2012]: > > Gregor Zattler writes: > > > >> Back to square one: Does anybody know How to customise > >> Emacs/org-mode so that dotted European dates are parsed correctly > >> at the date/time prompt? > > > > Again, dotted European dates are parsed correctly without customization. > > Would you provide a time string that isn't? > > "Naked" dotted european dates without surrounding text are > parsed correctly by org-read-date. > > But with date/time prompt I mean the prompt which asks me for a > date/time when invoking org-time-stamp. Here I'm allowed to > insert Dates like "the event takes place at 27.10. at 14:00 in > the pub". Org-mode is supposed to parse these, see > [[info:org#The%20date/time%20prompt][info:org#The date/time prompt]]. > > If I now yank "Kommt am 27.10.2012 um 14:00 zum" in this > date/time prompt, the result is "<2010-10-27 Mi 14:00>" instead > of "<2012-10-27 Sa 14:00>". ^ ^^ > ^ ^^ > org-read-date calls org-read-date-analyze which does not recognize this as any kind of time string format it knows about (all the regexps it tries fail to match), so it calls parse-time-string. Lo and behold, (parse-time-string "Kommt am 27.10.2012 um 14:00 zum") returns (0 0 14 27 nil 2010 nil nil nil) > > I had a look at org-time-stamp which is invoked by "C-c ." I do > not understand how this function parses dates/times from text. > Therefore I looked for functions with appropriate names which are > called by org-time-stamp. The only one I could find is > org-read-date. It obviously parses dates from a string and > identifies parts (day, month, year). I thought org-read-date > does the heavy lifting with respect to date parsing. But now I > think you are right and org-read-dates parses "naked dates". But > where does the parsing of texts which contain dates take place? > org-read-date does fine with "Kommt am 2012-10-27 um 14:00 zum", because parse-time-string can figure out the iso date, even though it cannot figure out the dotted european one: (parse-time-string "Kommt am 2012-10-27 um 14:00 zum") returns (0 0 14 27 10 2012 nil nil nil) Nick