summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2010-11-20 11:43:45 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2010-11-20 12:26:02 +0100
commitc906a75e48751e0e685458f307ed98c3dce154b0 (patch)
tree01f9ed2531a4d90c80c4a514093995a67369b526
parent967c71f5efa6d7ba12dcfff100ff1dedcb8d30a0 (diff)
downloadorg-mode-c906a75e48751e0e685458f307ed98c3dce154b0.tar.gz
org-clock.el: fix regex to recognize indented clock tables
* lisp/org-clock.el (org-get-clocktable) previous patch incorrectly required whitespace in front of #+BEGIN: and #+END: TINYCHANGE - This patch is in the public domain.
-rw-r--r--lisp/org-clock.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 3146926..e798027 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1623,7 +1623,7 @@ fontified, and then returned."
(font-lock-fontify-buffer)
(forward-line 2)
(buffer-substring (point) (progn
- (re-search-forward "^[ \t]+#\\+END" nil t)
+ (re-search-forward "^[ \t]*#\\+END" nil t)
(point-at-bol)))))
(defun org-clock-report (&optional arg)
@@ -1648,9 +1648,9 @@ buffer and update it."
(let ((pos (point)) start)
(save-excursion
(end-of-line 1)
- (and (re-search-backward "^[ \t]+#\\+BEGIN:[ \t]+clocktable" nil t)
+ (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
(setq start (match-beginning 0))
- (re-search-forward "^[ \t]+#\\+END:.*" nil t)
+ (re-search-forward "^[ \t]*#\\+END:.*" nil t)
(>= (match-end 0) pos)
start))))
@@ -1741,7 +1741,7 @@ the currently selected interval size."
(and (memq dir '(left down)) (setq n (- n)))
(save-excursion
(goto-char (point-at-bol))
- (if (not (looking-at "^[ \t]+#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
+ (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
(error "Line needs a :block definition before this command works")
(let* ((b (match-beginning 1)) (e (match-end 1))
(s (match-string 1))
@@ -2134,7 +2134,7 @@ from the dynamic block defintion."
"Weekly report starting on: ")
(plist-get p1 :tstart) "\n")
(setq step-time (org-dblock-write:clocktable p1))
- (re-search-forward "^[ \t]+#\\+END:")
+ (re-search-forward "^[ \t]*#\\+END:")
(when (and (equal step-time 0) stepskip0)
;; Remove the empty table
(delete-region (point-at-bol)