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: David MENTRE
Subject: Re: [Axiom-developer] Current status on TeXmacs for Axiom?
Date: Sat, 27 Sep 2003 01:12:41 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

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;
 }

-- 
 address@hidden




reply via email to

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