1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

org-agenda-get-todos: Fix effort-up sorting in todo agenda

* lisp/org-agenda.el (org-agenda-get-todos): Calculate effort-minutes
before adding it as text property in agenda line.

Reported in https://old.reddit.com/r/emacs/comments/qfqcip/sorting_by_effort_doesnt_work_on_latest_org/
This commit is contained in:
Ihor Radchenko 2021-10-26 09:41:54 +08:00
parent 9dc08c9093
commit cf8906eee0
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -5577,6 +5577,7 @@ and the timestamp type relevant for the sorting strategy in
category (org-get-category)
effort (save-match-data (or (get-text-property (point) 'effort)
(org-entry-get (point) org-effort-property)))
effort-minutes (when effort (save-match-data (org-duration-to-minutes effort)))
ts-date-pair (org-agenda-entry-get-agenda-timestamp (point))
ts-date (car ts-date-pair)
ts-date-type (cdr ts-date-pair)
@ -5596,7 +5597,6 @@ and the timestamp type relevant for the sorting strategy in
'effort-minutes effort-minutes)
level category tags t)
priority (1+ (org-get-priority txt)))
(setq effort-minutes (when effort (save-match-data (org-duration-to-minutes effort))))
(org-add-props txt props
'org-marker marker 'org-hd-marker marker
'priority priority