[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG] Regression: org-duration fails to support duration ranges since Or
From: |
Ihor Radchenko |
Subject: |
[BUG] Regression: org-duration fails to support duration ranges since Org 9.0.6 (was: support range durations) |
Date: |
Sun, 22 Sep 2024 07:56:43 +0000 |
Guido Stevens <guido.stevens@cosent.net> writes:
>> May you please provide more details on how to trigger the error?
>
> Sure. I'm providing the Doom keybindings for the actions I'm taking.
>
> 1. Abbreviated snippet from my Doom config:
>
> (use-package! org
> :defer t
> (setq!
> org-global-properties
> `(("Effort_ALL" . "0 0.5d 0.5d-1d 1d 1d-2d"))))
>
> 2. Set estimate "1d-2d" on a task (C-c C-x e)
At this point, using emacs -Q, I am getting
Debugger entered--Lisp error: (error "Invalid duration format: \"1d-2d\"")
error("Invalid duration format: %S" "1d-2d")
In other words, such ranges are not supported in Effort property.
I am not sure what Doom does so that you are not getting that error.
> I'm puzzled though, because I did not come up with this feature. It's
> genuinely useful and it appears to have worked in the past.
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-12/msg00435.html
I bisected the problem back to the initial introduction of org-duration
library. It simply does not support duration ranges.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7e8cf5f4c202f51231d444f41735a4db06cb7052
The right thing appears to be implementing such support in org-duration.
However, it is not at all trivial, as the duration API in
org-duration.el is designed without ranges in mind.
> Maybe sorting agenda views by effort was not active at that stage: I
> suspect that is what is triggering the error. Which points to a
> potential solution (and also to a potential speed optimization): even
> when I am not sorting on effort at all, this error is thrown, so why is
> org-duration-to-minutes even called at all in the agenda view? Is there
> a way to disable that?
>
> I.e. even when I simplify my sorting strategy to:
> ...
> org-duration-to-minutes is called and throws an error. Why is it even
> called?
Agenda converts and stores duration in minutes as a part of calculating
metadata for agenda items. Your duration format cannot be converted to
minutes, leading to the error you are seeing.
My current conclusion is that we unfortunately got a regression since
Org 9.0.6. And it is not very easy to fix it without implementing
range durations across the whole codebase.
One possible "fix" could be making org-duration ignore ending estimate
in the duration ranges, but that's not ideal.
This is a difficult bug to address.
As a workaround, I suggest using some other property for your effort
estimates. Then, est+ summary in column view will work without errors.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>