diff lisp/modes/cc-mode.el @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents cca96a509cfe
children 43dd3413c7c7
line wrap: on
line diff
--- a/lisp/modes/cc-mode.el	Mon Aug 13 09:37:21 2007 +0200
+++ b/lisp/modes/cc-mode.el	Mon Aug 13 09:38:25 2007 +0200
@@ -1035,7 +1035,8 @@
   (define-key c-mode-map "\C-c\C-p"  'c-backward-conditional)
   (define-key c-mode-map "\C-c\C-u"  'c-up-conditional)
   (define-key c-mode-map "\t"        'c-indent-command)
-  (define-key c-mode-map "\177"      'c-electric-delete)
+;; GDF - don't rebind the DEL key
+;;  (define-key c-mode-map "\177"      'c-electric-delete)
   ;; these are new keybindings, with no counterpart to BOCM
   (define-key c-mode-map ","         'c-electric-semi&comma)
   (define-key c-mode-map "*"         'c-electric-star)
@@ -1427,6 +1428,8 @@
 \\{c-mode-map}"
   (interactive)
   (kill-all-local-variables)
+  (make-local-hook 'backspace-or-delete-hook)
+  (add-hook 'backspace-or-delete-hook 'c-electric-delete nil t)
   (set-syntax-table c-mode-syntax-table)
   (setq major-mode 'c-mode
 	mode-name "C"
@@ -1953,8 +1956,8 @@
       (skip-chars-backward " \t\n")
       (if (/= (point) here)
 	  (delete-region (point) here)
-	(funcall c-delete-function 1)
-	))))
+	(funcall c-delete-function 1))))
+  t)
 
 (defun c-electric-pound (arg)
   "Electric pound (`#') insertion.