Copy current block as well if cursor is on begin-src.
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
"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)