From a49e5cc32093a1ed3670b84c2b86fc03b956c378 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 20 Nov 2007 22:22:06 +0000 Subject: [PATCH] (x-setup-function-keys): Protect against multiple calls on the same terminal. --- lisp/term/w32-win.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 4a3a685f8c0..7ea8f08a67e 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -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))) ;; W32 systems have different fonts than commonly found on X, so -- 2.39.2