* copy line above org src block if it might contain a name.
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
(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)
(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)
(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)