[comp.emacs] Bug in Uemacs 3.9e

larry@jc3b21.UUCP (Lawrence F. Strickland) (04/07/88)

In the modifications to MicroEmacs 3.9e to allow cursor/function key handling
under UNIX, there was a bug that affected ONLY building MicroEmacs on a BSD
type system.  The (simple) patch is given below:

DESCRIPTION:  When using BSD4.[23], the ESC key did not always work unless
you waited at least one second after hitting the key.

REPEAT-BY:  Execute emacs, then hit ESC followed by x rather fast.  Instead
of getting a : at the bottom of the screen, nothing happens.  Hitting the
space bar results in the message:  [Mark Set]

FIX: At or about line 448 in the tcap.c file, you will find the two lines:
		if(pbptr > pbbuf)
			c = *--pbptr;
Change to the following four lines (NOTE:  just add two lines):
		if(pbptr > pbbuf)
			{
			c = *--pbptr;
			return(127 & c);
			}
Note that this is a QUICK FIX.  There are some additional changes that would
prove better, but this does repair the problem.  A more complete change that
improves running speed follows.  Here is an official context diff which can
be used with Larry Walls patch program:

-------cut here-------------------cut here-------------------cut here-------
*** tcap.c.orig	Thu Apr  7 07:43:50 1988
--- tcap.c	Thu Apr  7 07:45:51 1988
***************
*** 446,451
  	int c;
  
  	if(pbptr > pbbuf)
  		c = *--pbptr;
  #if	USG
  	else if(kbdqp)	/* char waiting in buffer */

--- 446,452 -----
  	int c;
  
  	if(pbptr > pbbuf)
+ 		{
  		c = *--pbptr;
  		return(127 & c);
  		}
***************
*** 447,452
  
  	if(pbptr > pbbuf)
  		c = *--pbptr;
  #if	USG
  	else if(kbdqp)	/* char waiting in buffer */
  		{

--- 448,455 -----
  	if(pbptr > pbbuf)
  		{
  		c = *--pbptr;
+ 		return(127 & c);
+ 		}
  #if	USG
  	else if(kbdqp)	/* char waiting in buffer */
  		{
-------cut here-------------------cut here-------------------cut here-------
-- 
+--------------------------------------+-- St. Petersburg Junior College --+
|        Lawrence F. Strickland        |   P.O. Box 13489                  |
| ...gatech!codas!usfvax2!jc3b21!larry |   St. Petersburg, FL 33733        |
+-(or) ...gatech!usfvax2!jc3b21!larry -+-- Phone: +1 813 341 4705 ---------+