From: Robert Pluim Date: Thu, 7 Sep 2023 14:56:06 +0000 (+0200) Subject: Use key-translate instead of keyboard-translate X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=095d64577c2393640f4859486d6db492203890e6;p=emacs.git Use key-translate instead of keyboard-translate As a consequence of the discussions in Bug#65735, move to using the new key-translate function instead of the deprecated keyboard-translate. For future maintainers: ?\C-? or ?\177 do not mean "DEL" with key-translate, you have to use "DEL". * lisp/simple.el (normal-erase-is-backspace-mode): Use key-translate. * lisp/term/bobcat.el (terminal-init-bobcat): Use key-translate. --- diff --git a/lisp/simple.el b/lisp/simple.el index 2cb3f45866c..ec14bec9e07 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10671,10 +10671,10 @@ See also `normal-erase-is-backspace'." (t (if enabled (progn - (keyboard-translate ?\C-h ?\C-?) - (keyboard-translate ?\C-? ?\C-d)) - (keyboard-translate ?\C-h ?\C-h) - (keyboard-translate ?\C-? ?\C-?)))) + (key-translate "C-h" "DEL") + (key-translate "DEL" "C-d")) + (key-translate "C-h" "C-h") + (key-translate "DEL" "DEL")))) (if (called-interactively-p 'interactive) (message "Delete key deletes %s" diff --git a/lisp/term/bobcat.el b/lisp/term/bobcat.el index 983c8cded2f..0c2eba486a3 100644 --- a/lisp/term/bobcat.el +++ b/lisp/term/bobcat.el @@ -3,8 +3,8 @@ (defun terminal-init-bobcat () "Terminal initialization function for bobcat." ;; HP terminals usually encourage using ^H as the rubout character - (keyboard-translate ?\177 ?\^h) - (keyboard-translate ?\^h ?\177)) + (key-translate "DEL" "C-h") + (key-translate "C-h" "DEL")) (provide 'term/bobcat)