From c9d76b191d665e51aa3cea42b86befdc2fe4390c Mon Sep 17 00:00:00 2001 From: Joe Vornehm Jr Date: Sat, 31 Dec 2011 02:05:55 -0500 Subject: [PATCH] Fix regexps in org-clock.el * org-clock.el (org-clock-in): Remove extraneous space from regexp used to find dangling clock lines when resuming a clock. Also apply `regexp-quote' where org-clock-string is used in a regexp. (org-clock-find-position): Remove extraneous space from regexp used to find dangling clock lines when resuming a clock. Also apply `regexp-quote' where org-clock-string is used in a regexp. I have been seeing errors of "Cannot restart clock because task does not contain unfinished clock" when auto-resuming a saved (persistent) clock. Deleting the extra space (in `org-clock-in' at least) puts an end to these errors. TINYCHANGE --- lisp/org-clock.el | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b29f47b..7ad76d5 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1115,7 +1115,7 @@ the clocking selection, associated with the letter `d'." (cond ((and org-clock-in-resume (looking-at - (concat "^[ \t]* " org-clock-string + (concat "^[ \t]*" (regexp-quote org-clock-string) " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$"))) (message "Matched %s" (match-string 1)) @@ -1239,7 +1239,7 @@ line and position cursor in that line." (or (bolp) (newline)) (point))) (end (progn (outline-next-heading) (point))) - (re (concat "^[ \t]*" org-clock-string)) + (re (concat "^[ \t]*" (regexp-quote org-clock-string))) (cnt 0) (drawer (if (stringp org-clock-into-drawer) org-clock-into-drawer "LOGBOOK")) @@ -1247,7 +1247,7 @@ line and position cursor in that line." (goto-char beg) (when (and find-unclosed (re-search-forward - (concat "^[ \t]* " org-clock-string + (concat "^[ \t]*" (regexp-quote org-clock-string) " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$") end t)) -- 1.7.5.1