emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] updated patch to org-habit DONE keywords
@ 2013-12-16 14:55 Ted Wiles
  2013-12-22 23:11 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Ted Wiles @ 2013-12-16 14:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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


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

* Re: [PATCH] updated patch to org-habit DONE keywords
  2013-12-16 14:55 [PATCH] updated patch to org-habit DONE keywords Ted Wiles
@ 2013-12-22 23:11 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2013-12-22 23:11 UTC (permalink / raw)
  To: Ted Wiles; +Cc: emacs-orgmode

Hi Ted,

Ted Wiles <thewiles@wharton.upenn.edu> writes:

> 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

Applied, with a tiny rewrite of the commit message.

Thanks!

-- 
 Bastien

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

end of thread, other threads:[~2013-12-22 23:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 14:55 [PATCH] updated patch to org-habit DONE keywords Ted Wiles
2013-12-22 23:11 ` Bastien

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).