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

2022-11-07 Thread Leo Butler
On Sun, Nov 06 2022, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>>> I do not have a Windows machine to test and not motivated enough to
>>> try Emacs in wine.
>>
>> Max, a minor modification of the test you sent earlier shows that when
>> system-type is ms-dos, the placement does not matter (the command-line
>> is the same); but for gnu/linux, placement matters and Eric is right
>> (the command-lines are not the same and the dollar sign needs to be
>> escaped).
>>
>> I have attached a patch that puts the dollar sign in the right place for
>> both. The existing tests pass when running 'make test'.
>
> Thanks for your contribution!
> Applied onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9abf1b5167e94291eee7c1400277ed55993106f9
>
> You are now also listed as an Org mode contributor.
> https://git.sr.ht/~bzg/worg/commit/8750cbeccf4283be5ec7078f635f8328b2cbee09

Thanks, Ihor.
Leo


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

2022-11-05 Thread Ihor Radchenko
Leo Butler  writes:

>> I do not have a Windows machine to test and not motivated enough to
>> try Emacs in wine.
>
> Max, a minor modification of the test you sent earlier shows that when
> system-type is ms-dos, the placement does not matter (the command-line
> is the same); but for gnu/linux, placement matters and Eric is right
> (the command-lines are not the same and the dollar sign needs to be
> escaped).
>
> I have attached a patch that puts the dollar sign in the right place for
> both. The existing tests pass when running 'make test'.

Thanks for your contribution!
Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9abf1b5167e94291eee7c1400277ed55993106f9

You are now also listed as an Org mode contributor.
https://git.sr.ht/~bzg/worg/commit/8750cbeccf4283be5ec7078f635f8328b2cbee09

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



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

2022-11-03 Thread Leo Butler
On Thu, Nov 03 2022, Max Nikulin  wrote:

> On 03/11/2022 17:01, Fraga, Eric wrote:
>> On Thursday,  3 Nov 2022 at 09:35, Max Nikulin wrote:
>>> maxima --very-quiet -r "batchload(\"c:\\Temp\\maxima-XX.max\")"$
>> Should the $ not be within the quotes?
>
> Does "$" have any special meaning in cmd.exe? I do not mind that it
> should be inside `format' first argument.
>
> I do not have a Windows machine to test and not motivated enough to
> try Emacs in wine.

Max, a minor modification of the test you sent earlier shows that when
system-type is ms-dos, the placement does not matter (the command-line
is the same); but for gnu/linux, placement matters and Eric is right
(the command-lines are not the same and the dollar sign needs to be
escaped).

I have attached a patch that puts the dollar sign in the right place for
both. The existing tests pass when running 'make test'.

Leo

From 423340175a354463c82fac2b4b3a404391e67eb5 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 3 Nov 2022 10:39:28 -0500
Subject: [PATCH] lisp/ob-maxima.el: correct placement of $ in command string

* ob-maxima.el (org-babel-maxima:execute): Commit 6156b57bdf2b fixed a
quoting problem encountered on windows. However, the dollar sign ($)
is part of the maxima command string and needs to be escaped on
gnu/linux.

Reported by: Eric Fraga
Ref:
https://list.orgmode.org/950eb41c-1c8a-c891-af8d-276f6a452...@electrum-bikes.pl/T/#m4b5a54551604e5b3ec21f317c4a31b547ccada68

TINYCHANGE
---
 lisp/ob-maxima.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el
index dba12d7b6..e3dfbb668 100644
--- a/lisp/ob-maxima.el
+++ b/lisp/ob-maxima.el
@@ -81,10 +81,10 @@ 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 %s$ %s"
+		(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



Re: Maxima code blocks does not work in windows revisited

2022-11-03 Thread Max Nikulin

On 03/11/2022 17:01, Fraga, Eric wrote:

On Thursday,  3 Nov 2022 at 09:35, Max Nikulin wrote:

maxima --very-quiet -r "batchload(\"c:\\Temp\\maxima-XX.max\")"$


Should the $ not be within the quotes?


Does "$" have any special meaning in cmd.exe? I do not mind that it 
should be inside `format' first argument.


I do not have a Windows machine to test and not motivated enough to try 
Emacs in wine.


