🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #150

Bug report - Epoch 4.1 keybindings

#150
From: meissner
Date: Tue, 11 Aug 1992 13:10
171 lines
4604 bytes
| 	Bug report for Epoch 4.1 on Sparc SunOS 4.1.2, MIT X11R5.
| 
| Both without and with EIGHTBIT_KEYBOARD defined,
| 	(global-set-key "\M-$" ispell-word)
| binds a single eight-bit character (circle-x) to ispell-word, rather
| than binding ESC-$ or Meta-$ (which are somehow not affected by the
| above form).
| 	Other relatively standard packages which are now broken
| because of this change: ILisp and the TMC completion package.  If
| there is a new syntax for binding meta-keys there should at least be
| some documentation of it in the distribution (hopefully with pointers
| to it in the top-level epoch text/info/CHANGES documents).
| 
| fixes??
| 	-mik (mthome@bbn.com)

Yes, this is unacceptable behavior.  Here is a fix:

Tue Aug 11 14:59:21 1992  Michael Meissner  (meissner@osf.org)

	* lread.c (read1): Convert \M-x into escape followed by x, since a
	lot of lisp code uses it to set up keymaps, and the Meta key now
	generates escape.

*** lread.c.~2~	Tue Aug 11 13:36:52 1992
--- lread.c	Tue Aug 11 16:57:12 1992
***************
*** 599,604 ****
--- 599,605 ----
       register Lisp_Object readcharfun;
  {
    register int c;
+   int meta;
  
   retry:
  
***************
*** 640,646 ****
  
  	XSET (val, Lisp_Int, READCHAR);
  	if (XFASTINT (val) == '\\')
! 	  XSETINT (val, read_escape (readcharfun));
  
  	return val;
        }
--- 641,647 ----
  
  	XSET (val, Lisp_Int, READCHAR);
  	if (XFASTINT (val) == '\\')
! 	  XSETINT (val, read_escape (readcharfun, (int *)0));
  
  	return val;
        }
***************
*** 662,669 ****
  		read_buffer += new - read_buffer;
  		end = read_buffer + read_buffer_size;
  	      }
  	    if (c == '\\')
! 	      c = read_escape (readcharfun);
  	    /* c is -1 if \ newline has just been seen */
  	    if (c < 0)
  	      {
--- 663,671 ----
  		read_buffer += new - read_buffer;
  		end = read_buffer + read_buffer_size;
  	      }
+ 	    meta = 0;
  	    if (c == '\\')
! 	      c = read_escape (readcharfun, &meta);
  	    /* c is -1 if \ newline has just been seen */
  	    if (c < 0)
  	      {
***************
*** 671,677 ****
  		  cancel = 1;
  	      }
  	    else
! 	      *p++ = c;
  	  }
  
  	UNREAD (c);
--- 673,695 ----
  		  cancel = 1;
  	      }
  	    else
! 	      {
! 		if (meta)
! 		  {
! 		    /* Handle \M-xx keymaps in a sane fashion.
! 		       meissner@osf.org */
! 		    *p++ = '\033';
! 		    if (p == end)
! 		      {
! 			char *new = (char *) xrealloc (read_buffer, read_buffer_size *= 2);
! 			p += new - read_buffer;
! 			read_buffer += new - read_buffer;
! 			end = read_buffer + read_buffer_size;
! 		      }
! 		  }
! 
! 		*p++ = c;
! 	      }
  	  }
  
  	UNREAD (c);
***************
*** 847,854 ****
  }
  
  static int
! read_escape (readcharfun)
       Lisp_Object readcharfun;
  {
    register int c = READCHAR;
    switch (c)
--- 865,873 ----
  }
  
  static int
! read_escape (readcharfun, meta)
       Lisp_Object readcharfun;
+      int *meta;
  {
    register int c = READCHAR;
    switch (c)
***************
*** 878,884 ****
  	error ("Invalid escape character syntax");
        c = READCHAR;
        if (c == '\\')
! 	c = read_escape (readcharfun);
        return c | 0200;
  
      case 'C':
--- 897,908 ----
  	error ("Invalid escape character syntax");
        c = READCHAR;
        if (c == '\\')
! 	c = read_escape (readcharfun, (int *)0);
!       if (meta)
! 	{
! 	  *meta = 1;
! 	  return c;
! 	}
        return c | 0200;
  
      case 'C':
***************
*** 888,894 ****
      case '^':
        c = READCHAR;
        if (c == '\\')
! 	c = read_escape (readcharfun);
        if (c == '?')
  	return 0177;
        return (c & 0200) | (c & 037);
--- 912,918 ----
      case '^':
        c = READCHAR;
        if (c == '\\')
! 	c = read_escape (readcharfun, meta);
        if (c == '?')
  	return 0177;
        return (c & 0200) | (c & 037);

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
Technical Details
Message-ID: <9208112110.AA06450@tiktok.osf.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!osf.ORG!meissner
References: meissner@osf.ORG

Show Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Subject: Bug report - Epoch 4.1 keybindings
Message-ID: <9208112110.AA06450@tiktok.osf.org>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
References: meissner@osf.ORG
Distribution: gnu
Date: Tue, 11 Aug 1992 13:10:09 GMT
Lines: 171