emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: A proposed enhancement in entering timestamps
Date: Thu, 24 Mar 2016 16:03:18 +0100	[thread overview]
Message-ID: <87lh573oll.fsf@mbork.pl> (raw)
In-Reply-To: <87vb4cyqdp.fsf@nicolasgoaziou.fr>


On 2016-03-24, at 14:09, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,
>
> Marcin Borkowski <mbork@mbork.pl> writes:
>
>> On 2016-03-18, at 17:51, Marcin Borkowski <mbork@mbork.pl> wrote:
>>
>>> I'm now reading org-read-date-analyze to be able to enable US military
>>> format for hours (e.g., 2100 instead of 21:00).  This is potentially
>>> very useful (at least for me), since I'll be able to enter the hour with
>>> one hand (colon is on shift-semicolon on my keyboard).  Another idea
>>> would be to enable 21.00 (this notation is sometimes used in Poland).
>>> Would there be demand for such a feature?
>>
>> Hi all,
>>
>> and thanks Eric and Sam for positive feedback.
>
> I agree that US military format can be interesting. However, I think
> 21.00 could conflict with European format for dates.

Well, both can.  I've been thinking about it today and decided that the
easiest way to accomplish this without breaking anything would be to
replace "dddd" (i.e., four digits) or "dd.dd" at the end of `ans' in
`org-read-date-analyze' with "dd:dd", possibly with some added test for
the case when this could be mistaken for a date (or its part).  This way
I wouldn't have to touch `parse-time-string' (which I'm quite afraid to
touch, as I wrote).

A quick test I've done right now shows that "dd.dd" on itself is not
interpreted in any special way by `org-read-date-analyze', but /is/ by
`org-read-date'.  This looks like a bug to me.

I'll come back to this issue after Easter.

>> One thing that would tremendously help is tests.  I think these
>> functions are rather fragile, in the sense that it's very easy to break
>> something (`parse-time-string' is a total mess, for example - it is
>> "clever", yes, but proving that it actually works seems next to
>> impossible), so without an extensive test suite I wouldn't touch these
>> functions.  Does anyone have - or can make - a set of valid (in
>> `org-read-date' sense) strings to make tests first and then modify these
>> functions?  (I could make it myself, but I might forget about some cases -
>> and there are a lot of them!  And it's even nontrivial to test the
>> coverage, since large part of the `parse-time-string' /logic/ is hidden
>> in the /variable/ `parse-time-rules', which btw has a 1-line
>> docstring...)
>
> I cannot speak for `parse-time-string', but `org-read-date' already has
> some tests in `test-org/org-read-date'. You can add more if you want to.

Thanks!

> Regards,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

  reply	other threads:[~2016-03-24 15:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 11:52 A small fix in `org-read-date-analyze' Marcin Borkowski
2016-03-17 12:02 ` Marcin Borkowski
2016-03-17 22:12   ` Nicolas Goaziou
2016-03-18  5:40     ` Marcin Borkowski
2016-03-18 13:34       ` Nicolas Goaziou
2016-03-18 16:51         ` A proposed enhancement in entering timestamps (was: A small fix in `org-read-date-analyze') Marcin Borkowski
2016-03-18 19:02           ` A proposed enhancement in entering timestamps Samuel W. Flint
2016-03-18 20:26           ` Eric S Fraga
2016-03-22 20:28           ` A proposed enhancement in entering timestamps (was: A small fix in `org-read-date-analyze') Marcin Borkowski
2016-03-24 13:09             ` A proposed enhancement in entering timestamps Nicolas Goaziou
2016-03-24 15:03               ` Marcin Borkowski [this message]
2016-03-24 15:30                 ` Robert Horn
2016-03-24 19:38                   ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lh573oll.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).