emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Date Prompt Bug (or Anomoly)
@ 2010-06-01 17:41 Daniel E. Doherty
  2010-06-04  8:47 ` Noorul Islam K M
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel E. Doherty @ 2010-06-01 17:41 UTC (permalink / raw)
  To: Org-mode List

All,

In playing around with the date prompt (C-.), I ran across the following
puzzling behavior from rather simple inputs.

I entered the following on June 1, 2010.  Here is a date entered as
"3/15": <2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
expected.

But here is a date entered as "5/21": <2021-06-05 Sat>.  Note how it
interpreted the "21" as the year 2021, not at all what I expected from
the documentation or the analogous "3/15" example.

Maybe there is some underlying logic here that I'm not getting.  Perhaps
it has to do with how 2-digit years are interpreted?

What's going on here?  I am using org-version 6.36trans on emacs 23.1.

Regards,
-- 
====================================================
Daniel E. Doherty
7300 W. 110th Street, Suite 930
Overland Park, KS 66210
913.338.7182 (Phone)
913,338.7164 (FAX)

Up the airy mountain,
Down the rushy glen,
We daren't go a-hunting,
For fear of little men.
          --- William Allingham (Donegal, Ireland)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Date Prompt Bug (or Anomoly)
  2010-06-01 17:41 Date Prompt Bug (or Anomoly) Daniel E. Doherty
@ 2010-06-04  8:47 ` Noorul Islam K M
  2010-06-04  8:48   ` Noorul Islam K M
  0 siblings, 1 reply; 12+ messages in thread
From: Noorul Islam K M @ 2010-06-04  8:47 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: Org-mode List

Daniel E. Doherty <ded-law@ddoherty.net> writes:

> All,
>
> In playing around with the date prompt (C-.), I ran across the following
> puzzling behavior from rather simple inputs.
>
> I entered the following on June 1, 2010.  Here is a date entered as
> "3/15": <2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
> expected.
>
> But here is a date entered as "5/21": <2021-06-05 Sat>.  Note how it
> interpreted the "21" as the year 2021, not at all what I expected from
> the documentation or the analogous "3/15" example.

I think you should be using 3-15 & 5-21. I think the program is not
expecting '/' instead it expects '-'.

Thanks and Regards
Noorul

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Date Prompt Bug (or Anomoly)
  2010-06-04  8:47 ` Noorul Islam K M
@ 2010-06-04  8:48   ` Noorul Islam K M
  2010-06-04  9:39     ` Mikael Fornius
  0 siblings, 1 reply; 12+ messages in thread
From: Noorul Islam K M @ 2010-06-04  8:48 UTC (permalink / raw)
  To: Org-mode List; +Cc: Daniel E. Doherty

Noorul Islam K M <gnukid@gmail.com> writes:

> Daniel E. Doherty <ded-law@ddoherty.net> writes:
>
>> All,
>>
>> In playing around with the date prompt (C-.), I ran across the following
>> puzzling behavior from rather simple inputs.
>>
>> I entered the following on June 1, 2010.  Here is a date entered as
>> "3/15": <2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
>> expected.
>>
>> But here is a date entered as "5/21": <2021-06-05 Sat>.  Note how it
>> interpreted the "21" as the year 2021, not at all what I expected from
>> the documentation or the analogous "3/15" example.
>
> I think you should be using 3-15 & 5-21. I think the program is not
> expecting '/' instead it expects '-'.

It is explained here.

http://www.gnu.org/software/emacs/manual/html_node/org/The-date_002ftime-prompt.html#The-date_002ftime-prompt

Thanks and Regards
Noorul

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Date Prompt Bug (or Anomoly)
  2010-06-04  8:48   ` Noorul Islam K M
@ 2010-06-04  9:39     ` Mikael Fornius
  2010-06-04 11:00       ` Carsten Dominik
  0 siblings, 1 reply; 12+ messages in thread
From: Mikael Fornius @ 2010-06-04  9:39 UTC (permalink / raw)
  To: Noorul Islam K M; +Cc: Daniel E. Doherty, Org-mode List


I do not know what version your info reference is but my latest
git-versions info page documents the usage of 2/5 date format.

(info "(org) The date/time prompt")

Then the info page is wrong and the docstring to `org-read-date' states:

"The prompt will suggest to enter an ISO date, but you can also enter
anything which will at least partially be understood by
`parse-time-string'."

What `parse-time-string' understands I can not find well documented and
it may be a bug or something there but who knows where its behavior is
documented?

