]> git.eshelyaron.com Git - emacs.git/commitdiff
(x-setup-function-keys): Protect against
authorJason Rumney <jasonr@gnu.org>
Tue, 20 Nov 2007 22:22:06 +0000 (22:22 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 20 Nov 2007 22:22:06 +0000 (22:22 +0000)
multiple calls on the same terminal.

lisp/term/w32-win.el

index 4a3a685f8c0733b8dcdebb9c5e869e12d4505e6e..7ea8f08a67e4f5014108c7245affe328b7ec3639 100644 (file)
@@ -1057,14 +1057,17 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 
 (defun x-setup-function-keys (frame)
   "Setup Function Keys for w32."
-  (with-selected-frame frame
-     (define-key local-function-key-map [f10] 'menu-bar-open)
+  ;; Don't do this twice on the same display, or it would break
+  ;; normal-erase-is-backspace-mode (maybe - this is copied from X).
+  (unless (terminal-parameter frame 'x-setup-function-keys)
+    (with-selected-frame frame
+      (define-key local-function-key-map [f10] 'menu-bar-open)
 
-     (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
-                                local-function-key-map global-map)
+      (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
+                                 local-function-key-map global-map)
 
-     (define-key local-function-key-map [S-tab] [backtab]))
-  (set-terminal-parameter frame 'x-setup-function-keys t))
+      (define-key local-function-key-map [S-tab] [backtab]))
+    (set-terminal-parameter frame 'x-setup-function-keys t)))
 \f
 
 ;; W32 systems have different fonts than commonly found on X, so