ob-emacs-lisp.el: Don't wrap execution within `save-window-excursion'
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Don't wrap execution within `save-window-excursion'. Reported-by: Ihor Radchenko <yantar92@gmail.com> https://orgmode.org/list/87tv5vt545.fsf@gmail.com
This commit is contained in:
parent
69a91ba8bc
commit
81d49b5adb
|
@ -61,31 +61,30 @@ by `org-edit-src-code'.")
|
|||
|
||||
(defun org-babel-execute:emacs-lisp (body params)
|
||||
"Execute a block of emacs-lisp code with Babel."
|
||||
(save-window-excursion
|
||||
(let* ((lexical (cdr (assq :lexical params)))
|
||||
(result-params (cdr (assq :result-params params)))
|
||||
(body (format (if (member "output" result-params)
|
||||
"(with-output-to-string %s\n)"
|
||||
"(progn %s\n)")
|
||||
(org-babel-expand-body:emacs-lisp body params)))
|
||||
(result (eval (read (if (or (member "code" result-params)
|
||||
(member "pp" result-params))
|
||||
(concat "(pp " body ")")
|
||||
body))
|
||||
(org-babel-emacs-lisp-lexical lexical))))
|
||||
(org-babel-result-cond result-params
|
||||
(let ((print-level nil)
|
||||
(print-length nil))
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params))
|
||||
(format "%S" result)
|
||||
(format "%s" result)))
|
||||
(org-babel-reassemble-table
|
||||
result
|
||||
(org-babel-pick-name (cdr (assq :colname-names params))
|
||||
(cdr (assq :colnames params)))
|
||||
(org-babel-pick-name (cdr (assq :rowname-names params))
|
||||
(cdr (assq :rownames params))))))))
|
||||
(let* ((lexical (cdr (assq :lexical params)))
|
||||
(result-params (cdr (assq :result-params params)))
|
||||
(body (format (if (member "output" result-params)
|
||||
"(with-output-to-string %s\n)"
|
||||
"(progn %s\n)")
|
||||
(org-babel-expand-body:emacs-lisp body params)))
|
||||
(result (eval (read (if (or (member "code" result-params)
|
||||
(member "pp" result-params))
|
||||
(concat "(pp " body ")")
|
||||
body))
|
||||
(org-babel-emacs-lisp-lexical lexical))))
|
||||
(org-babel-result-cond result-params
|
||||
(let ((print-level nil)
|
||||
(print-length nil))
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params))
|
||||
(format "%S" result)
|
||||
(format "%s" result)))
|
||||
(org-babel-reassemble-table
|
||||
result
|
||||
(org-babel-pick-name (cdr (assq :colname-names params))
|
||||
(cdr (assq :colnames params)))
|
||||
(org-babel-pick-name (cdr (assq :rowname-names params))
|
||||
(cdr (assq :rownames params)))))))
|
||||
|
||||
(defun org-babel-emacs-lisp-lexical (lexical)
|
||||
"Interpret :lexical source block argument.
|
||||
|
|
Loading…
Reference in New Issue