From xemacs-m  Tue Jun 10 18:38:35 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 SAA04867
	for <xemacs-beta@xemacs.org>; Tue, 10 Jun 1997 18:38:35 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id QAA13419; Tue, 10 Jun 1997 16:57:31 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id QAA28384; Tue, 10 Jun 1997 16:38:31 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id QAA06577; Tue, 10 Jun 1997 16:38:30 -0700
To: CCMODE Maintainer <cc-mode-help@python.org>
Cc: Hrvoje Niksic <hniksic@srce.hr>,
        XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: BackSpace and Delete -- am I getting it? ;-)
References: <bcipvu2pbof.fsf@corp.Sun.COM> 	<kiglo4qjjgt.fsf@jagor.srce.hr> 	<bciiuzuqjae.fsf@corp.Sun.COM> <199706102258.SAA26565@anthem.CNRI.Reston.Va.US>
X-Attribution: GDF
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
From: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Date: 10 Jun 1997 16:38:29 -0700
In-Reply-To: "Barry A. Warsaw"'s message of "Tue, 10 Jun 1997 18:58:57 -0400"
Message-ID: <bciwwo2jafe.fsf@corp.Sun.COM>
Lines: 52
X-Mailer: Gnus v5.4.56/XEmacs 20.3(beta4)

"Barry A. Warsaw" <bwarsaw@CNRI.Reston.VA.US> writes:

> Diggit.  Right now I'm primarily concerned with The Right Thing To Do
> For CC Mode.  Currently I have this binding:
> 
>       (define-key c-mode-base-map "\177"      'c-electric-delete)

Does changing this to:

(define-key c-mode-base-map 'delete 'c-electric-delete)

break anything?  Because that is what I did in my local copies and it
worked fine, but I am (admittedly) a little fuzzy on the differences
between keymapping between Emacs families.

> If I do add this feature, then I need to add a new function called
> c-electric-backspace and variable c-backspace-function, which have the 
> current semantics and values.  Then I change c-electric-delete to do
> hungry optional-forward-direction deletion and set c-delete-function
> to 'backspace-or-delete.

That would seem to take you in the direction you seem to want to go,
thus far... however...

> 
> But my inclination is to not add this feature, and only change CC Mode
> so that it does *not* bind "\177" at all (which should leave
> #<keypress-event delete> running backspace-or-delete).  But I should
> bind [backspace] to c-electric-delete as so:

That would work also...

> Oh dang, it occurs to me that if delete-erases-forward is nil, then
> #<keypress-event delete> *should* hungrily delete backwards, so maybe
> I have to add all that machinery anyway. ;-/

This also makes sense.  Now I think *I* am the one getting confused.
I think, if I've managed to not completely munge up the issue here,
that adding two functions, one which is a "do it backwards and don't
hassle me" and the other which is a "do it in one of the two
directions" and binding the first one to backspace and the second one
to delete will accomplish what you're going for.  But then again, I
haven't had much caffeine today and I'm thinking kinda slow.

> The tricky bit is that the spelling "\177" means different things in
> XEmacs 19 and 20 (I haven't even tried Emacs 19.34 and decendents!),

Again, what about changing all your references of "\177" to 'delete.
Will that, then, just grab the 'delete event (which may or may not be
bound to both the backspace and/or delete keys)?

-- Gary F.

