org-babel-execute-src-block: Ensure that buffer is not changed

* lisp/ob-core.el (org-babel-execute-src-block): Ensure that we insert
results into the buffer where the src block is located.  Even when the
execution yields changing current buffer.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CAJ51ETqMBqiHy+W3CZ+EtSPzVb1ihbX6v+NQsZKojN6jF8zoBQ@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2022-10-29 12:43:03 +08:00
parent a51bb2c448
commit c70a422082
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -805,7 +805,7 @@ guess will be made."
(format "at position %d" (nth 5 info)))))
(setq exec-start-time (current-time)
result
(let ((r (funcall cmd body params)))
(let ((r (save-current-buffer (funcall cmd body params))))
(if (and (eq (cdr (assq :result-type params)) 'value)
(or (member "vector" result-params)
(member "table" result-params))