changeset 83326:8eafadd7838b

Use terminal-local-value to access function-key-map in terminal packages. * lisp/term/AT386.el: Wrap function-key-map accesses in (set-)terminal-local-value. * lisp/term/internal.el: Ditto. * lisp/term/iris-ansi.el: Ditto. * lisp/term/lk201.el: Ditto. * lisp/term/mac-win.el: Ditto. * lisp/term/news.el: Ditto. * lisp/term/rxvt.el: Ditto. * lisp/term/sun.el: Ditto. * lisp/term/tvi970.el: Ditto. * lisp/term/wyse50.el: Ditto. * lisp/term/x-win.el: Ditto. * lisp/term/xterm.el: Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-366
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 27 Jun 2005 03:19:27 +0000
parents 9e41c80c6389
children 950de36a755d
files lisp/term/AT386.el lisp/term/internal.el lisp/term/iris-ansi.el lisp/term/lk201.el lisp/term/mac-win.el lisp/term/news.el lisp/term/rxvt.el lisp/term/sun.el lisp/term/tvi970.el lisp/term/wyse50.el lisp/term/x-win.el lisp/term/xterm.el
diffstat 12 files changed, 119 insertions(+), 116 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/AT386.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/AT386.el	Mon Jun 27 03:19:27 2005 +0000
@@ -31,7 +31,7 @@
 (if (boundp 'AT386-keypad-map)
     nil
   ;; The terminal initialization should already have set up some keys
-  (setq AT386-keypad-map (lookup-key function-key-map "\e["))
+  (setq AT386-keypad-map (lookup-key (terminal-local-value 'function-key-map nil) "\e["))
   (if (not (keymapp AT386-keypad-map))
       (error "What?  Your AT386 termcap/terminfo has no keycaps in it"))
 
@@ -54,7 +54,7 @@
   (define-key AT386-keypad-map "T" [kp-add])
 
   ;; Arrange for the ALT key to be equivalent to ESC
-  (define-key function-key-map "\eN" [27]) ; ALT map
+  (define-key (terminal-local-value 'function-key-map nil) "\eN" [27]) ; ALT map
   )
 
 ;;; arch-tag: abec1b03-582f-49f8-b8cb-e2fd52ea4bd7
--- a/lisp/term/internal.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/internal.el	Mon Jun 27 03:19:27 2005 +0000
@@ -28,20 +28,21 @@
 ;; ---------------------------------------------------------------------------
 ;; keyboard setup -- that's simple!
 (set-input-mode nil nil 0)
-(define-key function-key-map [backspace] "\177") ; Normal behaviour for BS
-(define-key function-key-map [delete] "\C-d")    ; ... and Delete
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [11])
-(define-key function-key-map [return] [13])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\013])
-(define-key function-key-map [M-return] [?\M-\015])
-(define-key function-key-map [M-escape] [?\M-\e])
+(let (m (terminal-local-value 'function-key-map nil))
+  (define-key m [backspace] "\177") ; Normal behaviour for BS
+  (define-key m [delete] "\C-d")    ; ... and Delete
+  (define-key m [tab] [?\t])
+  (define-key m [linefeed] [?\n])
+  (define-key m [clear] [11])
+  (define-key m [return] [13])
+  (define-key m [escape] [?\e])
+  (define-key m [M-backspace] [?\M-\d])
+  (define-key m [M-delete] [?\M-d])
+  (define-key m [M-tab] [?\M-\t])
+  (define-key m [M-linefeed] [?\M-\n])
+  (define-key m [M-clear] [?\M-\013])
+  (define-key m [M-return] [?\M-\015])
+  (define-key m [M-escape] [?\M-\e]))
 (put 'backspace 'ascii-character 127)
 (put 'delete 'ascii-character 127)
 (put 'tab 'ascii-character ?\t)
--- a/lisp/term/iris-ansi.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/iris-ansi.el	Mon Jun 27 03:19:27 2005 +0000
@@ -333,8 +333,8 @@
 ;; This way we don't override terminfo-derived settings or settings
 ;; made in the .emacs file.
 (let ((m (copy-keymap iris-function-map)))
-  (set-keymap-parent m (keymap-parent function-key-map))
-  (set-keymap-parent function-key-map m))
+  (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil)))
+  (set-keymap-parent (terminal-local-value 'function-key-map nil) m))
 
 ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
 ;;; iris-ansi.el ends here
--- a/lisp/term/lk201.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/lk201.el	Mon Jun 27 03:19:27 2005 +0000
@@ -79,8 +79,8 @@
 ;; This way we don't override terminfo-derived settings or settings
 ;; made in the .emacs file.
 (let ((m (copy-keymap lk201-function-map)))
-  (set-keymap-parent m (keymap-parent function-key-map))
-  (set-keymap-parent function-key-map m))
+  (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil)))
+  (set-keymap-parent (terminal-local-value 'function-key-map nil) m))
 
 ;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d
 ;;; lk201.el ends here
--- a/lisp/term/mac-win.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/mac-win.el	Mon Jun 27 03:19:27 2005 +0000
@@ -1059,20 +1059,21 @@
 
 ;; Map certain keypad keys into ASCII characters
 ;; that people usually expect.
-(define-key function-key-map [backspace] [?\d])
-(define-key function-key-map [delete] [?\d])
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [?\C-l])
-(define-key function-key-map [return] [?\C-m])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-\d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\C-l])
-(define-key function-key-map [M-return] [?\M-\C-m])
-(define-key function-key-map [M-escape] [?\M-\e])
+(let ((m (terminal-local-value 'function-key-map nil)))
+  (define-key m [backspace] [?\d])
+  (define-key m [delete] [?\d])
+  (define-key m [tab] [?\t])
+  (define-key m [linefeed] [?\n])
+  (define-key m [clear] [?\C-l])
+  (define-key m [return] [?\C-m])
+  (define-key m [escape] [?\e])
+  (define-key m [M-backspace] [?\M-\d])
+  (define-key m [M-delete] [?\M-\d])
+  (define-key m [M-tab] [?\M-\t])
+  (define-key m [M-linefeed] [?\M-\n])
+  (define-key m [M-clear] [?\M-\C-l])
+  (define-key m [M-return] [?\M-\C-m])
+  (define-key m [M-escape] [?\M-\e]))
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
--- a/lisp/term/news.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/news.el	Mon Jun 27 03:19:27 2005 +0000
@@ -31,7 +31,7 @@
 (if (boundp 'news-fkey-prefix)
     nil
   ;; The terminal initialization should already have set up some keys
-  (setq news-fkey-prefix (lookup-key function-key-map "\eO"))
+  (setq news-fkey-prefix (lookup-key (terminal-local-value 'function-key-map nil) "\eO"))
   (if (not (keymapp news-fkey-prefix))
       (error "What?  Your news termcap/terminfo has no keycaps in it"))
 
--- a/lisp/term/rxvt.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/rxvt.el	Mon Jun 27 03:19:27 2005 +0000
@@ -100,8 +100,8 @@
 ;; This way we don't override terminfo-derived settings or settings
 ;; made in the .emacs file.
 (let ((m (copy-keymap rxvt-function-map)))
-  (set-keymap-parent m (keymap-parent function-key-map))
-  (set-keymap-parent function-key-map m))
+  (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil)))
+  (set-keymap-parent (terminal-local-value 'function-key-map nil) m))
 
 
 ;; Set up colors, for those versions of rxvt that support it.
--- a/lisp/term/sun.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/sun.el	Mon Jun 27 03:19:27 2005 +0000
@@ -93,7 +93,7 @@
 ;;
 
 (defvar sun-raw-prefix (make-sparse-keymap))
-(define-key function-key-map "\e[" sun-raw-prefix)
+(define-key (terminal-local-value 'function-key-map nil) "\e[" sun-raw-prefix)
 
 (define-key sun-raw-prefix "210z" [r3])
 (define-key sun-raw-prefix "213z" [r6])
--- a/lisp/term/tvi970.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/tvi970.el	Mon Jun 27 03:19:27 2005 +0000
@@ -28,14 +28,14 @@
 
 ;;; Code:
 
-(or (lookup-key function-key-map "\e[")
-    (define-key function-key-map "\e[" (make-keymap)))
-;; (or (lookup-key function-key-map "\eO")
-;;    (define-key function-key-map "\eO" (make-keymap)))
+(or (lookup-key (terminal-local-value 'function-key-map nil) "\e[")
+    (define-key (terminal-local-value 'function-key-map nil) "\e[" (make-keymap)))
+;; (or (lookup-key (terminal-local-value 'function-key-map nil) "\eO")
+;;    (define-key (terminal-local-value 'function-key-map nil) "\eO" (make-keymap)))
 
 ;; Miscellaneous keys
 (mapcar (function (lambda (key-binding)
-		    (define-key function-key-map
+		    (define-key (terminal-local-value 'function-key-map nil)
 		      (car key-binding) (nth 1 key-binding))))
 	'(
 	  ;; These are set up by termcap or terminfo
@@ -84,17 +84,17 @@
 ;; The numeric keypad keys.
 (let ((i 0))
   (while (< i 10)
-    (define-key function-key-map
+    (define-key (terminal-local-value 'function-key-map nil)
       (format "\eO%c" (+ i ?p))
       (vector (intern (format "kp-%d" i))))
     (setq i (1+ i))))
 ;; The numbered function keys.
 (let ((i 0))
   (while (< i 16)
-    (define-key function-key-map
+    (define-key (terminal-local-value 'function-key-map nil)
       (format "\e?%c" (+ i ?a))
       (vector (intern (format "f%d" (1+ i)))))
-    (define-key function-key-map
+    (define-key (terminal-local-value 'function-key-map nil)
       (format "\e?%c" (+ i ?A))
       (vector (intern (format "S-f%d" (1+ i)))))
     (setq i (1+ i))))
--- a/lisp/term/wyse50.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/wyse50.el	Mon Jun 27 03:19:27 2005 +0000
@@ -37,9 +37,9 @@
 
 ;;; Code:
 
-(define-key function-key-map "\C-a" (make-keymap))
+(define-key (terminal-local-value 'function-key-map nil) "\C-a" (make-keymap))
 (mapcar (function (lambda (key-definition)
-		    (define-key function-key-map
+		    (define-key (terminal-local-value 'function-key-map nil)
 		      (car key-definition) (nth 1 key-definition))))
 	'(
 	  ;; These might be set up by termcap and terminfo
--- a/lisp/term/x-win.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/x-win.el	Mon Jun 27 03:19:27 2005 +0000
@@ -1170,23 +1170,23 @@
 (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 (or frame (selected-frame))
-    (define-key function-key-map [backspace] [127])
-    (define-key function-key-map [delete] [127])
-    (define-key function-key-map [tab] [?\t])
-    (define-key function-key-map [linefeed] [?\n])
-    (define-key function-key-map [clear] [?\C-l])
-    (define-key function-key-map [return] [?\C-m])
-    (define-key function-key-map [escape] [?\e])
-    (define-key function-key-map [M-backspace] [?\M-\d])
-    (define-key function-key-map [M-delete] [?\M-\d])
-    (define-key function-key-map [M-tab] [?\M-\t])
-    (define-key function-key-map [M-linefeed] [?\M-\n])
-    (define-key function-key-map [M-clear] [?\M-\C-l])
-    (define-key function-key-map [M-return] [?\M-\C-m])
-    (define-key function-key-map [M-escape] [?\M-\e])
-    (define-key function-key-map [iso-lefttab] [backtab])
-    (define-key function-key-map [S-iso-lefttab] [backtab])))
+  (let ((m (terminal-local-value 'function-key-map frame)))
+    (define-key m [backspace] [127])
+    (define-key m [delete] [127])
+    (define-key m [tab] [?\t])
+    (define-key m [linefeed] [?\n])
+    (define-key m [clear] [?\C-l])
+    (define-key m [return] [?\C-m])
+    (define-key m [escape] [?\e])
+    (define-key m [M-backspace] [?\M-\d])
+    (define-key m [M-delete] [?\M-\d])
+    (define-key m [M-tab] [?\M-\t])
+    (define-key m [M-linefeed] [?\M-\n])
+    (define-key m [M-clear] [?\M-\C-l])
+    (define-key m [M-return] [?\M-\C-m])
+    (define-key m [M-escape] [?\M-\e])
+    (define-key m [iso-lefttab] [backtab])
+    (define-key m [S-iso-lefttab] [backtab])))
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
--- a/lisp/term/xterm.el	Mon Jun 27 02:08:34 2005 +0000
+++ b/lisp/term/xterm.el	Mon Jun 27 03:19:27 2005 +0000
@@ -189,8 +189,8 @@
 ;; This way we don't override terminfo-derived settings or settings
 ;; made in the .emacs file.
 (let ((m (copy-keymap xterm-function-map)))
-  (set-keymap-parent m (keymap-parent function-key-map))
-  (set-keymap-parent function-key-map m))
+  (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil)))
+  (set-keymap-parent (terminal-local-value 'function-key-map nil) m))
 
 ;; The terminal intialization C code file might have initialized
 ;; function keys F13->F60 from the termcap/terminfo information.  On
@@ -200,57 +200,58 @@
 ;; function-key-map. This substitution is needed because if a key
 ;; definition if found in function-key-map, there are no further
 ;; lookups in other keymaps.
-(substitute-key-definition [f13] [S-f1] function-key-map)
-(substitute-key-definition [f14] [S-f2] function-key-map)
-(substitute-key-definition [f15] [S-f3] function-key-map)
-(substitute-key-definition [f16] [S-f4] function-key-map)
-(substitute-key-definition [f17] [S-f5] function-key-map)
-(substitute-key-definition [f18] [S-f6] function-key-map)
-(substitute-key-definition [f19] [S-f7] function-key-map)
-(substitute-key-definition [f20] [S-f8] function-key-map)
-(substitute-key-definition [f21] [S-f9] function-key-map)
-(substitute-key-definition [f22] [S-f10] function-key-map)
-(substitute-key-definition [f23] [S-f11] function-key-map)
-(substitute-key-definition [f24] [S-f12] function-key-map)
-
-(substitute-key-definition [f25] [C-f1] function-key-map)
-(substitute-key-definition [f26] [C-f2] function-key-map)
-(substitute-key-definition [f27] [C-f3] function-key-map)
-(substitute-key-definition [f28] [C-f4] function-key-map)
-(substitute-key-definition [f29] [C-f5] function-key-map)
-(substitute-key-definition [f30] [C-f6] function-key-map)
-(substitute-key-definition [f31] [C-f7] function-key-map)
-(substitute-key-definition [f32] [C-f8] function-key-map)
-(substitute-key-definition [f33] [C-f9] function-key-map)
-(substitute-key-definition [f34] [C-f10] function-key-map)
-(substitute-key-definition [f35] [C-f11] function-key-map)
-(substitute-key-definition [f36] [C-f12] function-key-map)
+(let ((m (terminal-local-value 'function-key-map nil)))
+  (substitute-key-definition [f13] [S-f1] m)
+  (substitute-key-definition [f14] [S-f2] m)
+  (substitute-key-definition [f15] [S-f3] m)
+  (substitute-key-definition [f16] [S-f4] m)
+  (substitute-key-definition [f17] [S-f5] m)
+  (substitute-key-definition [f18] [S-f6] m)
+  (substitute-key-definition [f19] [S-f7] m)
+  (substitute-key-definition [f20] [S-f8] m)
+  (substitute-key-definition [f21] [S-f9] m)
+  (substitute-key-definition [f22] [S-f10] m)
+  (substitute-key-definition [f23] [S-f11] m)
+  (substitute-key-definition [f24] [S-f12] m)
 
-(substitute-key-definition [f37] [C-S-f1] function-key-map)
-(substitute-key-definition [f38] [C-S-f2] function-key-map)
-(substitute-key-definition [f39] [C-S-f3] function-key-map)
-(substitute-key-definition [f40] [C-S-f4] function-key-map)
-(substitute-key-definition [f41] [C-S-f5] function-key-map)
-(substitute-key-definition [f42] [C-S-f6] function-key-map)
-(substitute-key-definition [f43] [C-S-f7] function-key-map)
-(substitute-key-definition [f44] [C-S-f8] function-key-map)
-(substitute-key-definition [f45] [C-S-f9] function-key-map)
-(substitute-key-definition [f46] [C-S-f10] function-key-map)
-(substitute-key-definition [f47] [C-S-f11] function-key-map)
-(substitute-key-definition [f48] [C-S-f12] function-key-map)
+  (substitute-key-definition [f25] [C-f1] m)
+  (substitute-key-definition [f26] [C-f2] m)
+  (substitute-key-definition [f27] [C-f3] m)
+  (substitute-key-definition [f28] [C-f4] m)
+  (substitute-key-definition [f29] [C-f5] m)
+  (substitute-key-definition [f30] [C-f6] m)
+  (substitute-key-definition [f31] [C-f7] m)
+  (substitute-key-definition [f32] [C-f8] m)
+  (substitute-key-definition [f33] [C-f9] m)
+  (substitute-key-definition [f34] [C-f10] m)
+  (substitute-key-definition [f35] [C-f11] m)
+  (substitute-key-definition [f36] [C-f12] m)
 
-(substitute-key-definition [f49] [A-f1] function-key-map)
-(substitute-key-definition [f50] [A-f2] function-key-map)
-(substitute-key-definition [f51] [A-f3] function-key-map)
-(substitute-key-definition [f52] [A-f4] function-key-map)
-(substitute-key-definition [f53] [A-f5] function-key-map)
-(substitute-key-definition [f54] [A-f6] function-key-map)
-(substitute-key-definition [f55] [A-f7] function-key-map)
-(substitute-key-definition [f56] [A-f8] function-key-map)
-(substitute-key-definition [f57] [A-f9] function-key-map)
-(substitute-key-definition [f58] [A-f10] function-key-map)
-(substitute-key-definition [f59] [A-f11] function-key-map)
-(substitute-key-definition [f60] [A-f12] function-key-map)
+  (substitute-key-definition [f37] [C-S-f1] m)
+  (substitute-key-definition [f38] [C-S-f2] m)
+  (substitute-key-definition [f39] [C-S-f3] m)
+  (substitute-key-definition [f40] [C-S-f4] m)
+  (substitute-key-definition [f41] [C-S-f5] m)
+  (substitute-key-definition [f42] [C-S-f6] m)
+  (substitute-key-definition [f43] [C-S-f7] m)
+  (substitute-key-definition [f44] [C-S-f8] m)
+  (substitute-key-definition [f45] [C-S-f9] m)
+  (substitute-key-definition [f46] [C-S-f10] m)
+  (substitute-key-definition [f47] [C-S-f11] m)
+  (substitute-key-definition [f48] [C-S-f12] m)
+
+  (substitute-key-definition [f49] [A-f1] m)
+  (substitute-key-definition [f50] [A-f2] m)
+  (substitute-key-definition [f51] [A-f3] m)
+  (substitute-key-definition [f52] [A-f4] m)
+  (substitute-key-definition [f53] [A-f5] m)
+  (substitute-key-definition [f54] [A-f6] m)
+  (substitute-key-definition [f55] [A-f7] m)
+  (substitute-key-definition [f56] [A-f8] m)
+  (substitute-key-definition [f57] [A-f9] m)
+  (substitute-key-definition [f58] [A-f10] m)
+  (substitute-key-definition [f59] [A-f11] m)
+  (substitute-key-definition [f60] [A-f12] m))
 
 
 ;; Set up colors, for those versions of xterm that support it.