From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ted Wiles Subject: [PATCH] quick patch to org-habit todo state keywords Date: Sun, 15 Dec 2013 22:24:36 -0500 Message-ID: <87haa9a363.fsf@dorewiles.com> References: <87ppp415n4.fsf@gmail.com>, <87bo0nu79v.fsf@gmail.com>, <87haaf1bgi.fsf@gmail.com>, <8761qvxg2o.fsf@gmail.com>, <87r49ik0qw.fsf@gmail.com>, <87txeevus8.fsf@gmail.com>, <87ob4lkhmo.fsf@gmail.com>, <87lhzpx0d7.fsf@gmail.com>, <87fvptfpuy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsOna-00031K-Qn for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 22:24:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsOnU-0006VP-DU for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 22:24:50 -0500 Received: from smtp-relay-212.wharton.upenn.edu ([128.91.89.191]:48353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsOnU-0006VD-6F for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 22:24:44 -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 rBG3OdaX018099 for ; Sun, 15 Dec 2013 22:24:39 -0500 In-Reply-To: <87fvptfpuy.fsf@gmail.com> 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 Cc: "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain Took out the hardcoded todo-state * lisp/org-habit.el The "DONE" keyword was hardcoded in. This is my first patch (ever, to anything). TINYCHANGE 1 file changed, 2 insertions(+), 1 deletion(-) lisp/org-habit.el | 3 ++- Modified lisp/org-habit.el diff --git a/lisp/org-habit.el b/lisp/org-habit.el index eba9037..69d0fa6 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -200,7 +200,8 @@ 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\".*\\[\\([^]]+\\)\\]" + (car (reverse (car org-todo-keywords)))) limit t)) (push (time-to-days (org-time-string-to-time (match-string-no-properties 1))) closed-dates) --=-=-= Content-Type: text/x-diff; name="0001-Took-out-the-hardcoded-todo-state.patch" Content-Disposition: inline; filename="0001-Took-out-the-hardcoded-todo-state.patch" Content-Description: 0001-Took-out-the-hardcoded-todo-state.patch >From 1f486cdb5fffd83cd0fc065e86be4032fc368ee7 Mon Sep 17 00:00:00 2001 From: Theodore Wiles Date: Sun, 15 Dec 2013 21:56:25 -0500 Subject: [PATCH] Took out the hardcoded todo-state. --- lisp/org-habit.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index eba9037..69d0fa6 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -200,7 +200,8 @@ 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\".*\\[\\([^]]+\\)\\]" + (car (reverse (car org-todo-keywords)))) limit t)) (push (time-to-days (org-time-string-to-time (match-string-no-properties 1))) closed-dates) -- 1.7.9.5 --=-=-=--