# HG changeset patch # User Eli Zaretskii # Date 987160186 0 # Node ID ef2abdff31fa9e1c1437ae001e3dc8b19444f382 # Parent 54ec1bffae34c25e915eee2e7aab9f8c8030b223 (pc-selection-mode): Don't turn on normal-erase-is-backspace on a tty. Instead, bind some keys such as [delete] directly, like pc-select.el did before normal-erase-is-backspace was invented. diff -r 54ec1bffae34 -r ef2abdff31fa lisp/emulation/pc-select.el --- a/lisp/emulation/pc-select.el Fri Apr 13 09:50:37 2001 +0000 +++ b/lisp/emulation/pc-select.el Fri Apr 13 11:09:46 2001 +0000 @@ -728,9 +728,22 @@ (or pc-select-selection-keys-only (progn ;; We are behaving like normal-erase-is-backspace-mode, so - ;; say so explicitly. - (setq-default normal-erase-is-backspace t) - (normal-erase-is-backspace-mode 1) + ;; say so explicitly. But don't do that on a Unix tty, since + ;; some of them have keyboards that by default already behave + ;; as if normal-erase-is-backspace mode is on, and turning it + ;; a second time screws them up. + (if (or (eq window-system 'x) + (memq system-name '(ms-dos windows-nt))) + (progn + (setq-default normal-erase-is-backspace t) + (normal-erase-is-backspace-mode 1)) + ;; This is for tty. We don't turn on normal-erase-is-backspace, + ;; but bind keys as pc-selection-mode did before + ;; normal-erase-is-backspace was invented, to keep us back + ;; compatible. + (global-set-key [delete] 'delete-char) ; KDelete Del + (define-key function-key-map [M-delete] [?\M-d]) + (global-set-key [C-backspace] 'backward-kill-word)) (define-key global-map [S-insert] 'yank) (define-key global-map [C-insert] 'copy-region-as-kill) (define-key global-map [S-delete] 'kill-region)