Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/3/08, Alejandro Jakubi wrote:

 I intend to continue the long process of getting acquainted
 with Axiom and for this purpose I find very convenient the use
 of the Texmacs GUI.


Good. I am very interested in your experience with this.

 Currently, on Windows, I have installed Axiom 0.1.4 (January 17,
 2005) and WinTexmacs 1.0.4.4. So, I have thought about updating
 Axiom, but binaries are only available for linux. Hence, I have installed
 the Windows port of OpenAxiom 1.1.0 (at this point, for me, I guess
 that the differences are irrelevant).


I think this OpenAxiom binary for Windows was originally prepared by
Alfredo Portes. He might have some more information about how it can
be used. I believe that internally there are some differences in how
the linux-type commands are handled but I am not sure it that will
affect you. So far it seems to work ok for me but I have not tested it
extensively.

 As you have written a version of tm_axiom.c for Windows, I wonder
 whether you have written also a version of tm_openaxiom.c to be
 able to have also an OpenAxiom session within WinTexmacs. Or, at
 least you could tell me what kind of changes have to be made on
 tm_axiom.c for this purpose.


I have not written a new version to tm_axiom.c especially for
OpenAxiom. In principle, although I have not tested this, the same
tm_axiom.c interface should work for both.

  By analogy, I guess, I should set an OPENAXIOM environment variable 
 similarly
  to AXIOM=C:/axiom/mnt/windows, and replace /bin/AXIOMsys.exe with
  /bin/open-axiom.exe. Is it correct? Is that all?


Unlike the original AXIOM program, I do not think it is necessary to
set any environment variables for OpenAxiom. After installing
OpenAxiom look for the OpenAxiom shortcut on your desktop. Right-click
it and then click 'properties'. The correct way to start OpenAxiom is
shown in the Target: field. In my case that is:

C:\My Program Files\OpenAxiom\bin\open-axiom.exe --system=C:\My
Program Files\OpenAxiom\lib\open-axiom\i686-pc-mingw32\1.1.0

The exact path names depends on where you decide to install OpenAxiom.
You see that instead of the AXIOM variable, the locaction of OpenAxiom
is specified in the --system option of the command line. Somehow you
will have to arrange to include this option in the tm_axiom program.

If you have any trouble with this, please let me know.

Regards,
Bill Page.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Alfredo Portes
Hi Alejandro, Bill,

I think Gaby uploaded a corrected version of OpenAxiom-1.1.0.exe. I
didn't include
some of the Linux binaries still necessary in Windows (rm, cp, cat ..). Gaby is
now aware of this and in the future a more platform independent solution should
be implemented.

Like Bill already pointed out:

OpenAxiom does not use any external env. variable.
You can run OpenAxiom in Windows by just invoking open-axiom in a
command prompt. (It is included in the path).
The use of --system is just needed if OpenAxiom is not installed in
the default Program Files directory.

Regards,

Alfredo

On Tue, Mar 4, 2008 at 12:56 PM, Bill Page [EMAIL PROTECTED] wrote:
 On 3/3/08, Alejandro Jakubi wrote:
  
   I intend to continue the long process of getting acquainted
   with Axiom and for this purpose I find very convenient the use
   of the Texmacs GUI.
  

  Good. I am very interested in your experience with this.

   Currently, on Windows, I have installed Axiom 0.1.4 (January 17,
   2005) and WinTexmacs 1.0.4.4. So, I have thought about updating
   Axiom, but binaries are only available for linux. Hence, I have installed
   the Windows port of OpenAxiom 1.1.0 (at this point, for me, I guess
   that the differences are irrelevant).
  

  I think this OpenAxiom binary for Windows was originally prepared by
  Alfredo Portes. He might have some more information about how it can
  be used. I believe that internally there are some differences in how
  the linux-type commands are handled but I am not sure it that will
  affect you. So far it seems to work ok for me but I have not tested it
  extensively.

   As you have written a version of tm_axiom.c for Windows, I wonder
   whether you have written also a version of tm_openaxiom.c to be
   able to have also an OpenAxiom session within WinTexmacs. Or, at
   least you could tell me what kind of changes have to be made on
   tm_axiom.c for this purpose.
  

  I have not written a new version to tm_axiom.c especially for
  OpenAxiom. In principle, although I have not tested this, the same
  tm_axiom.c interface should work for both.

