From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: [PATCH] org-clock.el: fix regex to recognize indented clock tables Date: Tue, 16 Nov 2010 00:17:50 +0100 Message-ID: <87wroe2n35.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=46036 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PI8JP-0008Nm-U3 for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 18:18:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PI8JL-00064O-Db for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 18:18:11 -0500 Received: from lo.gmane.org ([80.91.229.12]:36230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PI8JL-00064K-1W for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 18:18:07 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PI8JI-00012D-UV for emacs-orgmode@gnu.org; Tue, 16 Nov 2010 00:18:04 +0100 Received: from p57aad5a6.dip.t-dialin.net ([87.170.213.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Nov 2010 00:18:04 +0100 Received: from Stromeko by p57aad5a6.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Nov 2010 00:18:04 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= org-clock.el: fix regex to recognize indented clock tables * #BEGIN: and #END: were expected only at the first column in some places. * #BEGIN: and #END: were erroneously recognized inside normal lines in other instances. * always allow whitespace after #BEGIN: and #END:, not just a single space TINYCHANGE - This patch is in the public domain. Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf rackAttack V1.04R1: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-clock.el-fix-regex-to-recognize-indented-clock-t.patch Content-Description: org-clock.el: fix regex to recognize indented clock tables >From fa6a2f32a48f295e7b0053637a330d26a505ba8d Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 15 Nov 2010 23:19:34 +0100 Subject: [PATCH] org-clock.el: fix regex to recognize indented clock tables * #BEGIN: and #END: were expected only at the first column in some places. * #BEGIN: and #END: were erroneously recognized inside normal lines in other instances. * always allow whitespace after #BEGIN: and #END:, not just a single space TINYCHANGE - This patch is in the public domain. --- lisp/org-clock.el | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 377c510..3146926 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 "^#\\+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 "^#\\+BEGIN:[ \t]+clocktable" nil t) + (and (re-search-backward "^[ \t]+#\\+BEGIN:[ \t]+clocktable" nil t) (setq start (match-beginning 0)) - (re-search-forward "^#\\+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 "#\\+BEGIN: 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 "#\\+END:") + (re-search-forward "^[ \t]+#\\+END:") (when (and (equal step-time 0) stepskip0) ;; Remove the empty table (delete-region (point-at-bol) -- 1.7.1 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--