Jan Vroonhof writes:
@@ -1551,6 +1557,16 @@
(where-is-internal 'backward-delete-char-untabify)))
"Character generated by key bound to delete-backward-char.")
+(defvar cperl-backward-delete-function nil)
+
+(defmacro cperl-set-conformant-backward-deletion (func)
`cperl-set-electric-backspace'?
+ `(if (not (boundp 'backward-delete-function))
+ (cperl-define-key "\177" ,func)
+ ;; we do not clobber backspace on standard Emacs, why?
Since standard eamcs is smart enough to map \177 to [backspace] if
window-mode.
+ (setq cperl-backward-delete-function ,func)
+ (define-key cperl-mode-map [backspace] ,func)
+ (setq cperl-del-back-ch 'backspace)))
+
(and (vectorp cperl-del-back-ch) (= (length cperl-del-back-ch) 1)
(setq cperl-del-back-ch (aref cperl-del-back-ch 0)))
Why do you do this `if' at run time?
@@ -2126,6 +2142,9 @@
(make-local-variable 'vc-header-alist)
(set 'vc-header-alist cperl-vc-header-alist) ; Avoid warning
(make-local-variable 'font-lock-defaults)
+ (when cperl-backward-delete-function
+ (make-local-variable 'backward-delete-function)
+ (setq backward-delete-function cperl-backward-delete-function))
(setq font-lock-defaults
(cond
((string< emacs-version "19.30")
Why should this be local?
Ilya