By analogy, I guess, I should set an OPENAXIOM environment variable 
 similarly
to AXIOM=C:/axiom/mnt/windows, and replace /bin/AXIOMsys.exe with
/bin/open-axiom.exe. Is it correct? Is that all?
  

  Unlike the original AXIOM program, I do not think it is necessary to
  set any environment variables for OpenAxiom. After installing
  OpenAxiom look for the OpenAxiom shortcut on your desktop. Right-click
  it and then click 'properties'. The correct way to start OpenAxiom is
  shown in the Target: field. In my case that is:

  C:\My Program Files\OpenAxiom\bin\open-axiom.exe --system=C:\My
  Program Files\OpenAxiom\lib\open-axiom\i686-pc-mingw32\1.1.0

  The exact path names depends on where you decide to install OpenAxiom.
  You see that instead of the AXIOM variable, the locaction of OpenAxiom
  is specified in the --system option of the command line. Somehow you
  will have to arrange to include this option in the tm_axiom program.

  If you have any trouble with this, please let me know.

  Regards,
  Bill Page.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/4/08, Alejandro Jakubi [EMAIL PROTECTED] wrote:
 Hi Bill and Alfredo

  My question is about setting up WinTexmacs to run also an OpenAxiom 1.1
  session. Indeed OpenAxiom 1.1 opens fine within a cmd box, just clicking on
  the desktop icon, which for my setting executes:

  C:\math\OpenAxiom\bin\open-axiom.exe
  --system=C:\math\OpenAxiom\lib\open-axiom\i686-pc-mingw32\1.1.0

  So, I know that no environment variable needs to be set up to run from the 
 cmd
  box. But, on the other hand Bill's version of tm_axiom.c uses the enviroment
  variable AXIOM:

  ===
  ...
  /* e.g. AXIOM=c:/Program Files/axiom/mnt/windows*/
if (pAXIOM=getenv(AXIOM)) {
  strcpy(AXIOM_exe,pAXIOM); strcat(AXIOM_exe,/bin/AXIOMsys.exe);
  strcpy(AXIOM_cmd,pAXIOM); strcat(AXIOM_cmd, /bin/AXIOMsys.exe);
  strcpy(ENV_AXIOM,AXIOM=); strcat(ENV_AXIOM, pAXIOM);
} else {   /* We need the AXIOM variable! */
  printf(You must set the AXIOM environment variable, e.g.\n);
  printf(  AXIOM=c:/Program Files/axiom/mnt/windows\n);
  exit(1);
};
  ...
  ===

  Hence, apparently, one way to adapt it for a tm_openaxiom.c would be to
  replace here AXIOM by OPENAXIOM and set a fake enviroment variable OPENAXIOM
  pointing to openaxiom.exe.

  Well, I have thought that Bill, or someone else, had already looked at it.


