From 9a430d5844c5ad3799322dc13380c90ab3f84462 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 27 May 2020 10:17:14 -0400 Subject: 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 --- +bindings.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1