From 4ef5b67af22469bf2591dda0b9b90db1f4df8617 Mon Sep 17 00:00:00 2001 From: Chunyang Xu Date: Sun, 13 Aug 2017 15:08:52 +0800 Subject: [PATCH] ob-core: Fix indentation * lisp/ob-core.el (org-babel-insert-result): Track the end position of the result block with the marker 'end'. TINYCHANGE --- lisp/ob-core.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index f8a660312..dd1efb710 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2290,6 +2290,7 @@ INFO may provide the values of these header arguments (in the (org-escape-code-in-region (min (point) end) end)) (goto-char end) (unless no-newlines (goto-char (point-at-eol))) + (when (markerp end) (set-marker end nil)) (setq end (point-marker)))) (tabulablep (lambda (r) @@ -2384,8 +2385,8 @@ INFO may provide the values of these header arguments (in the ;; Hard code {{{results(...)}}} on top of customization. (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) - (org-babel-examplify-region beg end results-switches inline) - (setq end (point)))))) + (set-marker-insertion-type end t) + (org-babel-examplify-region beg end results-switches inline))))) ;; Possibly indent results in par with #+results line. (when (and (not inline) (numberp indent) (> indent 0) ;; In this case `table-align' does the work @@ -2398,6 +2399,7 @@ INFO may provide the values of these header arguments (in the (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) + (when (markerp end) (set-marker end nil)) (when outside-scope (narrow-to-region visible-beg visible-end)) (set-marker visible-beg nil) (set-marker visible-end nil))))))) -- 2.14.1