From xemacs-m  Sat May 17 12:07:26 1997
Received: from cerise.sensei.co.uk (glynn@muvies.demon.co.uk [158.152.66.14])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA12605
	for <xemacs-beta@xemacs.org>; Sat, 17 May 1997 12:07:24 -0500 (CDT)
Received: (from glynn@localhost) by cerise.sensei.co.uk (8.8.2/8.8.2) id RAA01810; Sat, 17 May 1997 17:55:36 +0100
Date: Sat, 17 May 1997 17:55:36 +0100
Message-Id: <199705171655.RAA01810@cerise.sensei.co.uk>
From: Glynn Clements <glynn@sensei.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Cc: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: DEL patch, as promised.
In-Reply-To: <bcivi4i27ar.fsf@corp.Sun.COM>
References: <bciaflv2kuv.fsf@corp.Sun.COM>
	<kigiv0jrthb.fsf@jagor.srce.hr>
	<bci67wj2dqa.fsf@corp.Sun.COM>
	<199705170101.CAA08601@cerise.sensei.co.uk>
	<bcivi4i27ar.fsf@corp.Sun.COM>
X-Mailer: VM 6.31 under 20.2 XEmacs Lucid


Gary D. Foster wrote:

> Oh.. duh... I'm an idiot... sheesh.  It helps if I keep it local in
> the add-hooks... here, try this:

Tried it. Fixed the problem. Unfortunately I think it maintains too
much compatibility. In c-mode, the Delete key still runs
c-electric-delete, which deletes backwards. Other modes seem fine.

> > One idea that occurred to me is to create (virtual?) keysyms for
> > `forward-delete' and `backward-delete', and to systematically
> > eliminate all references to `delete' or `backspace'.
> 
> That occurred to me also, but it kind of scared me to rip it apart
> that thoroughly.

I suspect that this confusion between Delete, BackSpace, C-h, ?\177,
\010, \e[3~, the VERASE character, ... goes so deep that only ripping
it apart that thoroughly will work.

If you decide to try this, I'll give you whatever help I can, although 
trying to debug the keystroke handling just loses me.

If you debug the binary with gdb, you can't find out where in the lisp
code functions are getting called from, and most of the values being
passed around are of type Lisp_Object, which is just an integer
AFAICT.

If you try to debug the lisp code within XEmacs, you find you can't
set a breakpoint on a primitive, so you can't find out where it's
getting called from.

> > Also in an attempt to figure out why I can't bind BS and Delete
> > seperately on a tty, I stumbled across the `character_to_event'
> > function in events.c. This contains the following snippet:
> 
> This is a scary bit of code, if you ask me...

Yeah, right. Why this stuff has to be hardwired into the binary is
beyond me. So much for `XEmacs is the extensible, customizable
...'. Customizable? Oh, really?

I changed the QKdelete to QKbackspace, just to see what would break;
turned out to be most things. Pressing BackSpace under X in shell-mode
caused XEmacs to hang for a while before displaying the message:
`Variable binding depth exceeds max-specpdl-size', which suggests an
infinite loop.

I suspect that char_to_event() gets used to translate all of these
(define-key foo-map "\177" foo) occurrences.

-- 
Glynn Clements <glynn@sensei.co.uk>

