emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Achim Gratz <Stromeko@NexGo.DE>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-clock.el: fix regex to recognize indented clock tables
Date: Tue, 16 Nov 2010 10:23:19 +0100	[thread overview]
Message-ID: <E33072E2-C4E5-4068-A7AA-8A83E3829D8E@gmail.com> (raw)
In-Reply-To: <87wroe2n35.fsf@Rainer.invalid>

Applied, thanks Achim.

- Carsten

On Nov 16, 2010, at 12:17 AM, Achim Gratz wrote:

>
> 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
> From fa6a2f32a48f295e7b0053637a330d26a505ba8d Mon Sep 17 00:00:00 2001
> From: Achim Gratz <Stromeko@Stromeko.DE>
> 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
>
> _______________________________________________
> 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

- Carsten

      reply	other threads:[~2010-11-16  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15 23:17 [PATCH] org-clock.el: fix regex to recognize indented clock tables Achim Gratz
2010-11-16  9:23 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E33072E2-C4E5-4068-A7AA-8A83E3829D8E@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=Stromeko@NexGo.DE \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).