P.S. To avoid tricky escaping I strongly prefer direct exec to shell 
commands. Unfortunately as soon as TRAMP is involved, shell is the only 
option. Ssh supports command strings only and passes them to shell.






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

2022-11-03 Thread Mati




As Max pointed out, the latest main branch of Org should already handle
Windows cmd properly without any extra patches. Did you try it? May I
know the output of M-x org-version?


9.5.5-g5bc674, I just pulled it, rebuilt and works properly (without plots)




Re: Maxima code blocks does not work in windows revisited

2022-11-03 Thread Fraga, Eric
On Thursday,  3 Nov 2022 at 09:35, Max Nikulin wrote:
> maxima --very-quiet -r "batchload(\"c:\\Temp\\maxima-XX.max\")"$


Should the $ not be within the quotes?
-- 
: Eric S Fraga, with org release_9.5.5-853-g7b9d8e in Emacs 29.0.50


Re: Maxima code blocks does not work in windows revisited

2022-11-03 Thread Ihor Radchenko
Max Nikulin  writes:

> On 02/11/2022 11:47, Ihor Radchenko wrote:
 (for reference, this email is a followup of
 https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)
>
> Ihor, you recently applied an alternative patch to Org main branch. 
> Emacs tree still has ob-maxima.el with single quotes around batchload.
>
> Nikolay Kudryavtsev. Re: [PATCH] ob-maxima.el: Fix execution on MS 
> Windows. Thu, 30 Dec 2021 23:54:10 +0300. 
> https://list.orgmode.org/8cd49b4c-9342-a77f-d665-402c41432...@gmail.com

Thanks for pointing this out!
I do not use Windows, so it is hard to check how things are there. I
assumed that the report herein is on the latest main, which may or may
not be the case.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Maxima code blocks does not work in windows revisited

2022-11-03 Thread Ihor Radchenko
Max Nikulin  writes:

> On 02/11/2022 11:47, Ihor Radchenko wrote:
 (for reference, this email is a followup of
 https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)
>
> Ihor, you recently applied an alternative patch to Org main branch. 
> Emacs tree still has ob-maxima.el with single quotes around batchload.
>
> Nikolay Kudryavtsev. Re: [PATCH] ob-maxima.el: Fix execution on MS 
> Windows. Thu, 30 Dec 2021 23:54:10 +0300. 
> https://list.orgmode.org/8cd49b4c-9342-a77f-d665-402c41432...@gmail.com

Thanks for pointing this out!
I do not use Windows, so it is hard to check how things are there. I
assumed that the report herein is not the latest main, which may or may
not be the case.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Maxima code blocks does not work in windows revisited

2022-11-02 Thread Max Nikulin

On 03/11/2022 03:11, Leo Butler wrote:

On Wed, Nov 02 2022, Max Nikulin wrote:


On 02/11/2022 11:47, Ihor Radchenko wrote:

(for reference, this email is a followup of
https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)


Ihor, you recently applied an alternative patch to Org main
branch. Emacs tree still has ob-maxima.el with single quotes around
batchload.

Nikolay Kudryavtsev. Re: [PATCH] ob-maxima.el: Fix execution on MS
Windows. Thu, 30 Dec 2021 23:54:10 +0300.
https://list.orgmode.org/8cd49b4c-9342-a77f-d665-402c41432...@gmail.com


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))


Notice that code in the message you cited has "%s" and does not have
`shell-quote-argument'. Extra quotes may discard effect of existing
double pass escaping.


Yes, OP should try this solution first. If it fails, then there is
some problem in `shell-quote-argument' that needs to be fixed.


To be clear. I believe that Mati should try the code from the Org "main" 
branch, not the patch Ihor posted in this thread. If I got it correctly, 
Mati currently has some problems with plots, ghostscript, etc.


Is there anything wrong with the following command (I am unsure 
concerning Temp location)? If so, what is the proper escaping for 
cmd.exe+maxima?


