emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend


From: Max Nikulin
Subject: Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend
Date: Wed, 17 Nov 2021 23:12:02 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 15/11/2021 23:05, Daniel Kraus wrote:
Max Nikulin writes:

Attached is the patch changed the logic to use a temp file with org-babel-eval.

Thank you for contribution. I do not have strong objection any more. I am not familiar with babel internals, so I leave further discussion to maintainers.

If you have not signed copyright assignment yet, likely you should do it to proceed (I am unsure concerning precise rules concerning line counting). See https://orgmode.org/contribute.html and https://orgmode.org/worg/org-contribute.html for details.

Somehow it doesn't feel too great to create unnecessary temp files
but I looked how other babel backends do it and e.g. ob-js and ob-haskell
use the same logic.

Code fragment might be huge enough to exceed limit on arguments length, so I think that file is safer. Some interpreters and compilers generates more meaningful errors and stacktraces when act on a file. Another option is to feed content to process standard input. With `call-process' or an related command it should be possible to implement any variant, including raw argument without intermediate shell pass. See info "(elisp) Synchronous Processes" or https://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html

+    (with-temp-file script-file
+      (insert expanded))
+    (org-babel-eval
+     (format "%s %s" bb (org-babel-process-file-name script-file))
+     "")))

Since other babel packages use the same approach, I will not argue. By the way, isn't second argument of `org-babel-eval' intended for code that may be executed without a temporary file?

Some babel languages support sessions. I have no idea if it is applicable to babashka.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]