From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Max Nikulin <manikulin@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: [PATCH] Re: Maxima code blocks does not work in windows revisited
Date: Thu, 3 Nov 2022 16:09:31 +0000 [thread overview]
Message-ID: <87iljwj9z9.fsf_-_@t14.reltub.ca> (raw)
In-Reply-To: <tk0o73$lhh$2@ciao.gmane.io> (Max Nikulin's message of "Thu, 3 Nov 2022 22:54:11 +0700")
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]
On Thu, Nov 03 2022, Max Nikulin <manikulin@gmail.com> 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-XXXXXX.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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch.patch --]
[-- Type: text/x-diff; name="0001-lisp-ob-maxima.el-correct-placement-of-in-command-st.patch", Size: 1516 bytes --]
From 423340175a354463c82fac2b4b3a404391e67eb5 Mon Sep 17 00:00:00 2001
From: Leo Butler <leo.butler@umanitoba.ca>
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-276f6a452eaa@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
next prev parent reply other threads:[~2022-11-03 16:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 7:45 [O] Maxima code blocks does not work in windows revisited Mati
2022-11-01 8:04 ` Ihor Radchenko
2022-11-01 10:34 ` Mati
2022-11-01 17:42 ` Leo Butler
2022-11-01 21:14 ` Mati
2022-11-02 4:47 ` Ihor Radchenko
2022-11-02 7:35 ` Mati
2022-11-02 7:44 ` Ihor Radchenko
[not found] ` <7b358b1a-95d8-4733-5a44-4e6e4c782d8f@electrum-bikes.pl>
[not found] ` <87eduk8tas.fsf@localhost>
2022-11-03 11:39 ` Mati
2022-11-02 15:17 ` Max Nikulin
2022-11-02 20:11 ` Leo Butler
2022-11-03 2:35 ` Max Nikulin
2022-11-03 10:01 ` Fraga, Eric
2022-11-03 15:54 ` Max Nikulin
2022-11-03 16:09 ` Leo Butler [this message]
2022-11-06 2:54 ` [PATCH] " Ihor Radchenko
2022-11-07 15:04 ` Leo Butler
2022-11-03 6:08 ` Ihor Radchenko
2022-11-03 6:09 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iljwj9z9.fsf_-_@t14.reltub.ca \
--to=leo.butler@umanitoba.ca \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).