From f2b52f411c3580b1539375600e8085060e387bc2 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 26 Oct 2021 22:29:31 +0800 Subject: [PATCH] org.el/org-scan-tags: Fix effort in tags agenda views * lisp/org.el (org-scan-tags): Manually add effort and effort-minutes properties to be used by agenda. --- lisp/org.el | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 21b2c5470..d73df1325 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11592,16 +11592,22 @@ headlines matching this string." (match-beginning 1) (match-end 1))) (org-show-context 'tags-tree)) ((eq action 'agenda) - (setq txt (org-agenda-format-item - "" - (concat - (if (eq org-tags-match-list-sublevels 'indented) - (make-string (1- level) ?.) "") - (org-get-heading)) - (make-string level ?\s) - category - tags-list) - priority (org-get-priority txt)) + (let* ((effort (org-entry-get (point) org-effort-property)) + (effort-minutes (when effort (save-match-data (org-duration-to-minutes effort))))) + (setq txt (org-agenda-format-item + "" + (concat + (if (eq org-tags-match-list-sublevels 'indented) + (make-string (1- level) ?.) "") + (org-add-props + (org-get-heading) + nil + 'effort effort + 'effort-minutes effort-minutes)) + (make-string level ?\s) + category + tags-list) + priority (org-get-priority txt))) (goto-char (org-element-property :begin el)) (setq marker (org-agenda-new-marker)) (org-add-props txt props