From xemacs-m  Wed Jun  4 12:13:15 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 MAA17842
	for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 12:13:15 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id KAA06451 for <xemacs-beta@xemacs.org>; Wed, 4 Jun 1997 10:31:16 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id KAA21947; Wed, 4 Jun 1997 10:13:39 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id KAA13812; Wed, 4 Jun 1997 10:13:37 -0700
To: xemacs-beta@xemacs.org
Subject: cperl-mode delete behavior [PATCH] 
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Jun__4_10:13:37_1997-1"
Content-Transfer-Encoding: 7bit
From: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Date: 04 Jun 1997 10:13:37 -0700
Message-ID: <bci3eqys33y.fsf@corp.Sun.COM>
Lines: 53
X-Mailer: Gnus v5.4.55/XEmacs 20.3(beta3)

--Multipart_Wed_Jun__4_10:13:37_1997-1
Content-Type: text/plain; charset=US-ASCII

And here's the patch to cperl-mode.el to make *it* also honor the
desired delete behavior.  cperl-electric-backspace isn't written quite 
as spiffily as Barry's c-electric-delete function so I, with my
limited LISP expertise haven't quite grokked whether there's any deep
voodoo that I missed but it seems to also work fine for me.

As with cc-mode, I've removed the bit where it hangs off the hook and
moved it back to a define-key implementation.  Also, as with cc-mode,
the actual changes to support the behavior were pretty trivial.

-- Gary F.

--Multipart_Wed_Jun__4_10:13:37_1997-1
Content-Type: text/plain; name="cperl-mode.patch"; charset=US-ASCII

--- lisp/modes/cperl-mode.el.orig	Wed Jun  4 09:50:47 1997
+++ lisp/modes/cperl-mode.el	Wed Jun  4 10:07:16 1997
@@ -713,8 +713,7 @@
   (cperl-define-key "\e\C-q" 'cperl-indent-exp) ; Usually not bound
   ;;(cperl-define-key "\M-q" 'cperl-fill-paragraph)
   ;;(cperl-define-key "\e;" 'cperl-indent-for-comment)
-;; GDF - don't clobber the DEL binding...
-;;  (cperl-define-key "\177" 'cperl-electric-backspace)
+  (cperl-define-key "\177" 'cperl-electric-backspace)
   (cperl-define-key "\t" 'cperl-indent-command)
   ;; don't clobber the backspace binding:
   (cperl-define-key "\C-hf" 'cperl-info-on-command [(control h) f])
@@ -992,8 +991,6 @@
 with no args."
   (interactive)
   (kill-all-local-variables)
-  (make-local-hook 'backspace-or-delete-hook)
-  (add-hook 'backspace-or-delete-hook 'cperl-electric-backspace nil t)
   ;;(if cperl-hairy
   ;;    (progn
   ;;	(cperl-set 'cperl-font-lock cperl-hairy)
@@ -1563,8 +1560,9 @@
 	(setq p (point))
 	(skip-chars-backward " \t\n")
 	(delete-region (point) p))
-    (backward-delete-char-untabify (prefix-numeric-value arg)))
-  t)
+    (if (fboundp 'backspace-or-delete)
+	(backspace-or-delete (prefix-numeric-value arg))
+      (backward-delete-char-untabify (prefix-numeric-value arg)))))
 
 (defun cperl-inside-parens-p ()
   (condition-case ()

--Multipart_Wed_Jun__4_10:13:37_1997-1--

