]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
tweaking bba-copy-and-yank-org-src-block and friends
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:07:27 +0000 (16:07 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:07:27 +0000 (16:07 +0200)
* copy line above org src block if it might contain a name.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
bba.org

diff --git a/bba.org b/bba.org
index 77c8f103702906c81ed8e3b43b07c98365a23aee..b3f311940a5209596b5504a9fdf8ecea85ddc961 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -1074,6 +1074,8 @@ This is helpful in training sessions.
            (setq -p1 (region-beginning) -p2 (region-end))
            (setq mark-active nil)
            (re-search-backward "\#\\+BEGIN_SRC")
+        (previous-line)
+        (if  (not (looking-at "\#"))(forward-line))
            (set-mark-command nil)
            (forward-line)
            (beginning-of-line)
@@ -1096,6 +1098,8 @@ This is helpful in training sessions.
       (progn
        (push-mark)
        (re-search-backward "\#\\+BEGIN_SRC")
+    (previous-line)
+    (if  (not (looking-at "\#"))(forward-line))
        (set-mark-command nil)
        (re-search-forward "\#\\+END_SRC")
        (forward-line)
@@ -1114,6 +1118,8 @@ This is helpful in training sessions.
     (interactive)
     (push-mark)
     (re-search-backward "\#\\+BEGIN_SRC")
+    (previous-line)
+    (if  (not (looking-at "\#"))(forward-line))
     (set-mark-command nil)
     (re-search-forward "\#\\+END_SRC")
     (forward-line)