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: Mamoru Miura
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: Wed, 20 Jul 2022 08:17:40 +0900

Dear Ihor,

Thank you for responding.
The issue is failing to collect (and sum) appointments' duration as
effort even when `org-agenda-columns-add-appointments-to-effort-sum'
is t.

My environment:

* Emacs 28.1
* Org 9.5.4

Here's the setting (~/.emacs.d/init.el):

(setq org-directory "~/org/")
(setq org-agenda-files (list org-directory))
(setq org-columns-default-format "%Item %Effort{:}")
(setq org-agenda-columns-add-appointments-to-effort-sum t)

With putting org-file (~/org/test.org):

* My appointment
  SCHEDULED: <2022-07-20 Wed 10:00-11:00>
* My appointment with effort
  SCHEDULED: <2022-07-20 Wed 11:00-12:00>
  :PROPERTIES:
  :Effort:   0:30
  :END:

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)

Then, you see that the column "Effort" for the item "My appointment"
is empty and not added to the daily effort summation.

Bug investigation and solving approach:

* The function `org-columns--collect-values' collects appointment
duration: 
https://github.com/bzg/org-mode/blob/e0b05b07528dea684f3439c017370436b8d37b50/lisp/org-colview.el#L291
* With running M-x describe-text-properties on the item "My
appointment" in the *Org Agenda* buffer, it has a text property
"duration" and its value is correct (60.0).
Given these facts, the property "duration" seems to disappear
somewhere or the function fails to collect it. (Unfortunately, I
didn't have the room to deep dive into further details.)
* To solve this, instead of collecting value, get the corresponding
item (entry) and recompute the duration from it. I found a computing
function `org-agenda-format-item' and re-use it.

I re-attach a patch because the previous patch contains a bug.

See also (insightful reports by Stanislav):

* 
https://emacs.stackexchange.com/questions/58875/how-do-i-add-appointments-to-effort-sum
* https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00090.html

Kind regards,
Mamoru

Attachment: 0001-lisp-org-colview.el-Fix-missing-addition-of-appointm.patch
Description: Binary data


reply via email to

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