forked from mirrors/org-mode
org-babel: Fix insertion of new results
Insertion of new results was failing if the block was followed by end-of-buffer. Also, if the block was followed by non-empty lines, the \#+resname was being inserted away from column 0.
This commit is contained in:
parent
0f85963ae2
commit
4cbedbff1a
|
@ -639,7 +639,8 @@ following the source block."
|
||||||
(looking-at (concat org-babel-result-regexp "\n"))))
|
(looking-at (concat org-babel-result-regexp "\n"))))
|
||||||
;; or (with optional insert) back up and make one ourselves
|
;; or (with optional insert) back up and make one ourselves
|
||||||
(when insert
|
(when insert
|
||||||
(goto-char end) (forward-char 1)
|
(goto-char end)
|
||||||
|
(if (looking-at "[\n\r]") (forward-char 1) (insert "\n"))
|
||||||
(insert (concat "#+results" (if hash (concat "["hash"]"))
|
(insert (concat "#+results" (if hash (concat "["hash"]"))
|
||||||
":"(if name (concat " " name)) "\n"))
|
":"(if name (concat " " name)) "\n"))
|
||||||
(move-beginning-of-line 0)
|
(move-beginning-of-line 0)
|
||||||
|
|
Loading…
Reference in New Issue