Browse Source

org-agenda: `org-agenda-get-progress' set type text-property

* lisp/org-agenda.el (org-agenda-get-progress): Set "type"
  text-property according to why the item was matched.

Previously, the "type" text-property was always set to "closed", even
when an item was actually matched because of its "Clock" or "State"
line.

Note: it's possible that some code might expect the value to be
"closed" in all 3 cases, in which case this could cause a minor
regression, so this change should be carefully considered.  However,
in the long run, it seems like the correct thing to do and a
worthwhile change to make.
Adam Porter 10 months ago
parent
commit
98755f6296
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lisp/org-agenda.el

+ 5 - 2
lisp/org-agenda.el

@@ -5747,7 +5747,7 @@ then those holidays will be skipped."
 			    (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
 		    1 11))))
 	 (org-agenda-search-headline-for-time nil)
-	 marker hdmarker priority category level tags closedp
+	 marker hdmarker priority category level tags closedp type
 	 statep clockp state ee txt extra timestr rest clocked inherited-tags)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
@@ -5807,11 +5807,14 @@ then those holidays will be skipped."
 			(statep (concat "State:     (" state ")"))
 			(t (concat "Clocked:   (" clocked  ")")))
 		       txt level category tags timestr)))
+	  (setq type (cond (closedp "closed")
+			   (statep "state")
+			   (t "clock")))
 	  (setq priority 100000)
 	  (org-add-props txt props
 	    'org-marker marker 'org-hd-marker hdmarker 'face 'org-agenda-done
 	    'priority priority 'level level
-	    'type "closed" 'date date
+	    'type type 'date date
 	    'undone-face 'org-warning 'done-face 'org-agenda-done)
 	  (push txt ee))
 	(goto-char (point-at-eol))))