From xemacs-m  Mon Jun  2 19:17:22 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 TAA09374
	for <xemacs-beta@xemacs.org>; Mon, 2 Jun 1997 19:17:22 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id RAA05727; Mon, 2 Jun 1997 17:34:59 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id RAA03712; Mon, 2 Jun 1997 17:16:12 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id RAA17443; Mon, 2 Jun 1997 17:16:09 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id RAA03741; Mon, 2 Jun 1997 17:16:06 -0700
Date: Mon, 2 Jun 1997 17:16:06 -0700
Message-Id: <199706030016.RAA03741@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Gary Foster <gary.foster@corp.Sun.COM>,
        "Barry A. Warsaw" <bwarsaw@python.org>
Cc: XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: backspace-or-delete feedback
X-Mailer: VM 6.31 under 20.3 XEmacs Lucid (beta3)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

I made the suggested customization to delete-erases-forward to get DEL
to delete forwards:

(setq delete-erases-forward t)

I found it didn't work in cc-mode since it has a
backspace-or-delete-hook that deletes backward unless further
customizations are done.  I had to do further customizations for
cc-mode to get XEmacs to do the Right Thing.  I think it's very
important that users be able to get consistent backspace/delete
customization via above *one* line in .emacs, i.e.

(setq delete-erases-forward t) 

and we should make this the default (in the fullness of time).

From my .emacs:

(if (fboundp 'backspace-or-delete)
    (progn
      (setq delete-erases-forward t)
      (setq c-delete-function 'delete-char))
  (old-stuff here...))
	
BTW: When I wrote (x-keysym-on-keyboard-p), my intent was that it be
used only in initialization code, not in a command that gets run
frequently, thinking that the performance hit would be noticable.

But I just checked how long it actually takes to run, and noticed that
(dotimes (j 10000) (x-keysym-on-keyboard-p "BackSpace")) takes 7
seconds, most of it in garbage collection, so a single call is not a
big deal.  This despite the fact that x-keysym-on-keyboard-p is
implemented by linear search through all valid (appr. 255) keycodes.
Computers sure are fast.  

Hmmm. further investigation reveals that 
(dotimes (j 10000) (x-keysym-on-keyboard-p "BackSpace") 
takes only .2 seconds on a non-Mule XEmacs.  Almost all the overhead
is the lisp overhead associated with converting the keysym lisp string 
to an external string!  There sure are opportunities for
performance tuning here.

Martin

