From e4da74c452f945274a8586be2803ed6b3a31b0bc Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 22 Feb 2015 17:26:21 +0100 Subject: [PATCH] org-habit: Fix 6652baa39db26df8a8ac5dbbe40f3de91bf1a6b1 * lisp/org-habit.el (org-habit-parse-todo): Fix regexp introduced in 6652baa39db26df8a8ac5dbbe40f3de91bf1a6b1. --- lisp/org-habit.el | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index abbbe62c9..203ef27ab 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -199,23 +199,22 @@ This list represents a \"habit\" for the rest of this module." (limit (if reversed end (point))) (count 0) (re (format - "^[ \t]*-[ \t]+\\(?:%s\\)" - (mapconcat - (lambda (type) - (let ((value (cdr (assq type org-log-note-headings)))) - (when value - (org-replace-escapes - (regexp-quote value) - `(("%d" . ,org-ts-regexp-inactive) - ("%D" . ,org-ts-regexp) - ("%s" . "\"\\S-+\"") - ("%S" . "\"\\S-+\"") - ("%t" . ,org-ts-regexp-inactive) - ("%T" . ,org-ts-regexp) - ("%u" . ".*?") - ("%U" . ".*?")))))) - '(state done) - "\\|")))) + "^[ \t]*-[ \t]+\\(?:State \"%s\".*%s%s\\)" + (regexp-opt org-done-keywords) + org-ts-regexp-inactive + (let ((value (cdr (assq 'done org-log-note-headings)))) + (if (not value) "" + (concat "\\|" + (org-replace-escapes + (regexp-quote value) + `(("%d" . ,org-ts-regexp-inactive) + ("%D" . ,org-ts-regexp) + ("%s" . "\"\\S-+\"") + ("%S" . "\"\\S-+\"") + ("%t" . ,org-ts-regexp-inactive) + ("%T" . ,org-ts-regexp) + ("%u" . ".*?") + ("%U" . ".*?"))))))))) (unless reversed (goto-char end)) (while (and (< count maxdays) (funcall search re limit t)) (push (time-to-days -- 2.11.4.GIT