Karim Belabas on Thu, 8 Jan 1998 03:26:52 +0100


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

patch 10 + Re: update 2.0.2.alpha


Hi all, I'm back! (and a happy new year to everybody)

John Cremona wrote (msg 39):
> I think I have discovered the problem with gp under emacs under linux
> which Kevin Buzzard had.  It only started happening for me when I
> reinstalled the patched version 2.0.2alpha.  The problem comes from
> the following code for the function do_prompt in gp.c: [...]

  This is indeed a new bug, but an unrelated one (I had Kevin do a battery of
tests that ruled out colors as the culprit). In fact I finally could
reproduce the bug during this Christmas break (PC under Linux + readline 2.0
+ Emacs 19.34.1): the problem disappeared when I upgraded to readline 2.1...
I did not investigate further, but I guess this will solve Kevin's problem.

> I suggest that the color setting is turned off altogether when gp is called
> with the -emacs switch, probably by patching the function setdcolors.

  Agreed. For the time being, the following patch will do:
default(colors,...) will fail silently if we are under Emacs. As Gerhard
suggested (msg 40), it should be possible to have Emacs translate the escape
sequences as gp sends them. In fact, if a kind soul knows how to do this and
wants to modify pari.el, I'd be overjoyed to include such a patch (although
I don't use Emacs myself...).

Cheers, Karim.

======================= patch 10 (2.0.2.alpha) ===================

*** ./gp.c.orig	Thu Jan  8 02:11:39 1998
--- ./gp.c	Wed Jan  7 12:01:00 1998
*** 909,922 ****
    if (*v)
    {
      if (status == d_INITRC) readstring(v,v,v + GET_SEP_SIZE);
!     disable_color=1;
!     for (c=c_ERR; c < c_LAST; c++)
      {
!       while (isspace(*v)) v++;
!       n = atol(v); if (!isdigit(*v)) n = c_NONE;
!       if (n != c_NONE) disable_color=0;
!       while (*v && *v++ != ',') /* empty */;
!       gp_colors[c] = n;
      }
    }
    if (status != d_ACKNOWLEDGE) return;
--- 898,914 ----
    if (*v)
    {
      if (status == d_INITRC) readstring(v,v,v + GET_SEP_SIZE);
!     if (!under_emacs)
      {
!       disable_color=1;
!       for (c=c_ERR; c < c_LAST; c++)
!       {
!         while (isspace(*v)) v++;
!         n = atol(v); if (!isdigit(*v)) n = c_NONE;
!         if (n != c_NONE) disable_color=0;
!         while (*v && *v++ != ',') /* empty */;
!         gp_colors[c] = n;
!       }
      }
    }
    if (status != d_ACKNOWLEDGE) return;
--
Karim Belabas                          e-mail:
Max-Planck-Institut fuer Mathematik       karim@mpim-bonn.mpg.de
Gottfried-Claren-Str. 26               tel:
53225 Bonn (Germany)                      (00 49 228) 402-245