No, sorry. But if you are interested I am willing to help. I don't
think faking it is a good idea. Instead, we should probably change
the code something like this:

 /* e.g. OPENAXIOM=C:/Program
Files/OpenAxiom/lib/open-axiom/i686-pc-mingw32/1.1.0 */
   if (pAXIOM=getenv(OPENAXIOM)) {
 strcpy(AXIOM_exe,pAXIOM);
strcat(AXIOM_exe,/../../../../bin/open-axiom.exe);
 strcpy(AXIOM_cmd,pAXIOM); strcat(AXIOM_cmd,
/../../../../bin/open-axiom.exe);
 strcat(AXIOM_cmd, --system=\; strcat(AXIOM_cmd,pAXIOM);
strcat(AXIOM_cmd,\);
 strcpy(ENV_AXIOM,OPENAXIOM=); strcat(ENV_AXIOM, pAXIOM);
   } else {   /* We need the AXIOM variable! */
 printf(You must set the OPENAXIOM environment variable, e.g.\n);
 printf(  OPENAXIOM=C:/Program
Files/OpenAxiom/lib/open-axiom/i686-pc-mingw32/1.1.0\n);
 exit(1);
   };

Then the user would have to set the OPENAXIOM environment variable
appropriately for their installation. The /../../../.. prefix allows
the open-axiom.exe to be located relative to this path and the path
itself is passed via the --system option.

Warning: I haven't tested this, but I may get a chance to try it later tonight.

One question is: Do you want to be able to run both the original Axiom
and OpenAxiom in the same TeXmacs session? Or is configuring it for
just one or the other sufficient? If you want both (or maybe all
three? :-) then we need to do a little more work.

Regards,
Bill Page.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/4/08, Alfredo Portes wrote:

  Where can I get tm_axiom? so I can test it with OpenAxiom.


Look at:

  http://axiom-wiki.newsynthesis.org/TeXmacs

The tm_axiom download link is:

  http://axiom-wiki.newsynthesis.org/public/tm_axiom.zip

You can also download WinTeXmacs here from:

  http://axiom-wiki.newsynthesis.org/public/wintexmacs-1.0.5.exe

After you unzip tm_axiom.zip into your  'c:\msys\1.0\home' directory,
apply the following patch to 'tm_axiom.c':

$ diff -Naur --exclude='*.exe' --exclude='*.o' tm_axiom tm_open-axiom
diff -Naur --exclude=*.exe --exclude=*.o tm_axiom/tm_axiom.c
tm_open-axiom/tm_axiom.c
--- tm_axiom/tm_axiom.c Tue Dec 21 03:51:30 2004
+++ tm_open-axiom/tm_axiom.cTue Mar  4 18:46:48 2008
@@ -37,7 +37,7 @@
  * Modified by Bill Page 20041215
  * - add call to Robert Sutor line-break routine
  * Modified by Bill Page 20041217
- * - initialize AXIOM_exe from AXIOM environment variable
+ * - initialize AXIOM_cmd from AXIOM environment variable
  * Modified by Bill Page 20041220
  * - use args, TM_AXIOM environment variable and/or
  * )set output texmacs option,option, ...
@@ -51,6 +51,9 @@
  * - process Axiom output with no LaTeX content, e.g.
  * )set output tex off
  * )set output algebra on
+ * Modified by Bill Page 20080304
+ * - revised AXIOM_cmd for open-axiom
+ * - use OPENAXIOM environment variable
  **/

 #include windows.h
@@ -84,7 +87,6 @@
 #define   READ_HANDLE 0
 #define   WRITE_HANDLE 1

-char AXIOM_exe[256];
 char AXIOM_cmd[256];
 char ENV_AXIOM[256];

@@ -101,14 +103,13 @@
   int i;
   float w;

-/* e.g. AXIOM=c:/Program Files/axiom/mnt/windows*/
-  if (pAXIOM=getenv(AXIOM)) {
-strcpy(AXIOM_exe,pAXIOM); strcat(AXIOM_exe,/bin/AXIOMsys.exe);
-strcpy(AXIOM_cmd,pAXIOM); strcat(AXIOM_cmd, /bin/AXIOMsys.exe);
-strcpy(ENV_AXIOM,AXIOM=); strcat(ENV_AXIOM, pAXIOM);
+  if (pAXIOM=getenv(OPENAXIOM)) {
+strcpy(AXIOM_cmd,pAXIOM); strcat(AXIOM_cmd,
/../../../../bin/open-axiom.exe);
+strcat(AXIOM_cmd, --system=\); strcat(AXIOM_cmd,pAXIOM);
strcat(AXIOM_cmd,\);
+strcpy(ENV_AXIOM,OPENAXIOM=); strcat(ENV_AXIOM, pAXIOM);
   } else {   /* We need the AXIOM variable! */
-printf(You must set the AXIOM environment variable, e.g.\n);
-printf(  AXIOM=c:/Program Files/axiom/mnt/windows\n);
+printf(You must set the OPENAXIOM environment variable, e.g.\n);
+printf(  OPENAXIOM=C:/Program
Files/OpenAxiom/lib/open-axiom/i686-pc-mingw32/1.1.0\n);
 exit(1);
   };

(See also attached patch file.)

Re-compile:

  gcc tm_axiom.c texbreaker.c -o tm_open-axiom

Copy the executable file 'tm_open-axiom.exe' to the 'c:\Program
Files\OpenAxiom\bin' directory.

Then modify the TeXmacs 'init-axiom.scm' file in:

C:\Program Files\WinTeXmacs\TeXmacs\plugins\axiom\progs

as follows:

[EMAIL PROTECTED] /c/My Program Files/WinTeXmacs/TeXmacs/plugins/axiom/progs
$ diff -au 'Copy of init-axiom.scm' init-axiom.scm
--- Copy of init-axiom.scm  Wed Apr 27 06:46:28 2005
+++ init-axiom.scm  Tue Mar  4 18:56:15 2008
@@ -17,7 +17,7 @@
   (lazy-input-converter (axiom-input) axiom))

 (plugin-configure axiom
-  (:require (url-exists-in-path? AXIOMsys))
+  (:require (url-exists-in-path? open-axiom))
   (:initialize (axiom-initialize))
   (:launch tm_open-axiom)
   (:session OpenAxiom))

