From b6e42486637d4935d3ecf02e53b27acaf82a27f9 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 24 Jan 2018 18:03:35 +0100 Subject: [PATCH] fix bba-copy-org-src-block. Copy current block as well if cursor is on begin-src. Signed-off-by: Andreas Gerler --- bba.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bba.org b/bba.org index ce80cf88..c9f6450f 100644 --- a/bba.org +++ b/bba.org @@ -1145,13 +1145,14 @@ This is helpful in training sessions. "copy last org src block. Can be around point, too." (interactive) (push-mark) - (re-search-backward "\#\\+BEGIN_SRC") - (previous-line) + (goto-char (point-at-bol)) + (if (not (looking-at "\#\\+BEGIN_SRC"))(re-search-backward "\#\\+BEGIN_SRC")) + (forward-line -1) (if (not (looking-at "\#"))(forward-line)) (set-mark-command nil) (re-search-forward "\#\\+END_SRC") (forward-line) - (beginning-of-line) + (goto-char (point-at-bol)) (kill-ring-save 1 1 1) (set-mark-command '1) (set-mark-command '1) -- 2.47.3