emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Maxima code blocks does not work in windows revisited


From: Ihor Radchenko
Subject: Re: [O] Maxima code blocks does not work in windows revisited
Date: Wed, 02 Nov 2022 04:47:45 +0000

Mati <mati@electrum-bikes.pl> writes:

> On 01.11.2022 09:04, Ihor Radchenko wrote:
>
>> Do you mean that you changed the code at line 82 inside
>> org-babel-execute:maxima to
>>
>>   (let* ((cmdline (or (cdr (assoc :cmdline params)) ""))
>>        (in-file (org-babel-temp-file "maxima-" ".max"))
>>              (cmd (format "%s --very-quiet -r \"batchload(\\\"%s\\\")$\" %s"
>>                           org-babel-maxima-command in-file cmdline)))
>>
>> ??
>>
>> (for reference, this email is a followup of
>> https://orgmode.org/list/CA+ikm3wqA33xP4c3pVV+F2a-gn0dbEzsdx6Vf2cRd+37+u6pBA@mail.gmail.com)
>
> yes, of course only part of it

Ok. Does the attached patch work for you?

> I am testing maxima-mode now (not in org) and it works, but is broken on 
> windows. Looks like there are many more problems with syntax.

Org support for Maxima does not require maxima-mode to be installed,
except for optional fontification.

Note that we can only help with within Org scope. We cannot freely modify
Maxima code.

It will be more productive if you contact Maxima developers on the
issue. They do have a mailing list:
https://maxima.sourceforge.io/maximalist.html#discussion

>From 4c1faea44cbe97e53ffb4f78829b86e0da606417 Mon Sep 17 00:00:00 2001
Message-Id: 
<4c1faea44cbe97e53ffb4f78829b86e0da606417.1667364311.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Wed, 2 Nov 2022 12:43:35 +0800
Subject: [PATCH] ob-maxima: Add extra quotes to Maxima cmd for Windows
 compatibility

* lisp/ob-maxima.el (org-babel-execute:maxima): Add extra quoting
apparently needed to make cmd line work on Windows.

Reported-by: Juan Alvaro Fuentes <juanalvaro.fuentes@upct.es>
Link: 
https://orgmode.org/list/CA+ikm3wqA33xP4c3pVV+F2a-gn0dbEzsdx6Vf2cRd+37+u6pBA@mail.gmail.com
---
 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 dba12d7b6..52423db18 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -84,7 +84,7 @@ (defun org-babel-execute:maxima (body params)
                (cmd (format "%s --very-quiet -r %s$ %s"
                             org-babel-maxima-command
                              (shell-quote-argument
-                              (format "batchload(%S)" in-file))
+                              (format "\"batchload(\\\"%S\\\")\"" in-file))
                              cmdline)))
           (with-temp-file in-file (insert (org-babel-maxima-expand body 
params)))
           (message cmd)
-- 
2.35.1

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

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