make insert-src-block handle #+NAME:d blocks
the name of a src block is part of the org-element, so need to go down a line if it's present
This commit is contained in:
parent
699da9cebd
commit
9a430d5844
1 changed files with 5 additions and 1 deletions
|
@ -1253,7 +1253,11 @@ If invoked with a prefix ARG eval the expression after inserting it"
|
||||||
(src-block-head (save-excursion
|
(src-block-head (save-excursion
|
||||||
(goto-char (org-element-property
|
(goto-char (org-element-property
|
||||||
:begin current-src-block))
|
:begin current-src-block))
|
||||||
(thing-at-point 'line t)))
|
(let ((line (thing-at-point 'line t)))
|
||||||
|
(if (not (s-starts-with? "#+NAME:" (s-trim line)))
|
||||||
|
line
|
||||||
|
(forward-line)
|
||||||
|
(thing-at-point 'line t)))))
|
||||||
(point-to-insert
|
(point-to-insert
|
||||||
(if-let (results-loc (org-babel-where-is-src-block-result))
|
(if-let (results-loc (org-babel-where-is-src-block-result))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
|
Loading…
Reference in a new issue