diff options
author | Griffin Smith <root@gws.fyi> | 2020-05-27T14·17-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-05-27T14·17-0400 |
commit | 9a430d5844c5ad3799322dc13380c90ab3f84462 (patch) | |
tree | a7138c50fc4a2afb409e379bc656402d4b5325ff | |
parent | 699da9cebdeefc2fdba47dbe98fa95752d6472c1 (diff) |
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
-rw-r--r-- | +bindings.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/+bindings.el b/+bindings.el index 9596d485f2a1..e2dec2a3ad74 100644 --- a/+bindings.el +++ b/+bindings.el @@ -1253,7 +1253,11 @@ If invoked with a prefix ARG eval the expression after inserting it" (src-block-head (save-excursion (goto-char (org-element-property :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 (if-let (results-loc (org-babel-where-is-src-block-result)) (save-excursion |