changeset 83503:ad1fbeffe3cb

Fix delete key after C-x 5 2 on X. (Catched by Dan Nicolaescu.) * lisp/term/x-win.el (x-setup-function-keys): Protect against multiple calls on the same terminal. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-543
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 01 Apr 2006 13:36:08 +0000
parents c1e013e3dc0e
children 7aa43f830ce4
files lisp/term/x-win.el
diffstat 1 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Sat Apr 01 13:24:42 2006 +0000
+++ b/lisp/term/x-win.el	Sat Apr 01 13:36:08 2006 +0000
@@ -1171,24 +1171,28 @@
 
 (defun x-setup-function-keys (frame)
   "Set up `function-key-map' on FRAME for the X window system."
-  ;; Map certain keypad keys into ASCII characters that people usually expect.
-  (with-selected-frame frame
-    (define-key local-function-key-map [backspace] [127])
-    (define-key local-function-key-map [delete] [127])
-    (define-key local-function-key-map [tab] [?\t])
-    (define-key local-function-key-map [linefeed] [?\n])
-    (define-key local-function-key-map [clear] [?\C-l])
-    (define-key local-function-key-map [return] [?\C-m])
-    (define-key local-function-key-map [escape] [?\e])
-    (define-key local-function-key-map [M-backspace] [?\M-\d])
-    (define-key local-function-key-map [M-delete] [?\M-\d])
-    (define-key local-function-key-map [M-tab] [?\M-\t])
-    (define-key local-function-key-map [M-linefeed] [?\M-\n])
-    (define-key local-function-key-map [M-clear] [?\M-\C-l])
-    (define-key local-function-key-map [M-return] [?\M-\C-m])
-    (define-key local-function-key-map [M-escape] [?\M-\e])
-    (define-key local-function-key-map [iso-lefttab] [backtab])
-    (define-key local-function-key-map [S-iso-lefttab] [backtab])))
+  ;; Don't do this twice on the same display, or it would break
+  ;; normal-erase-is-backspace-mode.
+  (unless (terminal-parameter frame 'x-setup-function-keys)
+    ;; Map certain keypad keys into ASCII characters that people usually expect.
+    (with-selected-frame frame
+      (define-key local-function-key-map [backspace] [127])
+      (define-key local-function-key-map [delete] [127])
+      (define-key local-function-key-map [tab] [?\t])
+      (define-key local-function-key-map [linefeed] [?\n])
+      (define-key local-function-key-map [clear] [?\C-l])
+      (define-key local-function-key-map [return] [?\C-m])
+      (define-key local-function-key-map [escape] [?\e])
+      (define-key local-function-key-map [M-backspace] [?\M-\d])
+      (define-key local-function-key-map [M-delete] [?\M-\d])
+      (define-key local-function-key-map [M-tab] [?\M-\t])
+      (define-key local-function-key-map [M-linefeed] [?\M-\n])
+      (define-key local-function-key-map [M-clear] [?\M-\C-l])
+      (define-key local-function-key-map [M-return] [?\M-\C-m])
+      (define-key local-function-key-map [M-escape] [?\M-\e])
+      (define-key local-function-key-map [iso-lefttab] [backtab])
+      (define-key local-function-key-map [S-iso-lefttab] [backtab]))
+    (set-terminal-parameter frame 'x-setup-function-keys t)))
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.