From: Andreas Gerler Date: Wed, 24 Jan 2018 17:03:35 +0000 (+0100) Subject: fix bba-copy-org-src-block. X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=b6e42486637d4935d3ecf02e53b27acaf82a27f9;p=emacsconfig.git fix bba-copy-org-src-block. Copy current block as well if cursor is on begin-src. Signed-off-by: Andreas Gerler --- 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)