changeset 86259:6662000a5bae

(x-setup-function-keys): Protect against multiple calls on the same terminal.
author Jason Rumney <jasonr@gnu.org>
date Tue, 20 Nov 2007 22:22:06 +0000
parents 80a0c87296cf
children 40dbe784a4f7
files lisp/term/w32-win.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/w32-win.el	Tue Nov 20 22:21:54 2007 +0000
+++ b/lisp/term/w32-win.el	Tue Nov 20 22:22:06 2007 +0000
@@ -1057,14 +1057,17 @@
 
 (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)))
 
 
 ;; W32 systems have different fonts than commonly found on X, so