-

so that it looks for open-axiom in the PATH insteadn of AXIOMsys
and starts tm_open-axiom as the interface program.

When WinTeXmacs starts up you should see 'OpenAxiom' listed under Insert/Session

These changes seem to work fine for me. If it also works for me, then
I think we should include this new 'tm_open-axiom.exe' in the
OpenAxiom for Windows installer program.

Regards,
Bill Page.


tm_open-axiom.patch
Description: Binary data
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/4/08, I wrote:

  These changes seem to work fine for me. If it also works for me, then
  I think we should include this new 'tm_open-axiom.exe' in the
  OpenAxiom for Windows installer program.


What I meant of course was:

  These changes seem to work fine for me. If it also works for *you*,
  then I think we should include this new 'tm_open-axiom.exe' in the
  OpenAxiom for Windows installer program.

Also, here is a more accurate patch for the changes required to
'init-axiom.scm':

[EMAIL PROTECTED] /c/My Program Files/WinTeXmacs/TeXmacs/plugins/axiom/progs
$ diff -au 'Copy of init-axiom.scm' init-axiom.scm
--- Copy of init-axiom.scm  Wed Apr 27 06:46:28 2005
+++ init-axiom.scm  Tue Mar  4 19:17:35 2008
@@ -17,7 +17,7 @@
   (lazy-input-converter (axiom-input) axiom))

 (plugin-configure axiom
-  (:require (url-exists-in-path? AXIOMsys))
+  (:require (url-exists-in-path? open-axiom))
   (:initialize (axiom-initialize))
-  (:launch tm_axiom)
-  (:session Axiom))
+  (:launch tm_open-axiom)
+  (:session OpenAxiom))

-

I am not so sure how best to distribute this change. Perhaps the
OpenAxiom NSIS install script can look for WinTeXmacs and make this
change if found - or better: to install a whole new add-in to
WinTeXmacs just for OpenAxiom. I.e. copy all of 'c:/My Program
Files/WinTeXmacs/TeXmacs/plugins/axiom' to 'c:/My Program
Files/WinTeXmacs/TeXmacs/plugins/open-axiom' and replace
init-axiom.scm. Then we only have to tell people: Install WinTeXmacs
first and then install OpenAxiom. and everything should just work.

Good luck.

Regards,
Bill Page.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Alfredo Portes
Hi Bill,

I applied the changes, but I get an error cannot open pipe.

Regards,

Alfredo

On Tue, Mar 4, 2008 at 8:01 PM, Bill Page [EMAIL PROTECTED] wrote:
 On 3/4/08, I wrote:
  
These changes seem to work fine for me. If it also works for me, then
I think we should include this new 'tm_open-axiom.exe' in the
OpenAxiom for Windows installer program.
  

  What I meant of course was:

   These changes seem to work fine for me. If it also works for *you*,

   then I think we should include this new 'tm_open-axiom.exe' in the
   OpenAxiom for Windows installer program.

  Also, here is a more accurate patch for the changes required to
  'init-axiom.scm':


  [EMAIL PROTECTED] /c/My Program Files/WinTeXmacs/TeXmacs/plugins/axiom/progs
  $ diff -au 'Copy of init-axiom.scm' init-axiom.scm
  --- Copy of init-axiom.scm  Wed Apr 27 06:46:28 2005
  +++ init-axiom.scm  Tue Mar  4 19:17:35 2008

 @@ -17,7 +17,7 @@
