emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

support range durations


From: Guido Stevens
Subject: support range durations
Date: Wed, 11 Sep 2024 14:01:18 +0200
User-agent: Mozilla Thunderbird

Hi all,

I'm new to this list and joined in order to submit the attached tiny patch.

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"

Attached patch fixes that error, by

1. Just before throwing that error, checking if this is potentially a range duration, of two durations separated by a "-"

2. If so, split the range into two separate <low> and <high> durations, convert each of those to minutes, and take the average.

The patch doesn't use a fancy regexp. Instead, it recurses into org-duration-to-minutes and reapplies all sanity checks on the constituent low/high durations. If you have two valid durations connected by a dash (and optionally whitespace), that's a valid range duration, and it will be expressed as a float. If not, you'll hit the error fallback directly below.

Applying this patch fixes my agenda view when using range durations. Since the actual code change is just 2 lines, I opted to forego the FSF copyright assignment caroussel by marking this a TINYCHANGE.

Patch is based off e269942a353965dd8bdad57741adc9c53116a08a which is my current Doom Emacs checkout of https://github.com/emacs-straight/org-mode. I hope that's fine.

Kind regards, Guido.
--
    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

Attachment: 0001-lisp-org-duration.el-support-range-durations.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]