From xemacs-m  Wed Jun  4 21:04:54 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id VAA14977
	for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 21:04:53 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id TAA16026 for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 19:22:56 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id TAA25175; Wed, 4 Jun 1997 19:05:13 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id TAA15159; Wed, 4 Jun 1997 19:05:12 -0700
To: Hrvoje Niksic <hniksic@srce.hr>
Cc: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: cc-mode delete behavior [PATCH]
References: <bcipvu2pbof.fsf@corp.Sun.COM> <kiglo4qjjgt.fsf@jagor.srce.hr> <bciiuzuqjae.fsf@corp.Sun.COM> <kighgfejhf5.fsf@jagor.srce.hr> <bci67vuqdvs.fsf@corp.Sun.COM> <kig67vurrpn.fsf@jagor.srce.hr> <bciwwoaowwz.fsf@corp.Sun.COM> <kig4tberkvf.fsf@jagor.srce.hr> <bcizpt5oqvh.fsf@corp.Sun.COM> <kigwwo9ritd.fsf@jagor.srce.hr>
X-Attribution: GDF
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
From: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Date: 04 Jun 1997 19:05:12 -0700
In-Reply-To: Hrvoje Niksic's message of 05 Jun 1997 02:31:58 +0200
Message-ID: <bcilo4pold3.fsf@corp.Sun.COM>
Lines: 101
X-Mailer: Gnus v5.4.55/XEmacs 20.3(beta3)

Hrvoje Niksic <hniksic@srce.hr> writes:

> > Hmm, if we map \177 to delete by default via the function-key-map, and
> > I change all my references from "\177" to 'delete, that should in
> > effect do what you're saying here, right?  Or am I misunderstanding?
> > I *believe* that what your saying is that pressing the "del" key
> > should generate a 'delete keysym, which we then map to 'foo-function
> > or whatever instead of mapping "\177"?  If I understand correctly,
> > then yes, I agree.
> 
> Now you got me.  This is indeed quite complex, and now I'll try to
> explain *very* carefully exactly what I am trying to say.  In
> different parts of discussion I was hinting at two things (which I now 
> realize.)


Wow... good summary, and I think we're *finally* on the same page, the 
same paragraph, even the same sentence. :)

> 
> If I understand correctly, you have a third approach which says that:
> 
> c)
>    1. pressing the key above enter generates \177
> 
>    2. character_to_event or function-key-map convert it to delete
> 
>    3. delete is bound to `delete-backward-or-forward'
> 
>    4. `delete-backward-or-forward' does its magic, according to the
>       alignment of the stars, the moon, the sun, tty-erases-forward
>       and x-keysym-on-keyboard-p *what* it should really do.


Actually, the key above enter (backspace on my keyboard) should
generate backspace.  The key just to the right of it (the one with
"Del" written on it in tiny little letters) is the one that should
generate \177.  If the key above enter on YOUR keyboard has "Del"
written on it, it should generate \177, which would correspond to what
you're saying.  Other than that, I agree one hundred and fourteen
percent.


> I believe solution c) may be the winning one, although I hate it. :-) 
> Seriously, your solution is the compromise between a) and b), which
> should make the end user and the Lisp authors happy.


Yes, although I also think that maybe I could rethink how I'm doing
the x-keysym bit and the initial mapping.  I'm initially (in
keydefs.el) mapping the key above enter (hereby referred to as BS) to
'backward-delete-char and mapping the key to the right of BS (hereby
referred to as DEL) (via the perhaps braindeadness of "\177" as
outlined above) to the function 'backspace-or-delete (which you
renamed in 3 above... )  Then, in the function I'm checking for
x-keysym-on... and not letting it delete forwards unless they HAVE a
backspace keysym AND they've set their desired behavior to that.

Now, I'm thinking this is, uhm... kinda stupid in retrospect.
Instead, I could probably take the keysym-on-keyboard check out of the 
function itself and instead, in keydefs.el when the initial keys get
mapped do something like the following:

(define-key global-map 'delete (if (xkeysym-check)
                                   'backspace-or-delete
                                 'backwards-delete-char))

This would result in the DEL key being mapped automatically to the
right function if they don't have a BS key, and wouldn't incur the
overhead of the keysym check every single time they invoke the b-or-d
function.  -OR-, instead of the above, I could also just translate DEL 
to BS if they don't have a BS key and then the whole issue becomes
moot.

Other than that, I'd still continue to forge ahead with the solution C 
as you outlined above, except for the change in the actual keymappings 
on startup.

> With my approach b) implemented, I really think we could map the
> delete key to 'delete-char.  I am prepared to die.

That's admirable, however, it's unnecessary and unacceptable.  I think 
that (as you stated) with sol'n C we can satisfy everyone with the
functionality necessary.  I promise to not take away your DEL key. :)


> > I think the only thing we really differ on is whether pressing the
> > "del" key should generate a 'delete or a "\177".
> 
> Define "generate".  I think it should exit character_to_event as
> \177.  The default function-key-map will set it to <something> in case 
> a) and 'delete in case b).

I think it should set it to 'delete, as in case b.  Then, I can simply
change all my references (in keybindings) from "\177" to 'delete and
everything would be a little more sensible.  I believe that is the
behavior that it _claims_ to do now, as well, so that would require
the least changes.  Perhaps I have something screwy in my setup that
is preventing this?  I'll investigate further.

-- Gary F.

