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