From b11abb409c2b1f8c733bf6b2766b3b26e2db8ba3 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 25 Dec 2022 14:20:48 +0300 Subject: [PATCH] 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 Link: https://orgmode.org/list/1852d9eb52f.c4c534f9581400.7140516675874523594@excalamus.com --- lisp/ob-core.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index c2a367375..300c9d92f 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -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))))