(let ((system-type 'ms-dos)
  (org-babel-maxima-command "maxima")
  (in-file "c:\\Temp\\maxima-XX.max")
  (cmdline ""))
  (message
   "%s"
   (format "%s --very-quiet -r %s$ %s"
   org-babel-maxima-command
   (shell-quote-argument
(format "batchload(%S)" in-file))
   cmdline)))

maxima --very-quiet -r "batchload(\"c:\\Temp\\maxima-XX.max\")"$

(there is a trailing space)





Re: Maxima code blocks does not work in windows revisited

2022-11-02 Thread Leo Butler
On Wed, Nov 02 2022, Max Nikulin  wrote:

> On 02/11/2022 11:47, Ihor Radchenko wrote:
 (for reference, this email is a followup of
 https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)
>
> Ihor, you recently applied an alternative patch to Org main
> branch. Emacs tree still has ob-maxima.el with single quotes around
> batchload.
>
> Nikolay Kudryavtsev. Re: [PATCH] ob-maxima.el: Fix execution on MS
> Windows. Thu, 30 Dec 2021 23:54:10 +0300. 
> https://list.orgmode.org/8cd49b4c-9342-a77f-d665-402c41432...@gmail.com
>
>> 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))
>
> Notice that code in the message you cited has "%s" and does not have
> `shell-quote-argument'. Extra quotes may discard effect of existing 
> double pass escaping.

Yes, OP should try this solution first. If it fails, then there is
some problem in `shell-quote-argument' that needs to be fixed.

My 2c.
Leo


Re: Maxima code blocks does not work in windows revisited

2022-11-02 Thread Max Nikulin

On 02/11/2022 11:47, Ihor Radchenko wrote:

(for reference, this email is a followup of
https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@mail.gmail.com)


Ihor, you recently applied an alternative patch to Org main branch. 
Emacs tree still has ob-maxima.el with single quotes around batchload.


Nikolay Kudryavtsev. Re: [PATCH] ob-maxima.el: Fix execution on MS 
Windows. Thu, 30 Dec 2021 23:54:10 +0300. 
https://list.orgmode.org/8cd49b4c-9342-a77f-d665-402c41432...@gmail.com



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))


