axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Current status on TeXmacs for Axiom?


From: Bill Page
Subject: Re: [Axiom-developer] Current status on TeXmacs for Axiom?
Date: 26 Sep 2003 23:19:35 -0400

David,

I am sorry that I was so slow in replying - jet lag ...

Your patch below is nearly the same as the changes I made
in my version of texmacs.

You will probably also have noticed that there is a bug
that sometimes causes Axiom ouput to be improperly formatted.
For example, if you start a new TeXmacs session and then
select Text/Session/Axiom from the menu and enter

  integrate(sin(x),x)

The ouput appears as

... UNISEG.o for domain UniversalSegment -cos(x)

with the result appended to the loading messages. But
subsequent commands work properly. The autoload message
is getting confused with the LaTex code that is generated
for the result. Issuing the command

  )set message autoload off

eliminates the problem by eliminating the Loading messages.

Maybe the patch to tm_axiom.c should also include this
command in the startup phase

--------
   /* force-feeding */
+  fputs(")set messages autoload off\n",axin); fflush(axin);
+#ifdef LOG
+  fputs("SENT )set messages autoload off\n",log); fflush(log);
+#endif
   fputs(")set messages prompt plain\n",axin); fflush(axin);
--------

Looking more closely, it seems that Axiom sometimes embeds
the autoload messages in the output stream in what seems a
strange order.

--------
)set output tex
integrate(sin(x),x)

   Loading ...

$$
   Loading /home/wspage/projects/axiom2/mnt/linux/algebra/UNISEG.o for
      domain UniversalSegment
-{\cos
\left(
{x}
\right)}
\leqno(1)
$$
--------

It is not yet clear to me at this time how to get TeXmacs to handle
such messages properly in all cases (look for "Loading ..." embedded
in the tex?), or whether perhaps a change can be /should be made to
axiom to avoid generating these messages inside the tex $$ ... $$
section.

Maybe the Loading ... messages should be sent to stderr rather
than stdout?
 
Cheers,
Bill Page.


On Fri, 2003-09-26 at 19:12, David MENTRE wrote:
> root <address@hidden> writes:
> 
> > The issue is that TeXmacs expects 2 prompts (the NAG version gives 2
> > prompts at startup) and the current version give one. It should be 
> > a simple change in the startup script somewhere.
> 
> It was not so simple to understand the code but I found the issue. Here
> is the patch.
> 
> The prompt patch is a one liner:
> -    else if (code==PROMPT) { if ((++prompts)==2) break; }
> +    else if (code==PROMPT) break;
> but I have taken the liberty to fix warning issued by gcc when compiling
> with -Wall.
> 
> One remaining warning is left. 
> tm_axiom.c: In function `session':
> tm_axiom.c:231: warning: suggest explicit braces to avoid ambiguous `else'
> I have not touched it. To late for me, I would risk introducing new bugs.
> 
> > Given that the NAG version has been off the market for 2 years come
> > Oct 1 I suppose it is time to drop it from TeXmacs.
> 
> Yes, sure. I take care of forwarding this patch to the TeXmacs
> developers.
> 
> Yours,
> d.
> 
> 
> --- tm_axiom.c.orig   Sat Sep 27 01:06:27 2003
> +++ tm_axiom.c        Sat Sep 27 01:06:40 2003
> @@ -9,7 +9,7 @@
>  #define TYPE   5
>  
>  #define LEN 128
> -/*#define LOG "/home/grozin/tmax/log"*/
> +/* #define LOG "/tmp/tm_axiom.log" */
>  
>  char buf[LEN];
>  int len,code,writing=1,wait_type=0;
> @@ -78,7 +78,7 @@
>      { for (k=0;k<j;) buf[i++]=prompt[k++];
>        j=0;
>        if (i>LEN-4) { code=LONG; break; }
> -      else if (c==EOF) { code==END; break; }
> +      else if (c==EOF) { code=END; break; }
>        else if (c=='\n') { buf[i++]='\n'; code=NORMAL; break; }
>        else buf[i++]=c;
>      }
> @@ -177,7 +177,7 @@
>  }
>  
>  void session(void)
> -{ int c,i,mmode,delims=0,prompts=0;
> +{ int c,mmode,delims=0;
>  #ifdef LOG
>    log=fopen(LOG,"w");
>  #endif
> @@ -188,7 +188,7 @@
>    while (1)
>    { iline();
>      if (code==TYPE) { if ((++delims)==2) writing=0; }
> -    else if (code==PROMPT) { if ((++prompts)==2) break; }
> +    else if (code==PROMPT) break;
>    }
>    /* force-feeding */
>    fputs(")set messages prompt plain\n",axin); fflush(axin);
> @@ -258,4 +258,5 @@
>        axin=fdopen(p2[1],"w"); axout=fdopen(p1[0],"r");
>        session();
>    }
> +  return 0;
>  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]