summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/edmacro.el7
-rw-r--r--lisp/emulation/cua-base.el4
-rw-r--r--lisp/international/encoded-kb.el10
-rw-r--r--lisp/isearch.el5
-rw-r--r--lisp/obsolete/keyswap.el2
-rw-r--r--lisp/simple.el19
-rw-r--r--lisp/subr.el10
-rw-r--r--lisp/term/AT386.el4
-rw-r--r--lisp/term/internal.el29
-rw-r--r--lisp/term/iris-ansi.el4
-rw-r--r--lisp/term/lk201.el4
-rw-r--r--lisp/term/mac-win.el29
-rw-r--r--lisp/term/news.el2
-rw-r--r--lisp/term/rxvt.el65
-rw-r--r--lisp/term/sun.el2
-rw-r--r--lisp/term/tvi970.el16
-rw-r--r--lisp/term/vt200.el2
-rw-r--r--lisp/term/vt201.el2
-rw-r--r--lisp/term/vt220.el2
-rw-r--r--lisp/term/vt240.el2
-rw-r--r--lisp/term/vt300.el2
-rw-r--r--lisp/term/vt320.el2
-rw-r--r--lisp/term/vt400.el2
-rw-r--r--lisp/term/vt420.el2
-rw-r--r--lisp/term/wyse50.el4
-rw-r--r--lisp/term/x-win.el34
-rw-r--r--lisp/term/xterm.el109
-rw-r--r--src/data.c23
28 files changed, 203 insertions, 195 deletions
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index ff5e2f7e0b2..68de4404cb8 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -444,8 +444,7 @@ doubt, use whitespace."
(rest-mac (vconcat macro [end-macro]))
(res "")
(len 0)
- (one-line (eq verbose 1))
- (fkm (terminal-local-value 'local-function-key-map nil)))
+ (one-line (eq verbose 1)))
(if one-line (setq verbose nil))
(when (stringp macro)
(loop for i below (length macro) do
@@ -490,9 +489,9 @@ doubt, use whitespace."
(fkey nil) tlen tkey
(bind (or (loop for map in maps for b = (lookup-key map key)
thereis (and (not (integerp b)) b))
- (and (setq fkey (lookup-key fkm rest-mac))
+ (and (setq fkey (lookup-key local-function-key-map rest-mac))
(setq tlen fkey tkey (edmacro-subseq rest-mac 0 tlen)
- fkey (lookup-key fkm tkey))
+ fkey (lookup-key local-function-key-map tkey))
(loop for map in maps
for b = (lookup-key map fkey)
when (and (not (integerp b)) b)
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index a7f5b4d7aa3..bcfdeef4501 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1090,8 +1090,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(aref (this-single-command-keys) 0)))
;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home.
(and (boundp 'local-function-key-map)
- (terminal-local-value 'function-key-map nil)
- (let ((ev (lookup-key (terminal-local-value 'function-key-map nil)
+ local-function-key-map
+ (let ((ev (lookup-key local-function-key-map
(this-single-command-raw-keys))))
(and (vector ev)
(symbolp (setq ev (aref ev 0)))
diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el
index 9220970f5bd..25e8f478203 100644
--- a/lisp/international/encoded-kb.el
+++ b/lisp/international/encoded-kb.el
@@ -260,9 +260,9 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display."
(when frame
(with-selected-frame frame
;; Remove any previous encoded-kb keymap from key-translation-map.
- (let ((m (terminal-local-value 'local-key-translation-map frame)))
+ (let ((m local-key-translation-map))
(if (equal (keymap-prompt m) "encoded-kb")
- (set-terminal-local-value 'local-key-translation-map frame (keymap-parent m))
+ (setq local-key-translation-map (keymap-parent m))
(while (keymap-parent m)
(if (equal (keymap-prompt (keymap-parent m)) "encoded-kb")
(set-keymap-parent m (keymap-parent (keymap-parent m))))
@@ -274,8 +274,8 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display."
(keymap (make-sparse-keymap "encoded-kb"))
(cim (current-input-mode))
result)
- (set-keymap-parent keymap (terminal-local-value 'local-key-translation-map frame))
- (set-terminal-local-value 'local-key-translation-map frame keymap)
+ (set-keymap-parent keymap local-key-translation-map)
+ (setq local-key-translation-map keymap)
(unless (terminal-parameter nil 'encoded-kbd-saved-input-mode)
(set-terminal-parameter nil 'encoded-kbd-saved-input-mode cim))
(setq result (and coding (encoded-kbd-setup-keymap keymap coding)))
@@ -287,7 +287,7 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display."
(nth 1 cim)
'use-8th-bit
(nth 3 cim)))
- (set-terminal-local-value nil 'encoded-kbd-saved-input-mode nil)
+ (set-terminal-parameter nil 'encoded-kbd-saved-input-mode nil)
(error "Unsupported coding system in Encoded-kbd mode: %S"
coding)))
;; We are turning off Encoded-kbd mode.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 2cdd8108a7b..9d52ea1b05b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1649,10 +1649,9 @@ Isearch mode."
(this-command-keys)))
(main-event (aref key 0))
(keylist (listify-key-sequence key))
- (fkm (terminal-local-value 'local-function-key-map nil))
scroll-command isearch-point)
(cond ((and (= (length key) 1)
- (let ((lookup (lookup-key fkm key)))
+ (let ((lookup (lookup-key local-function-key-map key)))
(not (or (null lookup) (integerp lookup)
(keymapp lookup)))))
;; Handle a function key that translates into something else.
@@ -1666,7 +1665,7 @@ Isearch mode."
(isearch-done)
(apply 'isearch-unread keylist))
(setq keylist
- (listify-key-sequence (lookup-key fkm key)))
+ (listify-key-sequence (lookup-key local-function-key-map key)))
(while keylist
(setq key (car keylist))
;; If KEY is a printing char, we handle it here
diff --git a/lisp/obsolete/keyswap.el b/lisp/obsolete/keyswap.el
index 9651e4d028d..0ed70d61dee 100644
--- a/lisp/obsolete/keyswap.el
+++ b/lisp/obsolete/keyswap.el
@@ -36,7 +36,7 @@
;; Swap ^H and DEL
(aset the-table ?\177 ?\^h)
(aset the-table ?\^h ?\177)
- (setq (terminal-local-value 'keyboard-translate-table) the-table))
+ (setq keyboard-translate-table the-table))
;;; arch-tag: 67cf7009-e23e-421c-9648-078e7277297c
;;; keyswap.el ends here
diff --git a/lisp/simple.el b/lisp/simple.el
index 3a8a737258e..8e481fb7231 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5337,26 +5337,25 @@ See also `normal-erase-is-backspace'."
(cond ((or (memq window-system '(x w32 mac pc))
(memq system-type '(ms-dos windows-nt)))
- (let* ((lfkm (terminal-local-value 'local-function-key-map nil))
- (bindings
+ (let* ((bindings
`(([C-delete] [C-backspace])
([M-delete] [M-backspace])
([C-M-delete] [C-M-backspace])
(,esc-map
[C-delete] [C-backspace])))
- (old-state (lookup-key lfkm [delete])))
+ (old-state (lookup-key local-function-key-map [delete])))
(if (terminal-parameter nil 'normal-erase-is-backspace)
(progn
- (define-key lfkm [delete] [?\C-d])
- (define-key lfkm [kp-delete] [?\C-d])
- (define-key lfkm [backspace] [?\C-?]))
- (define-key lfkm [delete] [?\C-?])
- (define-key lfkm [kp-delete] [?\C-?])
- (define-key lfkm [backspace] [?\C-?]))
+ (define-key local-function-key-map [delete] [?\C-d])
+ (define-key local-function-key-map [kp-delete] [?\C-d])
+ (define-key local-function-key-map [backspace] [?\C-?]))
+ (define-key local-function-key-map [delete] [?\C-?])
+ (define-key local-function-key-map [kp-delete] [?\C-?])
+ (define-key local-function-key-map [backspace] [?\C-?]))
;; Maybe swap bindings of C-delete and C-backspace, etc.
- (unless (equal old-state (lookup-key lfkm [delete]))
+ (unless (equal old-state (lookup-key local-function-key-map [delete]))
(dolist (binding bindings)
(let ((map global-map))
(when (keymapp (car binding))
diff --git a/lisp/subr.el b/lisp/subr.el
index a1417945ee7..5bc2c3dcc1a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -495,10 +495,9 @@ saving keyboard macros (see `edmacro-mode')."
"Translate character FROM to TO at a low level.
This function creates a `keyboard-translate-table' if necessary
and then modifies one entry in it."
- (let (tbl (terminal-local-value 'keyboard-translate-table))
- (or (char-table-p tbl)
- (setq tbl (make-char-table 'keyboard-translate-table nil)))
- (aset tbl from to)))
+ (or (char-table-p keyboard-translate-table)
+ (setq keyboard-translate-table (make-char-table 'keyboard-translate-table nil)))
+ (aset keyboard-translate-table from to))
;;;; The global keymap tree.
@@ -1170,8 +1169,7 @@ any other non-digit terminates the character code and is then used as input."))
;; or C-q C-x might not return immediately since ESC or C-x might be
;; bound to some prefix in function-key-map or key-translation-map.
(setq translated char)
- (let ((translation (lookup-key (terminal-local-value 'local-function-key-map nil)
- (vector char))))
+ (let ((translation (lookup-key local-function-key-map (vector char))))
(if (arrayp translation)
(setq translated (aref translation 0))))
(cond ((null translated))
diff --git a/lisp/term/AT386.el b/lisp/term/AT386.el
index 7e3ed15ce2e..fda2da44ac8 100644
--- a/lisp/term/AT386.el
+++ b/lisp/term/AT386.el
@@ -33,7 +33,7 @@
(if (boundp 'AT386-keypad-map)
nil
;; The terminal initialization should already have set up some keys
- (setq AT386-keypad-map (lookup-key (terminal-local-value 'local-function-key-map nil) "\e["))
+ (setq AT386-keypad-map (lookup-key local-function-key-map "\e["))
(if (not (keymapp AT386-keypad-map))
(error "What? Your AT386 termcap/terminfo has no keycaps in it"))
@@ -56,7 +56,7 @@
(define-key AT386-keypad-map "T" [kp-add])
;; Arrange for the ALT key to be equivalent to ESC
- (define-key (terminal-local-value 'local-function-key-map nil) "\eN" [27]) ; ALT map
+ (define-key local-function-key-map "\eN" [27]) ; ALT map
))
;;; arch-tag: abec1b03-582f-49f8-b8cb-e2fd52ea4bd7
diff --git a/lisp/term/internal.el b/lisp/term/internal.el
index bbc19bb1b3c..e9de649158a 100644
--- a/lisp/term/internal.el
+++ b/lisp/term/internal.el
@@ -29,21 +29,20 @@
;; ---------------------------------------------------------------------------
;; keyboard setup -- that's simple!
(set-input-mode nil nil 0)
-(let (m (terminal-local-value 'local-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]))
+(define-key local-function-key-map [backspace] "\177") ; Normal behaviour for BS
+(define-key local-function-key-map [delete] "\C-d") ; ... and Delete
+(define-key local-function-key-map [tab] [?\t])
+(define-key local-function-key-map [linefeed] [?\n])
+(define-key local-function-key-map [clear] [11])
+(define-key local-function-key-map [return] [13])
+(define-key local-function-key-map [escape] [?\e])
+(define-key local-function-key-map [M-backspace] [?\M-\d])
+(define-key local-function-key-map [M-delete] [?\M-d])
+(define-key local-function-key-map [M-tab] [?\M-\t])
+(define-key local-function-key-map [M-linefeed] [?\M-\n])
+(define-key local-function-key-map [M-clear] [?\M-\013])
+(define-key local-function-key-map [M-return] [?\M-\015])
+(define-key local-function-key-map [M-escape] [?\M-\e]))
(put 'backspace 'ascii-character 127)
(put 'delete 'ascii-character 127)
(put 'tab 'ascii-character ?\t)
diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el
index d751ca69057..1a3a65fa716 100644
--- a/lisp/term/iris-ansi.el
+++ b/lisp/term/iris-ansi.el
@@ -338,8 +338,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 (terminal-local-value 'local-function-key-map nil)))
- (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))))
+ (set-keymap-parent m (keymap-parent local-function-key-map))
+ (set-keymap-parent local-function-key-map m))))
;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
;;; iris-ansi.el ends here
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el
index 4eb84b65702..45271bca700 100644
--- a/lisp/term/lk201.el
+++ b/lisp/term/lk201.el
@@ -84,8 +84,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 (terminal-local-value 'local-function-key-map nil)))
- (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))))
+ (set-keymap-parent m (keymap-parent local-function-key-map))
+ (set-keymap-parent local-function-key-map m))))
;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d
;;; lk201.el ends here
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index f7782433fdc..7912bb1a4d6 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1060,21 +1060,20 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
;; Map certain keypad keys into ASCII characters
;; that people usually expect.
-(let ((m (terminal-local-value 'local-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]))
+(define-key local-function-key-map [backspace] [?\d])
+(define-key local-function-key-map [delete] [?\d])
+(define-key local-function-key-map [tab] [?\t])
+(define-key local-function-key-map [linefeed] [?\n])
+(define-key local-function-key-map [clear] [?\C-l])
+(define-key local-function-key-map [return] [?\C-m])
+(define-key local-function-key-map [escape] [?\e])
+(define-key local-function-key-map [M-backspace] [?\M-\d])
+(define-key local-function-key-map [M-delete] [?\M-\d])
+(define-key local-function-key-map [M-tab] [?\M-\t])
+(define-key local-function-key-map [M-linefeed] [?\M-\n])
+(define-key local-function-key-map [M-clear] [?\M-\C-l])
+(define-key local-function-key-map [M-return] [?\M-\C-m])
+(define-key local-function-key-map [M-escape] [?\M-\e])
;; These tell read-char how to convert
;; these special chars to ASCII.
diff --git a/lisp/term/news.el b/lisp/term/news.el
index 2a62a85d5b7..ab2d10158c8 100644
--- a/lisp/term/news.el
+++ b/lisp/term/news.el
@@ -34,7 +34,7 @@
(if (boundp 'news-fkey-prefix)
nil
;; The terminal initialization should already have set up some keys
- (setq news-fkey-prefix (lookup-key (terminal-local-value 'local-function-key-map nil) "\eO"))
+ (setq news-fkey-prefix (lookup-key local-function-key-map "\eO"))
(if (not (keymapp news-fkey-prefix))
(error "What? Your news termcap/terminfo has no keycaps in it"))
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 2c629fba29c..cb3d019d640 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -132,46 +132,45 @@
;; 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.
- (let ((m (terminal-local-value 'local-function-key-map nil)))
- (substitute-key-definition [f11] [S-f1] m)
- (substitute-key-definition [f12] [S-f2] m)
- (substitute-key-definition [f13] [S-f3] m)
- (substitute-key-definition [f14] [S-f4] m)
- (substitute-key-definition [f15] [S-f5] m)
- (substitute-key-definition [f16] [S-f6] m)
- (substitute-key-definition [f17] [S-f7] m)
- (substitute-key-definition [f18] [S-f8] m)
- (substitute-key-definition [f19] [S-f9] m)
- (substitute-key-definition [f20] [S-f10] m)
+ (substitute-key-definition [f11] [S-f1] local-function-key-map)
+ (substitute-key-definition [f12] [S-f2] local-function-key-map)
+ (substitute-key-definition [f13] [S-f3] local-function-key-map)
+ (substitute-key-definition [f14] [S-f4] local-function-key-map)
+ (substitute-key-definition [f15] [S-f5] local-function-key-map)
+ (substitute-key-definition [f16] [S-f6] local-function-key-map)
+ (substitute-key-definition [f17] [S-f7] local-function-key-map)
+ (substitute-key-definition [f18] [S-f8] local-function-key-map)
+ (substitute-key-definition [f19] [S-f9] local-function-key-map)
+ (substitute-key-definition [f20] [S-f10] local-function-key-map)
- (substitute-key-definition [f23] [C-f1] m)
- (substitute-key-definition [f24] [C-f2] m)
- (substitute-key-definition [f25] [C-f3] m)
- (substitute-key-definition [f26] [C-f4] m)
- (substitute-key-definition [f27] [C-f5] m)
- (substitute-key-definition [f28] [C-f6] m)
- (substitute-key-definition [f29] [C-f7] m)
- (substitute-key-definition [f30] [C-f8] m)
- (substitute-key-definition [f31] [C-f9] m)
- (substitute-key-definition [f32] [C-f10] m)
+ (substitute-key-definition [f23] [C-f1] local-function-key-map)
+ (substitute-key-definition [f24] [C-f2] local-function-key-map)
+ (substitute-key-definition [f25] [C-f3] local-function-key-map)
+ (substitute-key-definition [f26] [C-f4] local-function-key-map)
+ (substitute-key-definition [f27] [C-f5] local-function-key-map)
+ (substitute-key-definition [f28] [C-f6] local-function-key-map)
+ (substitute-key-definition [f29] [C-f7] local-function-key-map)
+ (substitute-key-definition [f30] [C-f8] local-function-key-map)
+ (substitute-key-definition [f31] [C-f9] local-function-key-map)
+ (substitute-key-definition [f32] [C-f10] local-function-key-map)
- (substitute-key-definition [f33] [C-S-f1] m)
- (substitute-key-definition [f34] [C-S-f2] m)
- (substitute-key-definition [f35] [C-S-f3] m)
- (substitute-key-definition [f36] [C-S-f4] m)
- (substitute-key-definition [f37] [C-S-f5] m)
- (substitute-key-definition [f38] [C-S-f6] m)
- (substitute-key-definition [f39] [C-S-f7] m)
- (substitute-key-definition [f40] [C-S-f8] m)
- (substitute-key-definition [f41] [C-S-f9] m)
- (substitute-key-definition [f42] [C-S-f10] m))
+ (substitute-key-definition [f33] [C-S-f1] local-function-key-map)
+ (substitute-key-definition [f34] [C-S-f2] local-function-key-map)
+ (substitute-key-definition [f35] [C-S-f3] local-function-key-map)
+ (substitute-key-definition [f36] [C-S-f4] local-function-key-map)
+ (substitute-key-definition [f37] [C-S-f5] local-function-key-map)
+ (substitute-key-definition [f38] [C-S-f6] local-function-key-map)
+ (substitute-key-definition [f39] [C-S-f7] local-function-key-map)
+ (substitute-key-definition [f40] [C-S-f8] local-function-key-map)
+ (substitute-key-definition [f41] [C-S-f9] local-function-key-map)
+ (substitute-key-definition [f42] [C-S-f10] local-function-key-map)
;; Use inheritance to let the main keymap override those defaults.
;; 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 (terminal-local-value 'local-function-key-map nil)))
- (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)))
+ (set-keymap-parent m (keymap-parent local-function-key-map))
+ (set-keymap-parent local-function-key-map m)))
;; Initialize colors and background mode.
(rxvt-register-default-colors)
diff --git a/lisp/term/sun.el b/lisp/term/sun.el
index 38134d2cd49..99e3ec28c7c 100644
--- a/lisp/term/sun.el
+++ b/lisp/term/sun.el
@@ -150,7 +150,7 @@
(defun terminal-init-sun ()
"Terminal initialization function for sun."
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[" sun-raw-prefix)
+ (define-key local-function-key-map "\e[" sun-raw-prefix)
(define-key sun-raw-prefix "210z" [r3])
(define-key sun-raw-prefix "213z" [r6])
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index 8d8ef51c4a1..647e4cc2745 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -30,14 +30,14 @@
(defun terminal-init-tvi970 ()
"Terminal initialization function for tvi970."
- (or (lookup-key (terminal-local-value 'local-function-key-map nil) "\e[")
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[" (make-keymap)))
- ;; (or (lookup-key (terminal-local-value 'local-function-key-map nil) "\eO")
- ;; (define-key (terminal-local-value 'local-function-key-map nil) "\eO" (make-keymap)))
+ (or (lookup-key local-function-key-map "\e[")
+ (define-key local-function-key-map "\e[" (make-keymap)))
+ ;; (or (lookup-key local-function-key-map "\eO")
+ ;; (define-key local-function-key-map "\eO" (make-keymap)))
;; Miscellaneous keys
(mapcar (function (lambda (key-binding)
- (define-key (terminal-local-value 'local-function-key-map nil)
+ (define-key local-function-key-map
(car key-binding) (nth 1 key-binding))))
'(
;; These are set up by termcap or terminfo
@@ -86,17 +86,17 @@
;; The numeric keypad keys.
(let ((i 0))
(while (< i 10)
- (define-key (terminal-local-value 'local-function-key-map nil)
+ (define-key local-function-key-map
(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 (terminal-local-value 'local-function-key-map nil)
+ (define-key local-function-key-map
(format "\e?%c" (+ i ?a))
(vector (intern (format "f%d" (1+ i)))))
- (define-key (terminal-local-value 'local-function-key-map nil)
+ (define-key local-function-key-map
(format "\e?%c" (+ i ?A))
(vector (intern (format "S-f%d" (1+ i)))))
(setq i (1+ i))))
diff --git a/lisp/term/vt200.el b/lisp/term/vt200.el
index 1d62e34759e..fd31fd11263 100644
--- a/lisp/term/vt200.el
+++ b/lisp/term/vt200.el
@@ -5,7 +5,7 @@
"Terminal initialization function for vt200."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89
;;; vt200.el ends here
diff --git a/lisp/term/vt201.el b/lisp/term/vt201.el
index c98b98ba8c0..95243322403 100644
--- a/lisp/term/vt201.el
+++ b/lisp/term/vt201.el
@@ -5,7 +5,7 @@
"Terminal initialization function for vt201."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae
;;; vt201.el ends here
diff --git a/lisp/term/vt220.el b/lisp/term/vt220.el
index a2a374692cb..7264b7d94a2 100644
--- a/lisp/term/vt220.el
+++ b/lisp/term/vt220.el
@@ -5,7 +5,7 @@
"Terminal initialization function for vt220."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871
;;; vt220.el ends here
diff --git a/lisp/term/vt240.el b/lisp/term/vt240.el
index 808cc072041..725e323c00c 100644
--- a/lisp/term/vt240.el
+++ b/lisp/term/vt240.el
@@ -5,7 +5,7 @@
"Terminal initialization function for vt240."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7
;;; vt240.el ends here
diff --git a/lisp/term/vt300.el b/lisp/term/vt300.el
index 593daf55249..fb749277d50 100644
--- a/lisp/term/vt300.el
+++ b/lisp/term/vt300.el
@@ -3,7 +3,7 @@
"Terminal initialization function for vt300."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f
;;; vt300.el ends here
diff --git a/lisp/term/vt320.el b/lisp/term/vt320.el
index a4d2186080e..3e52d27193b 100644
--- a/lisp/term/vt320.el
+++ b/lisp/term/vt320.el
@@ -3,7 +3,7 @@
"Terminal initialization function for vt320."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c
;;; vt320.el ends here
diff --git a/lisp/term/vt400.el b/lisp/term/vt400.el
index bb0afeef0b7..f1c7e3732d3 100644
--- a/lisp/term/vt400.el
+++ b/lisp/term/vt400.el
@@ -3,7 +3,7 @@
"Terminal initialization function for vt400."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5
;;; vt400.el ends here
diff --git a/lisp/term/vt420.el b/lisp/term/vt420.el
index b67b25b7bd9..4d3206cbca1 100644
--- a/lisp/term/vt420.el
+++ b/lisp/term/vt420.el
@@ -3,7 +3,7 @@
"Terminal initialization function for vt420."
(terminal-init-vt100)
;; Make F11 an escape key.
- (define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e]))
+ (define-key local-function-key-map "\e[23~" [?\e]))
;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160
;;; vt420.el ends here
diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el
index 9ab9cb0f6ed..d561329d9c6 100644
--- a/lisp/term/wyse50.el
+++ b/lisp/term/wyse50.el
@@ -40,9 +40,9 @@
(defun terminal-init-wyse50 ()
"Terminal initialization function for wyse50."
- (define-key (terminal-local-value 'local-function-key-map nil) "\C-a" (make-keymap))
+ (define-key local-function-key-map "\C-a" (make-keymap))
(mapcar (function (lambda (key-definition)
- (define-key (terminal-local-value 'local-function-key-map nil)
+ (define-key local-function-key-map
(car key-definition) (nth 1 key-definition))))
'(
;; These might be set up by termcap and terminfo
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index d1ddc97b7ba..fef67eae258 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1173,23 +1173,23 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
(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.
- (let ((m (terminal-local-value 'local-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])))
+ (with-selected-frame frame
+ (define-key local-function-key-map [backspace] [127])
+ (define-key local-function-key-map [delete] [127])
+ (define-key local-function-key-map [tab] [?\t])
+ (define-key local-function-key-map [linefeed] [?\n])
+ (define-key local-function-key-map [clear] [?\C-l])
+ (define-key local-function-key-map [return] [?\C-m])
+ (define-key local-function-key-map [escape] [?\e])
+ (define-key local-function-key-map [M-backspace] [?\M-\d])
+ (define-key local-function-key-map [M-delete] [?\M-\d])
+ (define-key local-function-key-map [M-tab] [?\M-\t])
+ (define-key local-function-key-map [M-linefeed] [?\M-\n])
+ (define-key local-function-key-map [M-clear] [?\M-\C-l])
+ (define-key local-function-key-map [M-return] [?\M-\C-m])
+ (define-key local-function-key-map [M-escape] [?\M-\e])
+ (define-key local-function-key-map [iso-lefttab] [backtab])
+ (define-key local-function-key-map [S-iso-lefttab] [backtab])))
;; These tell read-char how to convert
;; these special chars to ASCII.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 1c1e4edb3c9..aeaaeeba1ae 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -211,70 +211,69 @@
;; 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.
- (let ((m (terminal-local-value 'local-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 [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 [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))
+ (substitute-key-definition [f13] [S-f1] local-function-key-map)
+ (substitute-key-definition [f14] [S-f2] local-function-key-map)
+ (substitute-key-definition [f15] [S-f3] local-function-key-map)
+ (substitute-key-definition [f16] [S-f4] local-function-key-map)
+ (substitute-key-definition [f17] [S-f5] local-function-key-map)
+ (substitute-key-definition [f18] [S-f6] local-function-key-map)
+ (substitute-key-definition [f19] [S-f7] local-function-key-map)
+ (substitute-key-definition [f20] [S-f8] local-function-key-map)
+ (substitute-key-definition [f21] [S-f9] local-function-key-map)
+ (substitute-key-definition [f22] [S-f10] local-function-key-map)
+ (substitute-key-definition [f23] [S-f11] local-function-key-map)
+ (substitute-key-definition [f24] [S-f12] local-function-key-map)
+
+ (substitute-key-definition [f25] [C-f1] local-function-key-map)
+ (substitute-key-definition [f26] [C-f2] local-function-key-map)
+ (substitute-key-definition [f27] [C-f3] local-function-key-map)
+ (substitute-key-definition [f28] [C-f4] local-function-key-map)
+ (substitute-key-definition [f29] [C-f5] local-function-key-map)
+ (substitute-key-definition [f30] [C-f6] local-function-key-map)
+ (substitute-key-definition [f31] [C-f7] local-function-key-map)
+ (substitute-key-definition [f32] [C-f8] local-function-key-map)
+ (substitute-key-definition [f33] [C-f9] local-function-key-map)
+ (substitute-key-definition [f34] [C-f10] local-function-key-map)
+ (substitute-key-definition [f35] [C-f11] local-function-key-map)
+ (substitute-key-definition [f36] [C-f12] local-function-key-map)
+
+ (substitute-key-definition [f37] [C-S-f1] local-function-key-map)
+ (substitute-key-definition [f38] [C-S-f2] local-function-key-map)
+ (substitute-key-definition [f39] [C-S-f3] local-function-key-map)
+ (substitute-key-definition [f40] [C-S-f4] local-function-key-map)
+ (substitute-key-definition [f41] [C-S-f5] local-function-key-map)
+ (substitute-key-definition [f42] [C-S-f6] local-function-key-map)
+ (substitute-key-definition [f43] [C-S-f7] local-function-key-map)
+ (substitute-key-definition [f44] [C-S-f8] local-function-key-map)
+ (substitute-key-definition [f45] [C-S-f9] local-function-key-map)
+ (substitute-key-definition [f46] [C-S-f10] local-function-key-map)
+ (substitute-key-definition [f47] [C-S-f11] local-function-key-map)
+ (substitute-key-definition [f48] [C-S-f12] local-function-key-map)
+
+ (substitute-key-definition [f49] [A-f1] local-function-key-map)
+ (substitute-key-definition [f50] [A-f2] local-function-key-map)
+ (substitute-key-definition [f51] [A-f3] local-function-key-map)
+ (substitute-key-definition [f52] [A-f4] local-function-key-map)
+ (substitute-key-definition [f53] [A-f5] local-function-key-map)
+ (substitute-key-definition [f54] [A-f6] local-function-key-map)
+ (substitute-key-definition [f55] [A-f7] local-function-key-map)
+ (substitute-key-definition [f56] [A-f8] local-function-key-map)
+ (substitute-key-definition [f57] [A-f9] local-function-key-map)
+ (substitute-key-definition [f58] [A-f10] local-function-key-map)
+ (substitute-key-definition [f59] [A-f11] local-function-key-map)
+ (substitute-key-definition [f60] [A-f12] local-function-key-map))
;; Use inheritance to let the main keymap override those defaults.
;; 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 (terminal-local-value 'local-function-key-map nil)))
- (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)))
+ (set-keymap-parent m (keymap-parent local-function-key-map))
+ (set-keymap-parent local-function-key-map m)))
;; Do it!
(xterm-register-default-colors)
;; This recomputes all the default faces given the colors we've just set up.
- (tty-set-up-initial-frame-faces)))
+ (tty-set-up-initial-frame-faces))
;; Set up colors, for those versions of xterm that support it.
(defvar xterm-standard-colors
diff --git a/src/data.c b/src/data.c
index e5e77885da4..cb6c7d2c85c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -891,7 +891,18 @@ do_symval_forwarding (valcontents)
case Lisp_Misc_Kboard_Objfwd:
offset = XKBOARD_OBJFWD (valcontents)->offset;
- return *(Lisp_Object *)(offset + (char *)current_kboard);
+ /* We used to simply use current_kboard here, but from Lisp
+ code, it's value is often unexpected. It seems nicer to
+ allow constructions like this to work as intuitively expected:
+
+ (with-selected-frame frame
+ (define-key local-function-map "\eOP" [f1]))
+
+ On the other hand, this affects the semantics of
+ last-command and real-last-command, and people may rely on
+ that. I took a quick look at the Lisp codebase, and I
+ don't think anything will break. --lorentey */
+ return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
}
return valcontents;
}
@@ -979,7 +990,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
case Lisp_Misc_Kboard_Objfwd:
{
- char *base = (char *) current_kboard;
+ char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
*(Lisp_Object *) p = newval;
}
@@ -1125,7 +1136,7 @@ find_symbol_value (symbol)
case Lisp_Misc_Kboard_Objfwd:
return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
- + (char *)current_kboard);
+ + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
}
}
@@ -1878,6 +1889,9 @@ If the current binding is global (the default), the value is nil. */)
return Qnil;
}
+/* This code is disabled now that we use the selected frame to return
+ keyboard-local-values. */
+#if 0
extern struct device *get_device P_ ((Lisp_Object display, int));
DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
@@ -1918,6 +1932,7 @@ selected frame's display device). */)
pop_kboard ();
return result;
}
+#endif
/* Find the function at the end of a chain of symbol function indirections. */
@@ -3369,8 +3384,10 @@ syms_of_data ()
defsubr (&Slocal_variable_p);
defsubr (&Slocal_variable_if_set_p);
defsubr (&Svariable_binding_locus);
+#if 0 /* XXX Remove this. --lorentey */
defsubr (&Sterminal_local_value);
defsubr (&Sset_terminal_local_value);
+#endif
defsubr (&Saref);
defsubr (&Saset);
defsubr (&Snumber_to_string);