(I get the same wrong result in my date prompt when trying 5/21.

Org-mode version 6.36trans (release_6.36.154.g6bad)
GNU Emacs 24.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-06-01 on eee)

-- 
Mikael Fornius

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-04  9:39     ` Mikael Fornius
@ 2010-06-04 11:00       ` Carsten Dominik
  2010-06-04 15:16         ` Daniel E. Doherty
  2010-06-05 17:43         ` Daniel E. Doherty
  0 siblings, 2 replies; 12+ messages in thread
From: Carsten Dominik @ 2010-06-04 11:00 UTC (permalink / raw)
  To: Mikael Fornius; +Cc: Daniel E. Doherty, Org-mode List


On Jun 4, 2010, at 11:39 AM, Mikael Fornius wrote:

>
> I do not know what version your info reference is but my latest
> git-versions info page documents the usage of 2/5 date format.

Indeed.  This was a but in the special regexp looking for
american-style dates - I had the parts for day and month the
wrong way round.

Should be fixed now.

Thanks to Daniel for the report, and to everyone else for following up.

- Carsten

>
> (info "(org) The date/time prompt")
>
> Then the info page is wrong and the docstring to `org-read-date'  
> states:
>
> "The prompt will suggest to enter an ISO date, but you can also enter
> anything which will at least partially be understood by
> `parse-time-string'."
>
> What `parse-time-string' understands I can not find well documented  
> and
> it may be a bug or something there but who knows where its behavior is
> documented?
>
> (I get the same wrong result in my date prompt when trying 5/21.
>
> Org-mode version 6.36trans (release_6.36.154.g6bad)
> GNU Emacs 24.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of  
> 2010-06-01 on eee)
>
> -- 
> Mikael Fornius
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-04 11:00       ` Carsten Dominik
@ 2010-06-04 15:16         ` Daniel E. Doherty
  2010-06-05 17:43         ` Daniel E. Doherty
  1 sibling, 0 replies; 12+ messages in thread
From: Daniel E. Doherty @ 2010-06-04 15:16 UTC (permalink / raw)
  To: Org-mode List


Carsten,

Thanks for the fix.  All, thanks for the follow-up.

Regards,

Dan

>>>>> Carsten Dominik <carsten.dominik@gmail.com> writes:

    > On Jun 4, 2010, at 11:39 AM, Mikael Fornius wrote:

    >> 
    >> I do not know what version your info reference is but my latest
    >> git-versions info page documents the usage of 2/5 date format.

    > Indeed.  This was a but in the special regexp looking for
    > american-style dates - I had the parts for day and month the wrong
    > way round.

    > Should be fixed now.

    > Thanks to Daniel for the report, and to everyone else for
    > following up.

    > - Carsten

    >> 
    >> (info "(org) The date/time prompt")
    >> 
    >> Then the info page is wrong and the docstring to `org-read-date'
    >> states:
    >> 
    >> "The prompt will suggest to enter an ISO date, but you can also
    >> enter anything which will at least partially be understood by
    >> `parse-time-string'."
    >> 
    >> What `parse-time-string' understands I can not find well
    >> documented and it may be a bug or something there but who knows
    >> where its behavior is documented?
    >> 
    >> (I get the same wrong result in my date prompt when trying 5/21.
    >> 
    >> Org-mode version 6.36trans (release_6.36.154.g6bad) GNU Emacs
    >> 24.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-06-01
    >> on eee)
    >> 
    >> -- 
    >> Mikael Fornius
    >> 
    >> _______________________________________________ Emacs-orgmode
    >> mailing list Please use `Reply All' to send replies to the list.
    >> Emacs-orgmode@gnu.org
    >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

    > - Carsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-04 11:00       ` Carsten Dominik
  2010-06-04 15:16         ` Daniel E. Doherty
@ 2010-06-05 17:43         ` Daniel E. Doherty
  2010-06-06  4:20           ` Carsten Dominik
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel E. Doherty @ 2010-06-05 17:43 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Carsten Dominik

Carsten,

I pulled the latest git, and it looks like "3/21" and "5/21" work as 
expected.  But when I put in "7/21", a date in the near future, it is 
interpreting it a "2021-07-21" rather than the "2010-07-21" that one 
would expect.

Regards,

====================================================
Daniel E. Doherty
7300 W. 110th Street, Suite 930
Overland Park, KS 66210
913.338.7182 (Phone)
913,338.7164 (FAX)

