all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Change: (org-agenda-get-progress) Set type text-property accordingly
@ 2018-09-01  0:53 Adam Porter
  2018-09-06 19:43 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Porter @ 2018-09-01  0:53 UTC (permalink / raw)
  To: emacs-orgmode

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

Now, the "type" text-property is set according to why the item was
matched.

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.
---
 lisp/org-agenda.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index eaeddb6..50270b4 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))))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Change: (org-agenda-get-progress) Set type text-property accordingly
  2018-09-01  0:53 [PATCH] Change: (org-agenda-get-progress) Set type text-property accordingly Adam Porter
@ 2018-09-06 19:43 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2018-09-06 19:43 UTC (permalink / raw)
  To: Adam Porter; +Cc: emacs-orgmode

Hello,

Adam Porter <adam@alphapapa.net> writes:

> Previously, the "type" text-property was always set to "closed", even
> when an item was actually matched because of its "Clock" or "State"
> line.
>
> Now, the "type" text-property is set according to why the item was
> matched.
>
> 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.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-06 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-01  0:53 [PATCH] Change: (org-agenda-get-progress) Set type text-property accordingly Adam Porter
2018-09-06 19:43 ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.