Notice that code in the message you cited has "%s" and does not have 
`shell-quote-argument'. Extra quotes may discard effect of existing 
double pass escaping.



  cmdline)))
   (with-temp-file in-file (insert (org-babel-maxima-expand body 
params)))
   (message cmd)


Really robust solution require a dedicated maxima option that allows to 
pass file name as a separated argument instead of a part of expression,






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

2022-11-02 Thread Ihor Radchenko
Mati  writes:

> Ok, I tried this patch, but now when I try to eval maxima code it 
> outputs similar broken table:
>
> | incorrect | syntax: | c | is | not | an | infix | operator |
> | ^    |    |   |   | |    |  | |
>
> Plots have no output as before.

Could you please describe what exactly you tried, what you expected, and
what you got?

My patch should be equivalent to originally proposed, but
I am not exactly sure what you have applied on your side. And I have no
idea which table you are talking about.

See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



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

2022-11-02 Thread Mati
Ok, I tried this patch, but now when I try to eval maxima code it 
outputs similar broken table:


| incorrect | syntax: | c | is | not | an | infix | operator |
| ^    |    |   |   | |    |  | |

Plots have no output as before.

To clarify, previous patch worked except plots. And of course I applied 
patch to fresh org repo downloaded with straight.el





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

2022-11-01 Thread Ihor Radchenko
Mati  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+u6...@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.yanta...@posteo.net>
From: Ihor Radchenko 
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 
Link: https://orgmode.org/list/ca+ikm3wqa33xp4c3pvv+f2a-gn0dbezsdx6vf2crd+37+u6...@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 .
Support Org development at ,
or support my work at 


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

2022-11-01 Thread Mati

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.

I am interested to know what is broken in maxima-mode. Please
explain with examples.

Best,
Leo


There is problem with handling ghostscript. Ghostscript gui opens three 
times, one time with commands help, and error is displayed in 
minibuffer: "Your version Ghostscript does not appear to support the 
image type -sDEVICE=png16m. The command "gs -h" lists the available 
devices." when it does support it. maybe if I could use setup file it 
would work, but it gives error: Wrong type argument: stringp, nil. I 
also had to correct miktex path in this function, but without 
modification this error occurs too


Overall, configuration on windows is a pain. manually installing 
packages in miktex and ghostscript (not that bad, but I had to dig to 
find that's neccesary), wondering what code actually should be put in 
init.el, finding and moving files from maxima installation to site-lisp, 
adding installation pathes to path environment variable because 
setup-imaxima-imath.el is not working...


Plots produce output but it's not inline in emacs buffer, but gnuplot 
window.


My current path to miktex binary is: 
C:\Users\user\AppData\Local\Programs\MiKTeX\miktex\bin\x64


My init.el config for maxima:


(add-to-list 'load-path "~/.emacs.d/site-lisp/maxima/")

(load-file "~/.emacs.d/site-lisp/maxima/setup-imaxima-imath.el")

(use-package maxima
  :custom (maxima-display-maxima-buffer nil)
  :mode ("\\.ma[cx]" . imaxima)
  :interpreter ("maxima" . imaxima))

;;(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
;;(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
;;(setq imaxima-use-maxima-mode-flag t)
;;(setq imaxima-gs-program "gswin64")
(setq imaxima-fnt-size "large")
(setq imaxima-pt-size 12)
;;(add-to-list 'auto-mode-alist '("\\.ma[cx]" . maxima-mode))

(org-babel-do-load-languages
 'org-babel-load-languages
 '((maxima . t))) ; this line activates maxima






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

2022-11-01 Thread Leo Butler
On Tue, Nov 01 2022, Mati  wrote:

> 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+u6...@mail.gmail.com)
>
> yes, of course only part of it

Please don't make people guess at what you have done. Ihor, in
particular, does a huge amount of work on Org. Making him and us guess
only makes that work harder.

> 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.

I am interested to know what is broken in maxima-mode. Please
explain with examples.

Best,
Leo


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

2022-11-01 Thread Mati

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+u6...@mail.gmail.com)


yes, of course only part of it


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.





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

2022-11-01 Thread Ihor Radchenko
Mati  writes:

> Ok, I got it working somehow. For others reading this: I had to modify 
> ~/.emacs.d/straight/repos/org/lisp/ob-maxima.el in emacs(!) so straight 
> compiled it to work. you need to replace code at line 82. However, plots 
> still doesn't work (code block produced no output) :( pls help.

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+u6...@mail.gmail.com)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



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

2022-11-01 Thread Mati
Ok, I got it working somehow. For others reading this: I had to modify 
~/.emacs.d/straight/repos/org/lisp/ob-maxima.el in emacs(!) so straight 
compiled it to work. you need to replace code at line 82. However, plots 
still doesn't work (code block produced no output) :( pls help.





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

2022-11-01 Thread ELECTRUM BIKES
I tried replacing it and doesn't work, still the same error, win10 emacs 
28.1





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

2014-07-28 Thread Bastien
Hi Juan,

Juan Alvaro Fuentes juanalvaro.fuen...@upct.es writes:

 It seems that maxima code blocks still does not work in windows as
 the following code did not work when I tried to run it:

I don't have a machine with Windows so I can't really help here, but I
hope an Org/Maxima/Windows user can help debugging this further.

Best,

-- 
 Bastien



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

2014-07-10 Thread Juan Alvaro Fuentes
Dear all,

It seems that maxima code blocks still does not work in windows as the
following code did not work when I tried to run it:

#+begin_src maxima
 a: 1+1;
 print(a);
#+end_src

This is an old issue already emailed to this emacs org-mode list in an
email dating from june 2011.

The conversation ended up with a final reflection which I copy next:

* Okay, it definitely is a Windows problem. If I run the following command*
* in a cygwin shell, everything works as expected:*

* maxima --very-quiet -r*
* 
'batchload(c:/Users/weiss/AppData/Local/Temp/babel-17716aLH/maxima-17716hCp)$'*
* nil*

* However, it does not work in a Windows shell. But this is no longer an*
* org issue.*

* Bernd*


Trying to find the correct string that makes maxima execute the batch
file in windows I found that this command does work:

maxima --very-quiet -r
batchload(\c:/Users/alvaro/AppData/Local/Temp/babel-7740OHt/maxima-7740OpY.max\)$

maxima --very-quiet -r
batchload(\c:/Users/alvaro/AppData/Local/Temp/babel-7740OHt/maxima-7740OpY.max\)$

2


I tried to make this string when maxima is executed in the shell and
modifying ob-maxima.el found that this seems to work for windows 8,
emacs 24.4 and org 8.2.7b:


 (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)))


The problem is that my lisp skills are not very good, to say the
least, and sending a patch is one more problem so I write this email
if this can help anybody to makemaxima code blocks work in windows.


Thanks,

Juan Alvaro