Up the airy mountain,
Down the rushy glen,
We daren't go a-hunting,
For fear of little men.
           --- William Allingham (Donegal, Ireland)

On 06/04/2010 06:00 AM, Carsten Dominik wrote:
>
> On Jun 4, 2010, at 11:39 AM, Mikael Fornius wrote:
>
>>
>> I do not know what version your info reference is but my latest
>> git-versions info page documents the usage of 2/5 date format.
>
> Indeed. This was a but in the special regexp looking for
> american-style dates - I had the parts for day and month the
> wrong way round.
>
> Should be fixed now.
>
> Thanks to Daniel for the report, and to everyone else for following up.
>
> - Carsten
>
>>
>> (info "(org) The date/time prompt")
>>
>> Then the info page is wrong and the docstring to `org-read-date' states:
>>
>> "The prompt will suggest to enter an ISO date, but you can also enter
>> anything which will at least partially be understood by
>> `parse-time-string'."
>>
>> What `parse-time-string' understands I can not find well documented and
>> it may be a bug or something there but who knows where its behavior is
>> documented?
>>
>> (I get the same wrong result in my date prompt when trying 5/21.
>>
>> Org-mode version 6.36trans (release_6.36.154.g6bad)
>> GNU Emacs 24.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of
>> 2010-06-01 on eee)
>>
>> --
>> Mikael Fornius
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-05 17:43         ` Daniel E. Doherty
@ 2010-06-06  4:20           ` Carsten Dominik
  2010-06-08 20:45             ` Daniel E. Doherty
  0 siblings, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2010-06-06  4:20 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode


On Jun 5, 2010, at 7:43 PM, Daniel E. Doherty wrote:

> Carsten,
>
> I pulled the latest git, and it looks like "3/21" and "5/21" work as  
> expected.  But when I put in "7/21", a date in the near future, it  
> is interpreting it a "2021-07-21" rather than the "2010-07-21" that  
> one would expect.

I cannot reproduce this.

- Carsten

>
> Regards,
>
> ====================================================
> Daniel E. Doherty
> 7300 W. 110th Street, Suite 930
> Overland Park, KS 66210
> 913.338.7182 (Phone)
> 913,338.7164 (FAX)
>
> Up the airy mountain,
> Down the rushy glen,
> We daren't go a-hunting,
> For fear of little men.
>          --- William Allingham (Donegal, Ireland)
>
> On 06/04/2010 06:00 AM, Carsten Dominik wrote:
>>
>> On Jun 4, 2010, at 11:39 AM, Mikael Fornius wrote:
>>
>>>
>>> I do not know what version your info reference is but my latest
>>> git-versions info page documents the usage of 2/5 date format.
>>
>> Indeed. This was a but in the special regexp looking for
>> american-style dates - I had the parts for day and month the
>> wrong way round.
>>
>> Should be fixed now.
>>
>> Thanks to Daniel for the report, and to everyone else for following  
>> up.
>>
>> - Carsten
>>
>>>
>>> (info "(org) The date/time prompt")
>>>
>>> Then the info page is wrong and the docstring to `org-read-date'  
>>> states:
>>>
>>> "The prompt will suggest to enter an ISO date, but you can also  
>>> enter
>>> anything which will at least partially be understood by
>>> `parse-time-string'."
>>>
>>> What `parse-time-string' understands I can not find well  
>>> documented and
>>> it may be a bug or something there but who knows where its  
>>> behavior is
>>> documented?
>>>
>>> (I get the same wrong result in my date prompt when trying 5/21.
>>>
>>> Org-mode version 6.36trans (release_6.36.154.g6bad)
>>> GNU Emacs 24.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of
>>> 2010-06-01 on eee)
>>>
>>> --
>>> Mikael Fornius
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> - Carsten
>>
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-06  4:20           ` Carsten Dominik
@ 2010-06-08 20:45             ` Daniel E. Doherty
  2010-06-08 22:27               ` Nick Dokos
  2010-06-08 22:28               ` Carsten Dominik
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel E. Doherty @ 2010-06-08 20:45 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Daniel E. Doherty


Carsten,

When I tried this last Saturday, I was reluctant to reply since the git
server appeared to be down and your message made me think I did not have
the latest git version.  I tried it again today, and still no joy.  I am
using org-mode version 6.36a on emacs 23.1 on ubuntu.

The latest entry in the Changelog file is
,----
| 2010-06-08  Christian Egli  <christian.egli@sbszh.ch>
| 
| 	* org-taskjuggler.el (org-export-taskjuggler-old-level):
| 	define local variable to avoid compiler warning.
`----

