Browse Source

Small rewrite of the previous commit.

Use `regexp-opt' instead of `regexp-quote'.
Bastien Guerry 11 years ago
parent
commit
fc3857b310
1 changed files with 4 additions and 8 deletions
  1. 4 8
      lisp/org-habit.el

+ 4 - 8
lisp/org-habit.el

@@ -200,15 +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
-		     (format "- State \"%s\".*\\[\\([^]]+\\)\\]"
-			     (concat "\\("
-				     (mapconcat 'regexp-quote
-						org-done-keywords "\\|") "\\)"))
-		     limit t))
+		    (funcall search (format "- State \"%s\".*\\[\\([^]]+\\)\\]"
+					    (regexp-opt org-done-keywords))
+			     limit t))
 	  (push (time-to-days
-		 (org-time-string-to-time (match-string-no-properties 2)))
+		 (org-time-string-to-time (match-string-no-properties 1)))
 		closed-dates)
 	  (setq count (1+ count))))
       (list scheduled sr-days deadline dr-days closed-dates))))