From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ted Wiles Subject: [PATCH] updated patch to org-habit DONE keywords Date: Mon, 16 Dec 2013 09:55:26 -0500 Message-ID: <87ob4gu9pd.fsf@dorewiles.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsZa4-0003cC-HB for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 09:55:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsZZy-0007a5-18 for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 09:55:36 -0500 Received: from smtp-relay-212.wharton.upenn.edu ([128.91.89.191]:42322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsZZx-0007Zw-SK for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 09:55:29 -0500 Received: from JIM3.wharton.upenn.edu (jim3.wharton.upenn.edu [128.91.90.13]) by smtp-relay-212.wharton.upenn.edu (8.14.4/8.14.4) with ESMTP id rBGEtSkX019979 for ; Mon, 16 Dec 2013 09:55:28 -0500 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Take care of all DONE keywords, not just the last one. * lisp/org-habit.el This fixed a hard-coded TODO keyword in the org-habit code. Updated to apply to all DONE keywords, as per Aaron Ecay TINYCHANGE --- lisp/org-habit.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index eba9037..63dd27f 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -200,9 +200,11 @@ This list represents a \"habit\" for the rest of this module." (count 0)) (unless reversed (goto-char end)) (while (and (< count maxdays) - (funcall search "- State \"DONE\".*\\[\\([^]]+\\)\\]" limit t)) + (funcall search (format "- State \"%s\".*\\[\\([^]]+\\)\\]" + (concat "\\(" (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)")) + limit t)) (push (time-to-days - (org-time-string-to-time (match-string-no-properties 1))) + (org-time-string-to-time (match-string-no-properties 2))) closed-dates) (setq count (1+ count)))) (list scheduled sr-days deadline dr-days closed-dates)))) -- 1.7.9.5 --=-=-= Content-Type: text/x-diff; name="0001-Fix-a-hard-coded-TODO-keyword.patch" Content-Disposition: attachment; filename="0001-Fix-a-hard-coded-TODO-keyword.patch" Content-Description: 0001-Fix-a-hard-coded-TODO-keyword.patch >From 29ab93933d5e14847a010e699f79e29aada1efcc Mon Sep 17 00:00:00 2001 From: Theodore Wiles Date: Mon, 16 Dec 2013 09:47:01 -0500 Subject: [PATCH] Fix a hard-coded TODO keyword This fixed a hard-coded TODO keyword in the org-habit code. Updated to apply to all DONE keywords, as per Aaron Ecay TINYCHANGE --- lisp/org-habit.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index eba9037..63dd27f 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -200,9 +200,11 @@ This list represents a \"habit\" for the rest of this module." (count 0)) (unless reversed (goto-char end)) (while (and (< count maxdays) - (funcall search "- State \"DONE\".*\\[\\([^]]+\\)\\]" limit t)) + (funcall search (format "- State \"%s\".*\\[\\([^]]+\\)\\]" + (concat "\\(" (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)")) + limit t)) (push (time-to-days - (org-time-string-to-time (match-string-no-properties 1))) + (org-time-string-to-time (match-string-no-properties 2))) closed-dates) (setq count (1+ count)))) (list scheduled sr-days deadline dr-days closed-dates)))) -- 1.7.9.5 --=-=-=--