emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ted Wiles <thewiles@wharton.upenn.edu>
To: emacs-orgmode@gnu.org
Subject: [PATCH] updated patch to org-habit DONE keywords
Date: Mon, 16 Dec 2013 09:55:26 -0500	[thread overview]
Message-ID: <87ob4gu9pd.fsf@dorewiles.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-a-hard-coded-TODO-keyword.patch --]
[-- Type: text/x-diff; name="0001-Fix-a-hard-coded-TODO-keyword.patch", Size: 1234 bytes --]

From 29ab93933d5e14847a010e699f79e29aada1efcc Mon Sep 17 00:00:00 2001
From: Theodore Wiles <theodore.wiles@gmail.com>
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


             reply	other threads:[~2013-12-16 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 14:55 Ted Wiles [this message]
2013-12-22 23:11 ` [PATCH] updated patch to org-habit DONE keywords Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob4gu9pd.fsf@dorewiles.com \
    --to=thewiles@wharton.upenn.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).