Ver Fonte

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.
Ihor Radchenko há 3 anos atrás
pai
commit
f2b52f411c
1 ficheiros alterados com 16 adições e 10 exclusões
  1. 16 10
      lisp/org.el

+ 16 - 10
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