ob-python: Small refactoring

* lisp/ob-python.el (org-babel-python-evaluate-session): Small
  refactoring.
This commit is contained in:
Nicolas Goaziou 2018-04-03 21:27:59 +02:00
parent 1966d58b25
commit 3e1f111c3b

View file

@ -310,9 +310,10 @@ last statement in BODY, as elisp."
'noquote)))))))
(last-indent 0)
(input-body (lambda (body)
(mapc (lambda (line)
;; Insert a blank line to end an indent block.
(let ((curr-indent (string-match "[^\s]" line)))
(dolist (line (split-string body "[\r\n]"))
;; Insert a blank line to end an indent
;; block.
(let ((curr-indent (string-match "\\S-" line)))
(if curr-indent
(progn
(when (< curr-indent last-indent)
@ -322,7 +323,6 @@ last statement in BODY, as elisp."
(setq last-indent 0)))
(insert line)
(funcall send-wait))
(split-string body "[\r\n]"))
(funcall send-wait)))
(results
(pcase result-type