The following is straight from an org file:

,----
| Attempted on: <2010-06-08 Tue>.
| Entering "3/21": <2021-07-03 Sat>.
| Entering "7/21": <2021-07-07 Wed>.
`----

I assume that the fix would be in the function org-read-date-analyze,
but I see no recent Changelog entries mentioning it.  Is it possible
this got lost while the git server was down?

Regards,

Dan

    Carsten> On Jun 5, 2010, at 7:43 PM, Daniel E. Doherty wrote:

    >> Carsten,
    >> 
    >> I pulled the latest git, and it looks like "3/21" and "5/21" work
    >> as expected.  But when I put in "7/21", a date in the near
    >> future, it is interpreting it a "2021-07-21" rather than the
    >> "2010-07-21" that one would expect.

    Carsten> I cannot reproduce this.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-08 20:45             ` Daniel E. Doherty
@ 2010-06-08 22:27               ` Nick Dokos
  2010-06-09  8:31                 ` Daniel E. Doherty
  2010-06-08 22:28               ` Carsten Dominik
  1 sibling, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2010-06-08 22:27 UTC (permalink / raw)
  To: Daniel E. Doherty
  Cc: nicholas.dokos, emacs-orgmode, Daniel E. Doherty, Carsten Dominik

Daniel E. Doherty <ded-law@ddoherty.net> wrote:

> 
> Carsten,
> 
> When I tried this last Saturday, I was reluctant to reply since the git
> server appeared to be down and your message made me think I did not have
> the latest git version.  I tried it again today, and still no joy.  I am
> using org-mode version 6.36a on emacs 23.1 on ubuntu.
> 
> The latest entry in the Changelog file is
> ,----
> | 2010-06-08  Christian Egli  <christian.egli@sbszh.ch>
> | 
> | 	* org-taskjuggler.el (org-export-taskjuggler-old-level):
> | 	define local variable to avoid compiler warning.
> `----
> 
> The following is straight from an org file:
> 
> ,----
> | Attempted on: <2010-06-08 Tue>.
> | Entering "3/21": <2021-07-03 Sat>.
> | Entering "7/21": <2021-07-07 Wed>.
> `----
> 
> I assume that the fix would be in the function org-read-date-analyze,
> but I see no recent Changelog entries mentioning it.  Is it possible
> this got lost while the git server was down?
> 

No, it is fixed by the following commit, but 6.36a is too old to include
it. Either you did not get the updates you thought you did, or you did
not remake your org, or you did not reload the newly made org. Try

     git show 420dd96768262cb15c8bcf4fa6386361e0327add

in your git repository to see whether you have the update. If you don't,
pull again. If you do have it, do

        make clean; make

and in emacs

        M-x org-reload

Then
        M-x org-version

should say something like:

        Org-mode version 6.36trans (release_6.36.155.g420d)

HTH,
Nick

---------------------------------------------------------------------------
commit 420dd96768262cb15c8bcf4fa6386361e0327add
Author: Carsten Dominik <carsten.dominik@gmail.com>
Date:   Fri Jun 4 12:29:31 2010 +0200

    Fix the date prompt for american-style dates
    
    * lisp/org.el (org-read-date-analyze): Fix regular expression for
    matching american dates
    
    Daniel E. Doherty writes:
    
    > In playing around with the date prompt (C-.), I ran across the following
    > puzzling behavior from rather simple inputs.
    >
    > I entered the following on June 1, 2010.  Here is a date entered as
    > "3/15": <2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
    > expected.
    >
    > But here is a date entered as "5/21": <2021-06-05 Sat>.  Note how it
    > interpreted the "21" as the year 2021, not at all what I expected from
    > the documentation or the analogous "3/15" example.
    >
    > Maybe there is some underlying logic here that I'm not getting.  Perhaps
    > it has to do with how 2-digit years are interpreted?
    >
    > What's going on here?  I am using org-version 6.36trans on emacs 23.1.
    
    What was going on here is that the regular expression for matching
    american-style dates was wrong.  It was looking for month numbers in
    the second field and day numbers in the first field - wrong, of
    course.

diff --git a/lisp/org.el b/lisp/org.el
index 64044b4..48fd215 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13942,10 +13942,15 @@ The prompt will suggest to enter an ISO date, but you can also enter anything
 which will at least partially be understood by `parse-time-string'.
 Unrecognized parts of the date will default to the current day, month, year,
 hour and minute.  If this command is called to replace a timestamp at point,
