From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id sDydOc4CMGaQvQAA62LTzQ:P1 (envelope-from ) for ; Mon, 29 Apr 2024 22:27:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sDydOc4CMGaQvQAA62LTzQ (envelope-from ) for ; Mon, 29 Apr 2024 22:27:59 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=adamkovic.org header.s=fm1 header.b="B 0eLfBc"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=Sv92kQnK; dmarc=pass (policy=none) header.from=adamkovic.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714422478; a=rsa-sha256; cv=none; b=pMzK1R13iuvl/Vbn9EPXzB4rqj/ns2A7zC8r0/YoqAJhNsRvwKgvnVxfP9u8yt68CxClDX jzbQ1zlZ+5WizTBIH2b3Gil4Dje3TLJdoKN/ItYRi3D9/9PMQNpbRmU8iMyF0dI6fwbTTP e7Te873dcTMCxQk+5QmJd9da0hdFFagz9Cx7pqBZ5FjNtfy2ugziTszXRk+yVGsq1Pluj1 VZdys0egEtNwlSirsj0NYBCKGoxRegGydnGqkH85HJ7jveauinzny8ngBKHaJfEaE7MdTQ EmXdaBrV8ZdHqNf9Xi46NOTkQPOVRn0mEGFtuCd7EhscO9+BKop5F2Aqic9Dqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=adamkovic.org header.s=fm1 header.b="B 0eLfBc"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=Sv92kQnK; dmarc=pass (policy=none) header.from=adamkovic.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714422478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4q15QUtMsXlKa2P3+sqJto1M8wdQojQehekN0Z3fk1U=; b=SCVH/eQsH4/aqeWecZv4yO5qx1BCcO3JaxsuQ48ITIZnUihIbKjPQDYDzKZNC9wmMX/ftU LDSK0pm3HnLF6+Kwhbxy3cG+bu5YvyAVn8kOaHN+B7Oour0neLF5vm/629VB8VU+iSE8Q9 0YXL47glgG/fcnM+ZF34k/KWK79JBMeVG/QZFToGCtC69LJ9pSJ+tR8vTkQvjmxmEatOW4 p6iTsh17oGnfCWrTdtvlUsIUql3vK/O7ja2C2cTwFQWgLpSPpE2KM7SvcxX6v7q9K/k5tg +WSLgCnRYAXfCfw8X0wxi/2m3Ks7ZgsR84dN/9bHyvB+j2QxpcjdVwzAqrwWXg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 85B9765725 for ; Mon, 29 Apr 2024 22:27:57 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1Xad-0002lz-7r; Mon, 29 Apr 2024 16:27:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1Xaa-0002ll-Jn for emacs-orgmode@gnu.org; Mon, 29 Apr 2024 16:27:05 -0400 Received: from wfhigh3-smtp.messagingengine.com ([64.147.123.154]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1XaY-00011D-3l for emacs-orgmode@gnu.org; Mon, 29 Apr 2024 16:27:04 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 5242D1800147; Mon, 29 Apr 2024 16:27:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 29 Apr 2024 16:27:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamkovic.org; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1714422419; x= 1714508819; bh=4q15QUtMsXlKa2P3+sqJto1M8wdQojQehekN0Z3fk1U=; b=B 0eLfBcmxJFtj9pmIKVvwEadx1PxPcwEKuPVN1YW+PFFMeWnuNbnzuP5NE2Fult6f 40Fc0hn8zc0WyZbJKhVaJsIdz4P0JPr/23l6LkD7nX7lQJJiTUcPL4ptTjtvudHT pk1b6QsBeverGu+gHUf2NVLZpClPoQVnPdM6E3vWkHIguMO+HjcSiDrmFGKv+1fa UJWeF6FGyiUkWxSIwFj7W9BSdLlrHh8+tA3FxkH5XxOBzU8cd7+OL/HPO8E/rm62 NyxqNAEruDxq8WVG/OiV+66vuMcmtIqqk+MiVP/zmGqjt81KpKyhmvfncU+JaEFI vIe+ZrPGX2zsb7+a6h2pw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1714422419; x=1714508819; bh=4q15QUtMsXlKa2P3+sqJto1M8wdQ ojQehekN0Z3fk1U=; b=Sv92kQnKq/fdM4CDhpDCmGt2ngTBRkrkr7JGygExN5kg JTamsY5V6x2zgwXslNWj2jPOf7dWS6nPxJs4uP+otkRXtiBrNxpuBFs57wdD1X1b KlxkcRMWldGMPBGcndDkFQbTk+Mqebczyzl8NphLp70DWDXnR0lIS7haQL8/XhIb aiRH/QDgGbtsVr+RtcnozDkvk68hiwAkeOH35ObwpGRSou7bjJ2cx03lN/Yonqmz bJ/VmXnj8PuEQ4xVsnHSUDUvzn3I7iz82d06V2tkd9N5gti28oOTYTYdZIjDu0rS ZW9PXSXP6sia+BNuSMhuYotfd67mIouTASWzeWccUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdduuddgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefujghffffkgggtsehmtd erredttdejnecuhfhrohhmpeftuhguohhlfhcutegurghmkhhovhhitgcuoehruhguohhl fhesrggurghmkhhovhhitgdrohhrgheqnecuggftrfgrthhtvghrnhepveekkefhuedvte ehtdejjeehudeludeuleeiudfggeevfeejkeejvedtteelgfevnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhhuugholhhfsegruggrmhhkoh hvihgtrdhorhhg X-ME-Proxy: Feedback-ID: i88214938:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Apr 2024 16:26:58 -0400 (EDT) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] ob-lua: Support all types and multiple values in results In-Reply-To: References: <20240423164458.33702-1-rudolf@adamkovic.org> <8734raewr6.fsf@localhost> <87pluctf6m.fsf@localhost> <87il01k6k1.fsf@localhost> Date: Mon, 29 Apr 2024 22:26:57 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.147.123.154; envelope-from=rudolf@adamkovic.org; helo=wfhigh3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 85B9765725 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -10.57 X-Spam-Score: -10.57 X-TUID: u4AiCJtIkzn9 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rudolf Adamkovi=C4=8D writes: > Definitely! I am on it. All right, how about the attached patch? Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-lua-Quote-list-like-strings-sort-tables-and-parse.patch >From 40270bc62f951cfd20916c17e2dfc52863d6b8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Mon, 29 Apr 2024 21:42:04 +0200 Subject: [PATCH] ob-lua: Quote list-like strings, sort tables, and parse bare returns * lisp/ob-lua.el (org-babel-lua-multiple-values-separator): Change the default value from ", " to "|" to avoid '\\,' appearing in strings. (org-babel-lua-wrapper-method): Improve 3 aspects: (1) Quote strings with list-like content to prevent Org Babel from incorrectly guessing their type, (2) sort pretty-printed non-sequential tables to make them reproducible, and (3) handle implicit nils produced by 'return' used with no arguments. * testing/lisp/test-ob-lua.el (test-ob-lua/result/nil): (test-ob-lua/result/nil/explicit): (test-ob-lua/result/boolean): (test-ob-lua/results/number/integer): (test-ob-lua/results/number/integer/negative): (test-ob-lua/results/number/integer/multiple): (test-ob-lua/results/number/real): (test-ob-lua/results/number/real/multiple): (test-ob-lua/results/number/infinity): (test-ob-lua/results/string/single-quotes): (test-ob-lua/results/string/double-quotes): (test-ob-lua/results/string/multiple): (test-ob-lua/results/string/list-like): (test-ob-lua/results/string/list-like/brackets): (test-ob-lua/results/string/list-like/curlies): (test-ob-lua/result/table): (test-ob-lua/result/table/pretty-print): (test-ob-lua/result/table/pretty-print/sorted): (test-ob-lua/results/value-separator): New tests. --- lisp/ob-lua.el | 41 ++++-- testing/lisp/test-ob-lua.el | 264 ++++++++++++++++++++++++++++++++---- 2 files changed, 266 insertions(+), 39 deletions(-) diff --git a/lisp/ob-lua.el b/lisp/ob-lua.el index 041abfabc..5a0fdb18b 100644 --- a/lisp/ob-lua.el +++ b/lisp/ob-lua.el @@ -81,7 +81,7 @@ This will typically be `lua-mode'." :package-version '(Org . "8.3") :type 'symbol) -(defcustom org-babel-lua-multiple-values-separator ", " +(defcustom org-babel-lua-multiple-values-separator "|" "Separate multiple values with this string." :group 'org-babel :package-version '(Org . "9.7") @@ -261,26 +261,33 @@ function dump(it, indent) if indent == nil then indent = '' end + if type(it) == 'table' and %s then - local count = 0 - for _ in pairs(it) do - count = count + 1 - end local result = '' + if #indent ~= 0 then result = result .. '\\n' end - for key, value in pairs(it) do + + local keys = {} + for key in pairs(it) do + table.insert(keys, key) + end + + table.sort(keys) + + for index, key in pairs(keys) do + local value = it[key] result = result .. indent .. dump(key) .. ' = ' .. dump(value, indent .. ' ') - count = count - 1 - if count ~= 0 then + if index ~= #keys then result = result .. '\\n' end end + return result else return tostring(it) @@ -288,11 +295,27 @@ function dump(it, indent) end function combine(...) + local quotes = '\"' local result = {} + for index = 1, select('#', ...) do result[index] = dump(select(index, ...)) end - return table.concat(result, '%s') + + if #result == 0 then + return dump(nil) + end + + if #result == 1 then + local value = result[1] + if string.find(value, '[%%(%%[{]') == 1 then + return quotes .. value .. quotes + else + return value + end + end + + return quotes .. table.concat(result, '%s') .. quotes end output = io.open('%s', 'w') diff --git a/testing/lisp/test-ob-lua.el b/testing/lisp/test-ob-lua.el index 0a60c68ca..775a5cf14 100644 --- a/testing/lisp/test-ob-lua.el +++ b/testing/lisp/test-ob-lua.el @@ -136,45 +136,249 @@ return x (org-babel-next-src-block) (org-babel-execute-src-block))))) -(ert-deftest test-ob-lua/types () - "Test returning different types." +(ert-deftest test-ob-lua/result/nil () + "Test returning nothing." (should - (equal "nil" - (org-test-with-temp-text "src_lua{return nil}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return} {{{results(=nil=)}}}" + (org-test-with-temp-text "src_lua{return}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/result/nil/explicit () + "Test returning nothing explicitly." + (should + (equal + "src_lua{return nil} {{{results(=nil=)}}}" + (org-test-with-temp-text "src_lua{return nil}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/result/boolean () + "Test returning the boolean values true and false." + (should + (equal + "src_lua{return true} {{{results(=true=)}}}" + (org-test-with-temp-text "src_lua{return true}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max))))) (should - (equal "true" - (org-test-with-temp-text "src_lua{return true}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return false} {{{results(=false=)}}}" + (org-test-with-temp-text "src_lua{return false}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/number/integer () + "Test returning integers." (should - (equal "false" - (org-test-with-temp-text "src_lua{return false}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return 1} {{{results(=1=)}}}" + (org-test-with-temp-text "src_lua{return 1}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/number/integer/negative () + "Test returning negative integers." (should - (equal 1 - (org-test-with-temp-text "src_lua{return 1}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return -1} {{{results(=-1=)}}}" + (org-test-with-temp-text "src_lua{return -1}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/number/integer/multiple () + "Test returning multiple integers at once." (should - (equal "hello world" - (org-test-with-temp-text "src_lua{return 'hello world'}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return 1, 2, 3} {{{results(=1|2|3=)}}}" + (org-test-with-temp-text "src_lua{return 1, 2, 3}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/number/real () + "Test returning real numbers." (should - (equal 0 - (string-match "table: 0x[0-9A-F]+" - (org-test-with-temp-text "src_lua{return {}}" - (org-babel-execute-src-block)))))) + (equal + "src_lua{return 1.5} {{{results(=1.5=)}}}" + (org-test-with-temp-text "src_lua{return 1.5}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) -(ert-deftest test-ob-lua/multiple-values () - "Test returning multiple values." +(ert-deftest test-ob-lua/results/number/real/multiple () + "Test returning multiple real numbers at once." (should - (equal "1, 2, 3" - (org-test-with-temp-text "src_lua{return 1, 2, 3}" - (org-babel-execute-src-block)))) + (equal + "src_lua{return 1.5, 2.5, 3.5} {{{results(=1.5|2.5|3.5=)}}}" + (org-test-with-temp-text "src_lua{return 1.5, 2.5, 3.5}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/number/infinity () + "Test returning the infinity." + (should + (equal + "src_lua{return 1 / 0} {{{results(=inf=)}}}" + (org-test-with-temp-text "src_lua{return 1 / 0}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/single-quotes () + "Test returning strings in single quotes." + (should + (equal + "src_lua{return 'hello world'} {{{results(=hello world=)}}}" + (org-test-with-temp-text "src_lua{return 'hello world'}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/double-quotes () + "Test returning strings in double quotes." + (should + (equal + "src_lua{return \"hello world\"} {{{results(=hello world=)}}}" + (org-test-with-temp-text "src_lua{return \"hello world\"}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/multiple () + "Test returning multiple strings at once." + (should + (equal + "src_lua{return 'a', 'b'} {{{results(=a|b=)}}}" + (org-test-with-temp-text "src_lua{return 'a', 'b'}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/list-like () + "Test returning strings that look like \"(...)\" lists." + (should + (equal + (concat "src_lua{return string.match('A (B) C', '%b()')}" + " {{{results(=(B)=)}}}") + (org-test-with-temp-text + "src_lua{return string.match('A (B) C', '%b()')}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/list-like/brackets () + "Test returning strings that look like \"[...]\" lists." + (should + (equal + (concat "src_lua{return string.match('A [B] C', '%b[]')}" + " {{{results(=[B]=)}}}") + (org-test-with-temp-text + "src_lua{return string.match('A [B] C', '%b[]')}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/string/list-like/curlies () + "Test returning strings that look like \"{...}\" lists." + (should + (equal + (concat "src_lua{return string.match('A {B} C', '%b{}')}" + " {{{results(={B}=)}}}") + (org-test-with-temp-text + "src_lua{return string.match('A {B} C', '%b{}')}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/result/table () + "Test returning table references." + (should + (equal + 0 + (string-match + "src_lua{return {}} {{{results(=table: 0x[0-9A-F]+=)}}}" + (org-test-with-temp-text "src_lua{return {}}" + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max))))))) + +(ert-deftest test-ob-lua/result/table/pretty-print () + "Test returning and pretty-printing sequential tables." + (should + (equal (string-join + '("#+BEGIN_SRC lua :results pp" + "return {10, {20, 30, {40, 50}, 60}, 70}" + "#+END_SRC" + "" + "#+RESULTS:" + ": 1 = 10" + ": 2 = " ; FIXME Trailing space. + ": 1 = 20" + ": 2 = 30" + ": 3 = " ; FIXME Trailing space. + ": 1 = 40" + ": 2 = 50" + ": 4 = 60" + ": 3 = 70" + "") + "\n") + (org-test-with-temp-text + (string-join + '("#+BEGIN_SRC lua :results pp" + "return {10, {20, 30, {40, 50}, 60}, 70}" + "#+END_SRC") + "\n") + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/result/table/pretty-print/sorted () + "Test returning and pretty-printing non-sequential tables." + (should + (equal (string-join + '("#+BEGIN_SRC lua :results pp" + "return {b = 20, c = 30, a = 10}" + "#+END_SRC" + "" + "#+RESULTS:" + ;; NOTE The keys are sorted alphabetically. + ": a = 10" + ": b = 20" + ": c = 30" + "") + "\n") + (org-test-with-temp-text + (string-join + '("#+BEGIN_SRC lua :results pp" + "return {b = 20, c = 30, a = 10}" + "#+END_SRC") + "\n") + (org-babel-execute-src-block) + (buffer-substring-no-properties (point-min) + (point-max)))))) + +(ert-deftest test-ob-lua/results/value-separator () + "Test customizing the separator of multiple values." + ;; TODO Once Org Babel supports returning lists from inline blocks, + ;; instead of trapping with the user error: "Inline error: list + ;; result cannot be used", use those for multiple values. (should - (equal "1|2|3" - (let ((org-babel-lua-multiple-values-separator "|")) - (org-test-with-temp-text "src_lua{return 1, 2, 3}" - (org-babel-execute-src-block)))))) + (equal + "src_lua{return 1, 2, 3} {{{results(=1\t2\t3=)}}}" + (org-test-with-temp-text "src_lua{return 1, 2, 3}" + (let ((org-babel-lua-multiple-values-separator "\t")) + (org-babel-execute-src-block)) + (buffer-substring-no-properties (point-min) + (point-max)))))) (provide 'test-ob-lua) -- 2.39.3 (Apple Git-146) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "It is no paradox to say that in our most theoretical moods we may be nearest to our most practical applications." --- Alfred North Whitehead, 1861-1947 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25, 84103 Bratislava, Slovakia, European Union --=-=-=--