about summary refs log tree commit diff
path: root/+bindings.el
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2020-05-27T14·17-0400
committerGriffin Smith <root@gws.fyi>2020-05-27T14·17-0400
commit9a430d5844c5ad3799322dc13380c90ab3f84462 (patch)
treea7138c50fc4a2afb409e379bc656402d4b5325ff /+bindings.el
parent699da9cebdeefc2fdba47dbe98fa95752d6472c1 (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
Diffstat (limited to '+bindings.el')
-rw-r--r--+bindings.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/+bindings.el b/+bindings.el
index 9596d485f2..e2dec2a3ad 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