changeset 37334:ef2abdff31fa

(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.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 13 Apr 2001 11:09:46 +0000
parents 54ec1bffae34
children e3c9bccaac48
files lisp/emulation/pc-select.el
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)