home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume1 / 8711 / microemacs-3.9 / ue3.9.bugs / comp.sources.bugs_251_000002.msg < prev    next >
Text File  |  1987-12-03  |  10KB  |  350 lines

  1. Path: tut!osu-cis!cbosgd!ihnp4!ptsfa!ames!hao!gatech!rebel!george
  2. From: george@rebel.UUCP (George M. Sipe)
  3. Newsgroups: comp.emacs,comp.sources.bugs
  4. Subject: MicroEMACS 3.9e standout bugs (fix)
  5. Summary: patch to fix standout on embedded attribute terminals
  6. Keywords: MicroEMACS standout
  7. Message-ID: <19598@rebel.UUCP>
  8. Date: 25 Nov 87 20:39:39 GMT
  9. Reply-To: george@rebel.UUCP (George M. Sipe)
  10. Organization: Tolerant Systems, Atlanta GA
  11. Lines: 336
  12. Xref: tut comp.emacs:644 comp.sources.bugs:251
  13.  
  14.  
  15. The recently posted version of MicroEMACS (3.9e) does not include the
  16. standout patches required for terminals with embedded attributes (which
  17. require a display position for standout begin/end - e.g. most TVI, LSI,
  18. Qume, etc. terminals and compatible).  If FIXSG is set (defined as set
  19. when TERMCAP is set), then for terminal entries which have non-zero
  20. 'sg' attributes defined, the mode lines will be properly managed.
  21.  
  22. I have re-integrated the patch previously posted for releases 3.8i and
  23. 3.9l for the 3.9e release.  Hopefully, this patch will be in future
  24. releases as promised by Daniel Lawrence, MicroEMACS author.  This is
  25. now the third time I've posted this patch.  Please let me know if you
  26. find it useful.
  27.  
  28. I have tested the patch on a variety of terminals without any
  29. problems.  No problems were reported from the use of this patch in the
  30. previous releases.  The patch in context diff format appears below.
  31.  
  32. George M. Sipe,        Phone: (404) 662-1533
  33. Tolerant Systems, 6961 Peachtree Industrial, Norcross, GA  30071
  34. UUCP: ...!{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!rebel!george
  35.  
  36.  
  37. *** display.c_orig    Wed Nov 25 15:12:50 1987
  38. --- display.c    Wed Nov 25 15:18:54 1987
  39. ***************
  40. *** 623,628
  41.       register int nbflag;    /* non-blanks to the right flag? */
  42.       int rev;        /* reverse video flag */
  43.       int req;        /* reverse video request flag */
  44.   
  45.   
  46.       /* set up pointers to virtual and physical lines */
  47.  
  48. --- 623,631 -----
  49.       register int nbflag;    /* non-blanks to the right flag? */
  50.       int rev;        /* reverse video flag */
  51.       int req;        /* reverse video request flag */
  52. + #if    TERMCAP & FIXSG & REVSTA
  53. +     int sook;        /* standout ok flag */
  54. + #endif
  55.   
  56.   
  57.       /* set up pointers to virtual and physical lines */
  58. ***************
  59. *** 655,661
  60.   
  61.           /* scan through the line and dump it to the screen and
  62.              the virtual screen array                */
  63. !         cp3 = &vp1->v_text[term.t_ncol];
  64.           while (cp1 < cp3) {
  65.               TTputc(*cp1);
  66.               ++ttcol;
  67.  
  68. --- 658,672 -----
  69.   
  70.           /* scan through the line and dump it to the screen and
  71.              the virtual screen array                */
  72. ! #if    TERMCAP & FIXSG & REVSTA
  73. !         if (req && SG > 0) {        /* Skip over 'spaces' */
  74. !             ttcol += SG;
  75. !             cp1 += SG;
  76. !             cp2 += SG;
  77. !             cp3 = &vp1->v_text[term.t_ncol-SG];
  78. !         } else
  79. ! #endif
  80. !             cp3 = &vp1->v_text[term.t_ncol];
  81.           while (cp1 < cp3) {
  82.               TTputc(*cp1);
  83.               ++ttcol;
  84. ***************
  85. *** 702,707
  86.       cp3 = &vp1->v_text[term.t_ncol];
  87.       cp4 = &vp2->v_text[term.t_ncol];
  88.   
  89.       while (cp3[-1] == cp4[-1]) {
  90.           --cp3;
  91.           --cp4;
  92.  
  93. --- 713,725 -----
  94.       cp3 = &vp1->v_text[term.t_ncol];
  95.       cp4 = &vp2->v_text[term.t_ncol];
  96.   
  97. + #if    TERMCAP & FIXSG & REVSTA
  98. +     if (req && SG > 0)            /* Adjust for 'spaces' */
  99. +         sook = (cp1 - &vp1->v_text[0]) > 0;
  100. +     else
  101. +         sook = FALSE;
  102. + #endif
  103.       while (cp3[-1] == cp4[-1]) {
  104.           --cp3;
  105.           --cp4;
  106. ***************
  107. *** 722,727
  108.   
  109.       movecursor(row, cp1 - &vp1->v_text[0]);    /* Go to start of line. */
  110.   #if    REVSTA
  111.       TTrev(rev);
  112.   #endif
  113.   
  114.  
  115. --- 740,748 -----
  116.   
  117.       movecursor(row, cp1 - &vp1->v_text[0]);    /* Go to start of line. */
  118.   #if    REVSTA
  119. + #if    TERMCAP & FIXSG
  120. +     if (!sook) TTrev(rev);
  121. + #else
  122.       TTrev(rev);
  123.   #endif
  124.   #endif
  125. ***************
  126. *** 724,729
  127.   #if    REVSTA
  128.       TTrev(rev);
  129.   #endif
  130.   
  131.       while (cp1 != cp5) {        /* Ordinary. */
  132.           TTputc(*cp1);
  133.  
  134. --- 745,751 -----
  135.   #else
  136.       TTrev(rev);
  137.   #endif
  138. + #endif
  139.   
  140.       while (cp1 != cp5) {        /* Ordinary. */
  141.           TTputc(*cp1);
  142. ***************
  143. *** 737,742
  144.               *cp2++ = *cp1++;
  145.       }
  146.   #if    REVSTA
  147.       TTrev(FALSE);
  148.   #endif
  149.       vp1->v_flag &= ~VFCHG;        /* flag this line as updated */
  150.  
  151. --- 759,767 -----
  152.               *cp2++ = *cp1++;
  153.       }
  154.   #if    REVSTA
  155. + #if    TERMCAP & FIXSG
  156. +     if (!sook) TTrev(FALSE);
  157. + #else
  158.       TTrev(FALSE);
  159.   #endif
  160.   #endif
  161. ***************
  162. *** 739,744
  163.   #if    REVSTA
  164.       TTrev(FALSE);
  165.   #endif
  166.       vp1->v_flag &= ~VFCHG;        /* flag this line as updated */
  167.       return(TRUE);
  168.   #endif
  169.  
  170. --- 764,770 -----
  171.   #else
  172.       TTrev(FALSE);
  173.   #endif
  174. + #endif
  175.       vp1->v_flag &= ~VFCHG;        /* flag this line as updated */
  176.       return(TRUE);
  177.   #endif
  178. ***************
  179. *** 829,834
  180.       n += 8;
  181.   #endif
  182.   
  183.       vtputc(lchar);
  184.       vtputc(lchar);
  185.       vtputc(' ');
  186.  
  187. --- 855,864 -----
  188.       n += 8;
  189.   #endif
  190.   
  191. + #if    TERMCAP & FIXSG & REVSTA
  192. +     if (revexist && SG > 0)            /* Initial spaces. */
  193. +     for (i = 0; i < SG; ++i) vtputc(' ');
  194. + #endif
  195.       vtputc(lchar);
  196.       vtputc(lchar);
  197.       vtputc(' ');
  198. ***************
  199. *** 870,875
  200.           ++n;
  201.           }
  202.   
  203.       while (n < term.t_ncol)             /* Pad to full width. */
  204.           {
  205.           vtputc(lchar);
  206.  
  207. --- 900,909 -----
  208.           ++n;
  209.           }
  210.   
  211. + #if    TERMCAP & FIXSG & REVSTA
  212. +     if (revexist && SG > 0)        /* Adjust for standouts. */
  213. +     n += SG * 3;
  214. + #endif
  215.       while (n < term.t_ncol)             /* Pad to full width. */
  216.           {
  217.           vtputc(lchar);
  218. ***************
  219. *** 875,880
  220.           vtputc(lchar);
  221.           ++n;
  222.           }
  223.   }
  224.   
  225.   upmode()    /* update all the mode lines */
  226.  
  227. --- 909,923 -----
  228.           vtputc(lchar);
  229.           ++n;
  230.           }
  231. + #if    TERMCAP & FIXSG & REVSTA
  232. + /* The 'so' position will show as a reverse space, while the 'se'
  233. +    position will be a normal space.  To balance the (visible)
  234. +    reverse spaces at each end of the mode line, twice as many
  235. +    spaces must exist at the end than do at the beginning.
  236. + */
  237. +     if (revexist && SG > 0)        /* Trailing spaces. */
  238. +     for (i = 0; i < SG * 2; ++i) vtputc(' ');
  239. + #endif
  240.   }
  241.   
  242.   upmode()    /* update all the mode lines */
  243. *** edef.h_orig    Wed Nov 25 15:12:52 1987
  244. --- edef.h    Wed Nov 25 15:12:51 1987
  245. ***************
  246. *** 125,130
  247.   char    tap[NPAT];            /* Reversed pattern array.    */
  248.   char    rpat[NPAT];            /* replacement pattern        */
  249.   
  250.   /* The variable matchlen holds the length of the matched
  251.    * string - used by the replace functions.
  252.    * The variable patmatch holds the string that satisfies
  253.  
  254. --- 125,134 -----
  255.   char    tap[NPAT];            /* Reversed pattern array.    */
  256.   char    rpat[NPAT];            /* replacement pattern        */
  257.   
  258. + #if    FIXSG & REVSTA
  259. + int    SG;                /* number of standout glitches    */
  260. + #endif
  261.   /* The variable matchlen holds the length of the matched
  262.    * string - used by the replace functions.
  263.    * The variable patmatch holds the string that satisfies
  264. ***************
  265. *** 263,268
  266.   extern    char    pat[];                  /* Search pattern        */
  267.   extern    char    tap[];            /* Reversed pattern array.    */
  268.   extern    char    rpat[];            /* replacement pattern        */
  269.   
  270.   extern unsigned int matchlen;
  271.   extern unsigned int mlenold;
  272.  
  273. --- 267,276 -----
  274.   extern    char    pat[];                  /* Search pattern        */
  275.   extern    char    tap[];            /* Reversed pattern array.    */
  276.   extern    char    rpat[];            /* replacement pattern        */
  277. + #if    FIXSG & REVSTA
  278. + extern    int    SG;            /* number of standout glitches    */
  279. + #endif
  280.   
  281.   extern unsigned int matchlen;
  282.   extern unsigned int mlenold;
  283. *** estruct.h_orig    Wed Nov 25 15:12:21 1987
  284. --- estruct.h    Wed Nov 25 15:12:19 1987
  285. ***************
  286. *** 74,79
  287.   #define VT52    0                       /* VT52 terminal (Zenith).      */
  288.   #define RAINBOW 0                       /* Use Rainbow fast video.      */
  289.   #define TERMCAP 0                       /* Use TERMCAP                  */
  290.   #define    IBMPC    1            /* IBM-PC CGA/MONO/EGA driver    */
  291.   #define    DG10    0            /* Data General system/10    */
  292.   #define    TIPC    0            /* TI Profesional PC driver    */
  293.  
  294. --- 79,85 -----
  295.   #define VT52    0                       /* VT52 terminal (Zenith).      */
  296.   #define RAINBOW 0                       /* Use Rainbow fast video.      */
  297.   #define TERMCAP 0                       /* Use TERMCAP                  */
  298. + #define    FIXSG    TERMCAP            /* Fix stand-out glitch        */
  299.   #define    IBMPC    1            /* IBM-PC CGA/MONO/EGA driver    */
  300.   #define    DG10    0            /* Data General system/10    */
  301.   #define    TIPC    0            /* TI Profesional PC driver    */
  302. *** tcap.c_orig    Wed Nov 25 15:12:54 1987
  303. --- tcap.c    Wed Nov 25 15:12:53 1987
  304. ***************
  305. *** 117,122
  306.       SO = tgetstr("so", &p);
  307.       if (SO != NULL)
  308.           revexist = TRUE;
  309.   
  310.           if(CL == NULL || CM == NULL || UP == NULL)
  311.           {
  312.  
  313. --- 117,125 -----
  314.       SO = tgetstr("so", &p);
  315.       if (SO != NULL)
  316.           revexist = TRUE;
  317. + #if    FIXSG & REVSTA
  318. +     SG = tgetnum("sg");    /* standout glitch     */
  319. + #endif
  320.   
  321.           if(CL == NULL || CM == NULL || UP == NULL)
  322.           {
  323. ***************
  324. *** 167,173
  325.   int state;        /* FALSE = normal video, TRUE = reverse video */
  326.   
  327.   {
  328. !     static int revstate = FALSE;
  329.       if (state) {
  330.           if (SO != NULL)
  331.               putpad(SO);
  332.  
  333. --- 170,178 -----
  334.   int state;        /* FALSE = normal video, TRUE = reverse video */
  335.   
  336.   {
  337. !     static int oldstate = TRUE + TRUE;
  338. !     if (state == oldstate) return;
  339. !     oldstate = state;
  340.       if (state) {
  341.           if (SO != NULL)
  342.               putpad(SO);
  343. -- 
  344. George M. Sipe,        Phone: (404) 662-1533
  345. Tolerant Systems, 6961 Peachtree Industrial, Norcross, GA  30071
  346. UUCP: ...!{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!rebel!george
  347.