From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregor Zattler Subject: 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/)] (was: Re: how to customise Emacs to recognise 13.10. as 13th of October this year instead of 2010-10-13?) Date: Fri, 12 Oct 2012 17:14:23 +0200 Message-ID: <20121012151423.GC14562@boo.workgroup> References: <20121011125146.GA24007@boo.workgroup> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMgxd-0004fS-9M for emacs-orgmode@gnu.org; Fri, 12 Oct 2012 11:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMgxZ-000422-31 for emacs-orgmode@gnu.org; Fri, 12 Oct 2012 11:15:37 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:60560) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TMgxY-0003zD-QE for emacs-orgmode@gnu.org; Fri, 12 Oct 2012 11:15:33 -0400 Content-Disposition: inline In-Reply-To: <20121011125146.GA24007@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 Dear org-moders, I now believe I found a bug in org-read-date. There is a problem parsing European dotted dates. In Dates the like DD.MM.YYYY or DD.MM.YY or DD.MM. `MM' is recognised as year instead of month: Today is 2012-10-11: (org-read-date t nil "Kommt am 27.10.2012 um 14:00 Uhr") gives "2010-10-27" expectet outcome is "2012-10-27" Same with abbreviated years: (org-read-date t nil "Kommt am 27.10.12 um 14:00 Uhr") "2010-10-27" expectet outcome is "2012-10-27" Days are interpreted correctly: (org-read-date t nil "Kommt am 27. um 14:00 Uhr") "2012-10-27" Since I customised german day names this also is correct: (org-read-date t nil "Kommt am Sonntag um 14:00 Uhr") "2012-10-14" The most common way of expressing dates this year is interpreted wrongly: (org-read-date t nil "Kommt am 27.10. um 14:00 Uhr") "2010-10-27" expectet outcome is "2012-10-27" I read the source of org-read-date but didn't grok it. The regex in the section labeled ";; Help matching dotted european dates" looks good to me, but... Emacs : GNU Emacs 24.2.50.1 (i486-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2012-10-09 on dex, modified by Debian Package: Org-mode version 7.9.2 (release_7.9.2-436-g9b11e6 @ /home/grfz/src/org-mode/lisp/) I also did these tests with `env -i emacs -d :0.0 -Q': - GNU Emacs 24.2.50.1 / Org-mode 7.9.2 - GNU Emacs 23.4.1 / Org-mode: 6.33x --> same results (with the exception of german day names). Thanks for your attention, Gregor * Gregor Zattler [11. Oct. 2012]: > > > today (2012-10-11) I yanked "Kommt am 13.10. um 14:00 zum" into > the date/time prompt: the date is recognised as "<2010-10-13 Mi > 14:00>" instead of <2012-10-13 Sa 14:00> as I would expect since > I have the following customisations (excerpt): > > (custom-set-variables > ;[...] > '(calendar-date-style (quote european)) > ;[...] > '(diary-date-forms (quote ((day "\\. ?" month "\\. ?[^0-9]") > (day "\\. ?" month "\\. ?" year "[^0-9]") > (day "/" month "[^/0-9]") > (day "/" month "/" year "[^0-9]") > (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)") > (day " *" monthname " *" year "[^0-9]") > (dayname "\\W")))) > ;[...] > ) > > as part of my .init.el. > > > I thought the first diary date form would match this text but it > doesn't. Even "Kommt am 13.10.2012 um 14:00 zum" is parsed as > "<2010-10-13 Mi 14:00>". I thought the second diary date form > would match this. > > Before I realised this I captured several events with wrong dates. > > Any Ideas? > > Ciao, Gregor > Ciao, Gregor -- -... --- .-. . -.. ..--.. ...-.-