summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Porter <adam@alphapapa.net>2018-08-31 19:53:31 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-09-06 21:41:07 +0200
commit98755f62968d871a9e44ee163030be85c0f4a2d4 (patch)
treefbfa3e50d6676dbd877226b499a7a277c7821a77
parent9029161bcd3d6633dc0347d13aa17629c6268624 (diff)
downloadorg-mode-98755f62968d871a9e44ee163030be85c0f4a2d4.tar.gz
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.
-rw-r--r--lisp/org-agenda.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a60fb60..8019fed 100644
--- a/lisp/org-agenda.el
+++ b/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))))