From 22ee116511a40cc9cbee02e66799fdeb3e81ba78 Mon Sep 17 00:00:00 2001 Message-Id: <22ee116511a40cc9cbee02e66799fdeb3e81ba78.1671967390.git.yantar92@posteo.net> 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 @@ (defun org-babel-insert-result (result &optional result-params info hash lang ex (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)))) -- 2.38.1