1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

org-babel-insert-result: Output strings as is for lists of strings

* lisp/ob-core.el (org-babel-insert-result): Do not use %S format for
lists of strings in :results list output.  This is more consistent
with single string output.

Reported-by: Matt <matt@excalamus.com>
Link: https://orgmode.org/list/1852d9eb52f.c4c534f9581400.7140516675874523594@excalamus.com
This commit is contained in:
Ihor Radchenko 2022-12-25 14:20:48 +03:00
parent 9c79aedec7
commit b11abb409c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -2461,13 +2461,18 @@ INFO may provide the values of these header arguments (in the
(insert
(org-trim
(org-list-to-org
;; We arbitrarily choose to format non-strings
;; as %S.
(cons 'unordered
(mapcar
(lambda (e)
(cond
((stringp e) (list e))
((listp e)
(mapcar (lambda (x) (format "%S" x)) e))
(mapcar
(lambda (x)
(if (stringp x) x (format "%S" x)))
e))
(t (list (format "%S" e)))))
(if (listp result) result
(split-string result "\n" t))))