From xemacs-m  Wed Jun  4 19:05:48 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 TAA02382
	for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 19:05:47 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id RAA02244 for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 17:23:53 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id RAA16861; Wed, 4 Jun 1997 17:06:12 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id RAA14733; Wed, 4 Jun 1997 17:06:10 -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>
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 17:06:10 -0700
In-Reply-To: Hrvoje Niksic's message of 05 Jun 1997 01:47:32 +0200
Message-ID: <bcizpt5oqvh.fsf@corp.Sun.COM>
Lines: 106
X-Mailer: Gnus v5.4.55/XEmacs 20.3(beta3)

Hrvoje Niksic <hniksic@srce.hr> writes:

> Yes, but \177 is turned to delete.  Which is in turn output as DEL.
> Look at the source.
> 
> > (define-key global-map 'delete 'foo)
> > 
> > Doesn't change anything.  I'll gladly accept the fact that the DEL key 
> > *should* generate a 'delete, and that doing the second define-key
> > above SHOULD be the proper way to bind 'foo to the DEL key, but it's
> > not the way it is right now.
> 
> Have you tested this example?  In 20.3-b3, the above form makes every
> pressing of the grey key go beep for me.

Yep, I have.  After evaluating it, every press of the delete key
invokes 'backspace-or-delete.  In tty mode, too.


> I really believe that \177 should be mapped to delete by default --
> but via `function-key-map'.  On TTY-s with tty-erase-char other than
> ?\C-h, it should be mapped to backspace; again, via
> `function-key-map'.
> 
> This is a slightly different approach, but I believe it should do
> well.  What do you think?

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.


> I believe everyone wants the key above enter to delieve backwards, and 
> the one right to it (if he/she has it) forwards.  If there are those
> who violate it, we'll deal with them. :-)

Well, some people want that and others want the key to the right of it
to erase backwards as well.  Thus the rwar erupts.  Hell, if that
weren't the case we could just map the delete key to 'delete-char and
walk away passively, alas that isn't the case.

> 
> > 	the erase key has always been assumed to be the "delete" key
> > 	in tty mode, when it should be configurable as well.
> 
> Yes, that is very lousy.  I'm not sure how to deal with it.  It's also 
> not in accordance with my previous claims about \177 generating
> backspace when tty-erase-char is other than C-h.

I think you've already laid the ground work for fixing this with the
tty-erase-char addition, as well as some of the excellent suggestions
from everyone else.

> The cited thing.  I just wanted to ask whether such a design is a Good
> Thing (no, I didn't mean to get personal; I'm not Erik).
> 
> I'd prefer delete (or whatever) being bound to delete-forward and
> backspace to delete-backward, provided I have both keysyms.  Since I
> don't, the next-of-kin choice is to bind backspace to /dev/null and
> delete to delete-backwards.

That would suit me just fine, too, however it doesn't take into
account those people who want DEL and BS keys to both do the same
thing, nor does it take into account rebinding them to other
functions.  At least now we can easily rebind them at a very high
level and that, fwiw, is a small victory.  We've finally shifted from
using translations to an argument on what the keys themselves should
invoke which means we're making progress. :)

> 
> I notice that your scheme doesn't work that way, and I'd like to ask
> why -- without *ever* wanting to "cut it to shreds."

My scheme doesn't do that on a low level, but it does have the same
end result:

If you have both keysyms, you can have one key delete forwards and the 
other delete backwards.  This can easily be done with one line in your 
.emacs, instead of loading some package.

If you only have the one keysym you get the default backwards-deletion 
with that keypress.  No if's, and's, or's, or but's about it.

But I also make allowances for the fact that the user might WANT both
keys to be bound to completely weird things or whatever.  I guess I
feel that my solution offers the end functionality that you ask for in 
addition to the end functionality that other people have asked for
without forcing a choice down their throats.

> The only thing you fail to understand is exactly what I mean.  I hope
> this message of mine was sufficiently clear.

I hope I'm understanding fully now.  I think the only thing we really
differ on is whether pressing the "del" key should generate a 'delete
or a "\177".  Come to think of it, I think we both agree that it
SHOULD generate a 'delete, and what we actually differ on is whether
it does currently do that in all cases.  I'm all for making it do so
in all cases.  Then we let the function that is invoked by the 'delete 
keysym sort out whether the user expects forwards or backwards
deletion.  Have I got it?

-- Gary F.