-of to enter the second timestamp of a range, the default time is taken from the
-existing stamp.  For example,
+of to enter the second timestamp of a range, the default time is taken
+from the existing stamp.  Furthermore, the command prefers the future,
+so if you are giving a date where the year is not given, and the day-month
+combination is already past in the current year, it will assume you
+mean next year.  For details, see the manual.  A few examples:
+
   3-2-5         --> 2003-02-05
   feb 15        --> currentyear-02-15
+  2/15          --> currentyear-02-15
   sep 12 9      --> 2009-09-12
   12:45         --> today 12:45
   22 sept 0:34  --> currentyear-09-22 0:34
@@ -14191,7 +14196,7 @@ user."
 			       t nil ans)))
     ;; Help matching american dates, like 5/30 or 5/30/7
     (when (string-match
-	   "^ *\\([0-3]?[0-9]\\)/\\([0-1]?[0-9]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
+	   "^ *\\(0?[1-9]\\|1[012]\\)/\\(0?[1-9]\\|[12][0-9]\\|3[01]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
       (setq year (if (match-end 4)
 		     (string-to-number (match-string 4 ans))
 		   (progn (setq kill-year t)

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-08 20:45             ` Daniel E. Doherty
  2010-06-08 22:27               ` Nick Dokos
@ 2010-06-08 22:28               ` Carsten Dominik
  1 sibling, 0 replies; 12+ messages in thread
From: Carsten Dominik @ 2010-06-08 22:28 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: emacs-orgmode, Daniel E. Doherty


On Jun 8, 2010, at 10:45 PM, Daniel E. Doherty wrote:

>
> Carsten,
>
> When I tried this last Saturday, I was reluctant to reply since the  
> git
> server appeared to be down and your message made me think I did not  
> have
> the latest git version.  I tried it again today, and still no joy.   
> I am
> using org-mode version 6.36a on emacs 23.1 on ubuntu.
>
> The latest entry in the Changelog file is
> ,----
> | 2010-06-08  Christian Egli  <christian.egli@sbszh.ch>
> |
> | 	* org-taskjuggler.el (org-export-taskjuggler-old-level):
> | 	define local variable to avoid compiler warning.
> `----
>
> The following is straight from an org file:
>
> ,----
> | Attempted on: <2010-06-08 Tue>.
> | Entering "3/21": <2021-07-03 Sat>.
> | Entering "7/21": <2021-07-07 Wed>.
> `----
>
> I assume that the fix would be in the function org-read-date-analyze,
> but I see no recent Changelog entries mentioning it.  Is it possible
> this got lost while the git server was down?


Hi Daniel,

we have abondoned he ChangeLog file.  The fix is in this commit:

http://repo.or.cz/w/org-mode.git/commit/420dd96768262cb15c8bcf4fa6386361e0327add


I get this:

<2010-06-09 Wed>
3/21: <2011-03-21 Mon>
7/21: <2010-07-21 Wed>


I guess you are still loading an old version of Org somehow.

- Carsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Re: Date Prompt Bug (or Anomoly)
  2010-06-08 22:27               ` Nick Dokos
@ 2010-06-09  8:31                 ` Daniel E. Doherty
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel E. Doherty @ 2010-06-09  8:31 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Carsten Dominik

On 06/08/2010 05:27 PM, Nick Dokos wrote:

Carsten and Nick,

Many thanks, that did it.  (I wasn't re-making the .elc's---'Doh).

Dan
> Daniel E. Doherty<ded-law@ddoherty.net>  wrote:
>
>    
>> Carsten,
>>
>> When I tried this last Saturday, I was reluctant to reply since the git
>> server appeared to be down and your message made me think I did not have
>> the latest git version.  I tried it again today, and still no joy.  I am
>> using org-mode version 6.36a on emacs 23.1 on ubuntu.
>>
>> The latest entry in the Changelog file is
>> ,----
>> | 2010-06-08  Christian Egli<christian.egli@sbszh.ch>
>> |
>> | 	* org-taskjuggler.el (org-export-taskjuggler-old-level):
>> | 	define local variable to avoid compiler warning.
>> `----
>>
>> The following is straight from an org file:
>>
>> ,----
>> | Attempted on:<2010-06-08 Tue>.
>> | Entering "3/21":<2021-07-03 Sat>.
>> | Entering "7/21":<2021-07-07 Wed>.
>> `----
>>
>> I assume that the fix would be in the function org-read-date-analyze,
>> but I see no recent Changelog entries mentioning it.  Is it possible
>> this got lost while the git server was down?
>>
>>      
> No, it is fixed by the following commit, but 6.36a is too old to include
> it. Either you did not get the updates you thought you did, or you did
> not remake your org, or you did not reload the newly made org. Try
>
>       git show 420dd96768262cb15c8bcf4fa6386361e0327add
>
> in your git repository to see whether you have the update. If you don't,
> pull again. If you do have it, do
>
>          make clean; make
>
> and in emacs
>
>          M-x org-reload
>
> Then
>          M-x org-version
>
> should say something like:
>
>          Org-mode version 6.36trans (release_6.36.155.g420d)
>
> HTH,
> Nick
>
> ---------------------------------------------------------------------------
> commit 420dd96768262cb15c8bcf4fa6386361e0327add
> Author: Carsten Dominik<carsten.dominik@gmail.com>
> Date:   Fri Jun 4 12:29:31 2010 +0200
>
>      Fix the date prompt for american-style dates
>
>      * lisp/org.el (org-read-date-analyze): Fix regular expression for
>      matching american dates
>
>      Daniel E. Doherty writes:
>
>      >  In playing around with the date prompt (C-.), I ran across the following
>      >  puzzling behavior from rather simple inputs.
>      >
>      >  I entered the following on June 1, 2010.  Here is a date entered as
>      >  "3/15":<2011-03-15 Tue>.  It interpreted it as the upcoming March 15 as
>      >  expected.
>      >
>      >  But here is a date entered as "5/21":<2021-06-05 Sat>.  Note how it
>      >  interpreted the "21" as the year 2021, not at all what I expected from
>      >  the documentation or the analogous "3/15" example.
>      >
>      >  Maybe there is some underlying logic here that I'm not getting.  Perhaps
>      >  it has to do with how 2-digit years are interpreted?
>      >
>      >  What's going on here?  I am using org-version 6.36trans on emacs 23.1.
>
>      What was going on here is that the regular expression for matching
>      american-style dates was wrong.  It was looking for month numbers in
>      the second field and day numbers in the first field - wrong, of
>      course.
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 64044b4..48fd215 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -13942,10 +13942,15 @@ The prompt will suggest to enter an ISO date, but you can also enter anything
>   which will at least partially be understood by `parse-time-string'.
>   Unrecognized parts of the date will default to the current day, month, year,
>   hour and minute.  If this command is called to replace a timestamp at point,
> -of to enter the second timestamp of a range, the default time is taken from the
> -existing stamp.  For example,
> +of to enter the second timestamp of a range, the default time is taken
> +from the existing stamp.  Furthermore, the command prefers the future,
> +so if you are giving a date where the year is not given, and the day-month
> +combination is already past in the current year, it will assume you
> +mean next year.  For details, see the manual.  A few examples:
> +
>     3-2-5         -->  2003-02-05
>     feb 15        -->  currentyear-02-15
> +  2/15          -->  currentyear-02-15
>     sep 12 9      -->  2009-09-12
>     12:45         -->  today 12:45
>     22 sept 0:34  -->  currentyear-09-22 0:34
> @@ -14191,7 +14196,7 @@ user."
>   			       t nil ans)))
>       ;; Help matching american dates, like 5/30 or 5/30/7
>       (when (string-match
> -	   "^ *\\([0-3]?[0-9]\\)/\\([0-1]?[0-9]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
> +	   "^ *\\(0?[1-9]\\|1[012]\\)/\\(0?[1-9]\\|[12][0-9]\\|3[01]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
>         (setq year (if (match-end 4)
>   		     (string-to-number (match-string 4 ans))
>   		   (progn (setq kill-year t)
>    

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-06-09  8:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 17:41 Date Prompt Bug (or Anomoly) Daniel E. Doherty
2010-06-04  8:47 ` Noorul Islam K M
2010-06-04  8:48   ` Noorul Islam K M
2010-06-04  9:39     ` Mikael Fornius
2010-06-04 11:00       ` Carsten Dominik
2010-06-04 15:16         ` Daniel E. Doherty
2010-06-05 17:43         ` Daniel E. Doherty
2010-06-06  4:20           ` Carsten Dominik
2010-06-08 20:45             ` Daniel E. Doherty
2010-06-08 22:27               ` Nick Dokos
2010-06-09  8:31                 ` Daniel E. Doherty
2010-06-08 22:28               ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).