emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Bug: Appointments duration and effort sums in agenda column view [9.


From: Ihor Radchenko
Subject: Re: Bug: Appointments duration and effort sums in agenda column view [9.3.7 (release_9.3.7-700-ga1e5be @ ~/.emacs.d/straight/build/org/)]
Date: Thu, 21 Jul 2022 19:48:52 +0800

Mamoru Miura <mamo3gr@gmail.com> writes:

> ...
> Steps to see this issue:
>
> 1. run M-x org-agenda
> 2. type "a" to show "agenda for current week or day"
> 3. run M-x org-agenda-columns (C-c C-x C-c)

Thanks for providing the details! I have also found the relevant thread.
It was not immediately visible because of my MUA settings.

> -                          (get-text-property (point) 'duration)
> -                          (propertize (org-duration-from-minutes
> -                                       (get-text-property (point) 'duration))
> -                                      'face 'org-warning))
> +                          (when-let* ((formatted-item 
> (org-agenda-format-item nil (org-get-entry) nil nil nil t))
> +                                      (duration-string (get-text-property 0 
> 'duration formatted-item)))
> +                            (propertize (org-duration-from-minutes 
> duration-string) 'face 'org-warning)))

I cannot say that I like calling org-agenda functions, but I cannot
propose anything better either (agenda code sucks...).

Ideally, we should factor out the duration calculation from the depths
of the agenda code into a separate function and then use it. But I am
not even sure if this calculation is always same in different agenda
types...

For the code, it will err when the time range is located inside the
headline and org-agenda-search-headline-for-time is set to non-nil
(which it is, by default)

Best,
Ihor



reply via email to

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