# HG changeset patch # User Jason Rumney # Date 1195597326 0 # Node ID 6662000a5bae9803a2e40f704c489ad50d317b22 # Parent 80a0c87296cfaf3dd62da2d6d7598bd3ec9ca69d (x-setup-function-keys): Protect against multiple calls on the same terminal. diff -r 80a0c87296cf -r 6662000a5bae lisp/term/w32-win.el --- 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