Handle unicode results in org-tables coming from python

This commit is contained in:
Jeremy Dormitzer 2020-01-29 16:04:36 -05:00
parent 8a78a4298b
commit dce7a9dfc5

View File

@ -1685,6 +1685,25 @@ Enable async source block execution. Note: this execute the contents of the sour
:hook (org-mode . (lambda () (require 'ob-async))))
#+END_SRC
Filter out the "u" from unicode results in org tabels returned from Python source blocks:
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'ob-python
(defun org-babel-python-table-or-string (results)
"Convert RESULTS into an appropriate elisp value.
If the results look like a list or tuple, then convert them into an
Emacs-lisp table, otherwise return the results as a string."
(let ((res (org-babel-script-escape results)))
(if (listp res)
(mapcar (lambda (el)
(cond
((eq el 'None) org-babel-python-None-to)
((listp el) (-filter (lambda (m) (not (eq m 'u))) el))
(t el)))
res)
res))))
#+END_SRC
** Images
#+BEGIN_SRC emacs-lisp
(setq org-image-actual-width nil)