[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: support range durations
From: |
Guido Stevens |
Subject: |
Re: support range durations |
Date: |
Mon, 16 Sep 2024 10:41:01 +0200 |
User-agent: |
Mozilla Thunderbird |
On 9/15/24 14:02, Ihor Radchenko wrote:
Guido Stevens <guido.stevens@cosent.net> writes:
As per https://orgmode.org/manual/Column-attributes.html I'm using range
durations to express effort estimations. Those get summarized nicely in
column views, using the {est+} summarizer. But when I access an agenda
view that encounters a task that has such a range duration directly set,
the agenda chokes with an error message:
org-duration-to-minutes: Invalid duration format: "1d-2d"
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)
3. Open an agenda view that contains that task (C-c n a t)
org-duration-to-minutes: Invalid duration format: "1d-2d"
...
* lisp/org-duration.el (org-duration-to-minutes): Do not choke on
low-high range durations (e.g. "2d-5d") when rendering an agenda. Calculate the
average
of the range instead.
Range durations are valid when estimating effort, and supported
elsewhere via the {est+} summarizer.
Org mode durations have no notion of ranges. It is completely
org-colview thing. So, modifying `org-duration-to-minutes' is not
appropriate. We need to fix org-colview, not org-duration.
The reproduction above does not involve org-colview.
The disagreement apparently is, that org-colview says range durations
are supported for effort estimates, and even has code handling them via
the {est+} summarizer, when they are not supported in org-duration.
https://github.com/emacs-mirror/emacs/blob/f27553c30a772a0103d2e6762e4d7f588f302e4b/lisp/org/org-colview.el#L1419
I get your point about not accepting this patch. None of the other
functions or docstrings in org-duration mentions or handles ranges, fair
enough.
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
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-agenda-sorting-strategy
'((agenda priority-down)
(todo priority-down)
(tags priority down)
(search priority-down))
)
org-duration-to-minutes is called and throws an error. Why is it even
called?
I'm out of my depth in Lisp and don't know how to properly step that
call flow.
--
Guido Stevens | Cosent | https://cosent.nl
s o c i a l k n o w l e d g e t e c h n o l o g y