[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] bug#9695: allowed date range
From: |
Carsten Dominik |
Subject: |
Re: [O] bug#9695: allowed date range |
Date: |
Thu, 13 Oct 2011 10:27:12 +0200 |
On 13.10.2011, at 09:48, Eric S Fraga wrote:
> Tassilo Horn <address@hidden> writes:
>
>> Ivan Kanis <address@hidden> writes:
>>
>> Hi!
>>
>>> After investigating further <2011-10-17 >--<2011-10-30 > works but not
>>> <2011-10-17>--<2011-10-30>. The regexp for a timestamp is defined in
>>> org-ts-regexp :
>>>
>>> "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*?\\)>"
>>>
>>> Shouldn't the trailing space be optional?
>>
>> In your regex, there is no trailing whitespace, but are right that it is
>> in the original definition.
>>
>> ,----[ C-h v org-ts-regexp RET ]
>> | org-ts-regexp is a variable defined in `org.el'.
>> | Its value is
>> | "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>"
>> | ^
>> `----
>>
>> Strangely, that timestamp regex didn't change for 3 years...
>>
>> Oh, now I see what's wrong. All time stamps consist of the date and
>> then the day's name abbreviation, which is missing with your example.
>> Correct would be
>>
>> <2011-10-17 Mon>--<2011-10-30 Sun>
>>
>> Bye,
>> Tassilo
>
> Although the day is optional according to the regexp. I would
> definitely like to have the regexp with the space optional as well as
> there are cases where I want to type the date in directly (not in org
> mode for whatever reason).
I am attaching a patch which will make time stamps without a day name
like <2011-10-12> work correctly. Furthermore, pressing C-c C-c on
a time stamp will fill in or fix the day name.
However, I am not sure if this patch is complete, or if it
has side effects. So it would be good if a few people could
apply it and test it during their daily work for a few weeks,
and then report problems in this thread.
- Carsten
time-stamp-no-space.patch
Description: Binary data
> In those cases, it is easy to type
> 2011-01-01 or whatever but it's not necessarily trivial to determine the
> day of the week...
>
> Actually, interesting thought experiment: does org actually do any
> consistency checks, comparing the date and the day of the week?
>
> --
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
> : using Org-mode version 7.7 (release_7.7.380.g54d7df)
>