emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Guido Stevens <guido.stevens@cosent.net>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: support range durations
Date: Mon, 16 Sep 2024 10:41:01 +0200	[thread overview]
Message-ID: <4b0d8deb-585e-4dd5-a332-72de057a3247@cosent.net> (raw)
In-Reply-To: <8734m1ktv9.fsf@localhost>

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


  reply	other threads:[~2024-09-16  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 12:01 support range durations Guido Stevens
2024-09-15 12:02 ` Ihor Radchenko
2024-09-16  8:41   ` Guido Stevens [this message]
2024-09-22  7:56     ` [BUG] Regression: org-duration fails to support duration ranges since Org 9.0.6 (was: support range durations) Ihor Radchenko
2024-09-23 12:21       ` [BUG] Regression: org-duration fails to support duration ranges since Org 9.0.6 Guido Stevens

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=4b0d8deb-585e-4dd5-a332-72de057a3247@cosent.net \
    --to=guido.stevens@cosent.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).