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: [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