emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Allow S-left/S-right editing in indented clocktables
Date: Mon, 13 Jun 2011 19:00:38 +0200	[thread overview]
Message-ID: <87k4cpzmx5.fsf@Rainer.invalid> (raw)

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]


It wasn't possible to use S-up/down/left/right on the clocktable BEGIN
line when the whole table was indented.  Interestingly enough calling
the function directly would work, it turned out to be a regexp in org.el
that was still pinned to bol.  There was a second one further down that
is used to recognize dynamic blocks that got the same treatment.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Allow shift editing of indented clocktables --]
[-- Type: text/x-patch, Size: 1331 bytes --]

From ab9cb1d760f6f45eee026b30793dff0df5d5f719 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Mon, 13 Jun 2011 18:32:53 +0200
Subject: [PATCH] Allow S-left/S-right editing in indented clocktables

* lisp/org.el (org-clocktable-try-shift, org-find-dblock): Fix regexp
  to allow space and tab before the #+BEGIN: cookie

TINYCHANGE
---
 lisp/org.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1b342a6..6c6843b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3902,7 +3902,7 @@ If yes, offer to stop it and to save the buffer with the changes."
 
 (defun org-clocktable-try-shift (dir n)
   "Check if this line starts a clock table, if yes, shift the time block."
-  (when (org-match-line "#\\+BEGIN: clocktable\\>")
+  (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>")
     (org-clocktable-shift dir n)))
 
 ;; Autoload org-timer.el
@@ -10594,7 +10594,7 @@ If not found, stay at current position and return nil."
   (let (pos)
     (save-excursion
       (goto-char (point-min))
-      (setq pos (and (re-search-forward (concat "^#\\+BEGIN:[ \t]+" name "\\>")
+      (setq pos (and (re-search-forward (concat "^[ \t]*#\\+BEGIN:[ \t]+" name "\\>")
 					nil t)
 		     (match-beginning 0))))
     (if pos (goto-char pos))
-- 
1.7.5.4


[-- Attachment #3: Type: text/plain, Size: 177 bytes --]



Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

             reply	other threads:[~2011-06-13 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 17:00 Achim Gratz [this message]
2011-06-15  6:55 ` [PATCH] Allow S-left/S-right editing in indented clocktables Carsten Dominik

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=87k4cpzmx5.fsf@Rainer.invalid \
    --to=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).