(lazy-input-converter (axiom-input) axiom))

   (plugin-configure axiom
  -  (:require (url-exists-in-path? AXIOMsys))
  +  (:require (url-exists-in-path? open-axiom))
(:initialize (axiom-initialize))
  -  (:launch tm_axiom)
  -  (:session Axiom))
  +  (:launch tm_open-axiom)
  +  (:session OpenAxiom))

  -

  I am not so sure how best to distribute this change. Perhaps the
  OpenAxiom NSIS install script can look for WinTeXmacs and make this
  change if found - or better: to install a whole new add-in to
  WinTeXmacs just for OpenAxiom. I.e. copy all of 'c:/My Program
  Files/WinTeXmacs/TeXmacs/plugins/axiom' to 'c:/My Program
  Files/WinTeXmacs/TeXmacs/plugins/open-axiom' and replace
  init-axiom.scm. Then we only have to tell people: Install WinTeXmacs
  first and then install OpenAxiom. and everything should just work.

  Good luck.

  Regards,
  Bill Page.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/4/08, Alfredo Portes wrote:

  I applied the changes, but I get an error cannot open pipe.


Did all of the changes apply via 'patch' without problems?

Did the result compile without errors?

Where does the error cannot open pipe appear? It does not seem to be
an error generated anywhere within the 'tm_axiom.c' code.

Do you see 'OpenAxiom' under the Insert/Session menu?

What happens outside WinTeXmacs, just in MSYS when you write:

[EMAIL PROTECTED] ~
$ cd tm_open-axiom

[EMAIL PROTECTED] ~
$ unset OPENAXIOM

[EMAIL PROTECTED] ~/tm_open-axiom
$ tm_open-axiom
You must set the OPENAXIOM environment variable, e.g.
  OPENAXIOM=C:/Program Files/OpenAxiom/lib/open-axiom/i686-pc-mingw32/1.1.0

[EMAIL PROTECTED] ~/tm_open-axiom
$ export OPENAXIOM='C:/My Program Files/OpenAxiom/lib/open-axiom/i686-pc-mingw3
2/1.1.0'

[EMAIL PROTECTED] ~/tm_open-axiom
[EMAIL PROTECTED] ~/tm_open-axiom
$ (echo '1+1'; echo ')quit') | tm_open-axiom  test.out

[EMAIL PROTECTED] ~/tm_open-axiom
$ cat test.out
verbatim:channel:promptlatex:\red$\rightarrow$\
verbatim:latex:$$2\hfill \leqno
(1)$$latex:\axiomtype{PositiveInteger}channel:promptlatex:\red$\rightarrow$\
verbatim:latex:\red The end\black
[EMAIL PROTECTED] ~/tm_open-axiom

-

As you see this should start open-axiom and generate a file containing
Axiom output '$2\hfill \leqno (1)$'. (As well as a lot of other
syntactical markers specific to TeXmacs - including some non-printable
control codes that might tend to mess-up your console session.

Regards,
Bill Page.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel


Re: [open-axiom-devel] tm_openaxiom

2008-03-04 Thread Bill Page
On 3/4/08, Alejandro Jakubi wrote:

  Thank you for the patch. However, I have got a compilation error.

  I have edited tm_axiom.c with these lines instead and renamed it as
  tm_openaxiom.c. Then compiled it with MinGW-5.1.3:

  gcc tm_openaxiom.c texbreaker.c -o tm_open-axiom

  tm_openaxiom.c: In function `parse_options':
  tm_openaxiom.c:109: error: syntax error before ';' token

  Find attached this file tm_openaxiom.c. Any idea?


There was an error in my original email. I have attached my modified
version of tm_open-axiom.c to this email. It compiles without errors:

[EMAIL PROTECTED] ~/tm_open-axiom
$ gcc tm_open-axiom.c texbreaker.c -o tm_open-axiom

  Yes, in principle, I would prefer to keep both sessions (Axiom 2005
 and OpenAxiom 2008), and add others as they come along, unless
 it makes things too complicated.


To do this you will have to clone the existing axiom package in
WinTeXmacs. See my previous emails on this subject to Alfredo.

Regards,
Bill Page.


tm_open-axiom.c
Description: Binary data
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel