Hello.

I've been playing around with Maxima from time to time.

Ob-maxima currently does not work on Windows due to it using single quotes in the Maxima invocation and those not being supported by Windows CMD.

After some testing I've found an invocation that seems to work fine on both Windows and Linux. I don't think this patch can cause any real issue, since the string in those quotes is just the temp file path.
From b0206d14df8947c831e56eef21fbd38ca88c1fd5 Mon Sep 17 00:00:00 2001
From: Nikolay Kudryavtsev <nikolay.kudryavt...@gmail.com>
Date: Sun, 26 Dec 2021 22:47:19 +0300
Subject: [PATCH] ob-maxima.el: Fix execution on MS Windows

* ob-maxima.el (org-babel-execute:maxima): Change command line
invocation to a one that should work everywhere.
---
 lisp/ob-maxima.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index 7b49bb07a..512712221 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -77,7 +77,7 @@ This function is called by `org-babel-execute-src-block'."
        (result
         (let* ((cmdline (or (cdr (assq :cmdline params)) ""))
                (in-file (org-babel-temp-file "maxima-" ".max"))
-               (cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
+               (cmd (format "%s --very-quiet -r \"batchload(\\\"%S\\\")\"$ %s"
                             org-babel-maxima-command in-file cmdline)))
           (with-temp-file in-file (insert (org-babel-maxima-expand body 
params)))
           (message cmd)
-- 
2.34.1.windows.1

Reply via email to