emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Incorrect duration format example in comments in 'org-duration.el' [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
@ 2021-04-20 10:31 Johnson
  2021-04-20 13:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Johnson @ 2021-04-20 10:31 UTC (permalink / raw)
  To: emacs-orgmode

I'm contributing to an org file python parser to correctly parse durations.

I found the comments in org-duration.el 
(https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31 
<https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31>), 
mentioning that `1d3h5min` is a valid duration format.

So, I expect the following should work:

M-x eval-expression <RET>
(org-duration-string-to-minutes "1d3h5min") <RET>

However, the following error occurred:

(error "Invalid duration format: \"1d3h5min\"")

I also tried adding "1d3h5min" as an EFFORT property, however, resulting 
in the same error. I assume that the comment should be fixed by removing 
this particular example? (Other examples work fine)

-- 
Sincerely,
Johnson



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

* Re: Bug: Incorrect duration format example in comments in 'org-duration.el' [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-04-20 10:31 Bug: Incorrect duration format example in comments in 'org-duration.el' [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Johnson
@ 2021-04-20 13:42 ` Nicolas Goaziou
  2021-04-24  8:49   ` Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2021-04-20 13:42 UTC (permalink / raw)
  To: Johnson; +Cc: emacs-orgmode

Hello,

Johnson <j3soon@gapp.nthu.edu.tw> writes:

> I'm contributing to an org file python parser to correctly parse durations.
>
> I found the comments in org-duration.el
> (https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31 
> <https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31>),
> mentioning that `1d3h5min` is a valid duration format.
>
> So, I expect the following should work:
>
> M-x eval-expression <RET>
> (org-duration-string-to-minutes "1d3h5min") <RET>

I cannot reproduce it. I get 1625.0.

Maybe your Org is too old. So-called "compact" form was introduced after the others.

Regards,
-- 
Nicolas Goaziou


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

* Re: Bug: Incorrect duration format example in comments in 'org-duration.el' [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]
  2021-04-20 13:42 ` Nicolas Goaziou
@ 2021-04-24  8:49   ` Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Johnson @ 2021-04-24  8:49 UTC (permalink / raw)
  To: Johnson, emacs-orgmode

Yes, the issue is due to using an older version of Org.

I searched the change log and saw that the compact form is introduced in 
Org 9.4, while mine is 9.3.

Thanks for your help!

Sincerely,
Johnson

On 4/20/2021 9:42 PM, NicolasGoaziou wrote:
> Hello,
>
> Johnson <j3soon@gapp.nthu.edu.tw> writes:
>
>> I'm contributing to an org file python parser to correctly parse durations.
>>
>> I found the comments in org-duration.el
>> (https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31
>> <https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-duration.el#L31>),
>> mentioning that `1d3h5min` is a valid duration format.
>>
>> So, I expect the following should work:
>>
>> M-x eval-expression <RET>
>> (org-duration-string-to-minutes "1d3h5min") <RET>
> I cannot reproduce it. I get 1625.0.
>
> Maybe your Org is too old. So-called "compact" form was introduced after the others.
>
> Regards,


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

end of thread, other threads:[~2021-04-24  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 10:31 Bug: Incorrect duration format example in comments in 'org-duration.el' [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)] Johnson
2021-04-20 13:42 ` Nicolas Goaziou
2021-04-24  8:49   ` Johnson

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).