From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: [PATCH] Change: (org-agenda-get-progress) Set type text-property accordingly Date: Fri, 31 Aug 2018 19:53:31 -0500 Message-ID: <87va7q3uno.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvuFd-0003fD-Nq for emacs-orgmode@gnu.org; Fri, 31 Aug 2018 20:59:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvuAX-0006en-8Z for emacs-orgmode@gnu.org; Fri, 31 Aug 2018 20:53:44 -0400 Received: from [195.159.176.226] (port=54530 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvuAX-0006dg-1K for emacs-orgmode@gnu.org; Fri, 31 Aug 2018 20:53:41 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fvu8N-0004ta-6O for emacs-orgmode@gnu.org; Sat, 01 Sep 2018 02:51:27 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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