Rename function-key-map to local-function-key-map, and global-function-key-map to function-key-map. Same for key-translation-map.
* src/keyboard.h (struct kboard): Rename member 'Vfunction_key_map' to 'Vlocal_function_key_map', and 'Vkey_translation_map' to 'Vlocal_key_translation_map'. (Vfunction_key_map, Vkey_translation_map): New declarations. * src/keyboard.c (Vfunction_key_map): New variable. (Vglobal_key_translation_map): Rename to Vglobal_key_translation_map. (read_key_sequence, init_kboard, syms_of_keyboard, mark_kboards): Update. * src/keymap.c (Fdescribe_buffer_bindings): Update. * src/term.c (term_get_fkeys_1): Update. * lisp/double.el (double-setup): Replace global-key-translation-map with key-translation-map. * lisp/international/encoded-kb.el (encoded-kbd-setup-display): Ditto. * lisp/international/iso-transl.el: Ditto. * lisp/obsolete/iso-acc.el (iso-accents-customize): Ditto. * lisp/edmacro.el (edmacro-format-keys): Use terminal-local binding of local-function-key-map instead of function-key-map. * lisp/emulation/cua-base.el (cua--pre-command-handler): Ditto. * lisp/isearch.el (isearch-other-meta-char): Ditto. * lisp/subr.el (read-quoted-char): Ditto. * lisp/term/vt200.el: Ditto. * lisp/term/vt201.el: Ditto. * lisp/term/vt220.el: Ditto. * lisp/term/vt240.el: Ditto. * lisp/term/vt300.el: Ditto. * lisp/term/vt320.el: Ditto. * lisp/term/vt400.el: Ditto. * lisp/term/vt420.el: Ditto. * lisp/simple.el (normal-erase-is-backspace-mode): Add todo note. * lisp/xt-mouse.el: Ditto. * lisp/term/AT386.el: Adapt for renaming of function-key-map to local-function-key-map. * 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 (x-setup-function-keys): Ditto. * lisp/term/xterm.el: Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-386
This commit is contained in:
@@ -144,18 +144,18 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
|
||||
(if enable-flag
|
||||
(progn
|
||||
;; Set up key-translation-map as indicated by `double-map'.
|
||||
;; XXX I don't think global-key-translation-map should be made local here. -- Lorentey
|
||||
(kill-local-variable 'global-key-translation-map)
|
||||
(make-local-variable 'global-key-translation-map)
|
||||
(setq global-key-translation-map (if (keymapp global-key-translation-map)
|
||||
(copy-keymap global-key-translation-map)
|
||||
;; XXX I don't think key-translation-map should be made local here. -- Lorentey
|
||||
(kill-local-variable 'key-translation-map)
|
||||
(make-local-variable 'key-translation-map)
|
||||
(setq key-translation-map (if (keymapp key-translation-map)
|
||||
(copy-keymap key-translation-map)
|
||||
(make-sparse-keymap)))
|
||||
(mapcar (function (lambda (entry)
|
||||
(define-key global-key-translation-map
|
||||
(define-key key-translation-map
|
||||
(vector (nth 0 entry))
|
||||
'double-translate-key)))
|
||||
(append double-map '((magic-start) (magic-end)))))
|
||||
(kill-local-variable 'global-key-translation-map)))
|
||||
(kill-local-variable 'key-translation-map)))
|
||||
|
||||
;;; Mode
|
||||
|
||||
|
||||
@@ -443,7 +443,8 @@ doubt, use whitespace."
|
||||
(rest-mac (vconcat macro [end-macro]))
|
||||
(res "")
|
||||
(len 0)
|
||||
(one-line (eq verbose 1)))
|
||||
(one-line (eq verbose 1))
|
||||
(fkm (terminal-local-value 'local-function-key-map nil)))
|
||||
(if one-line (setq verbose nil))
|
||||
(when (stringp macro)
|
||||
(loop for i below (length macro) do
|
||||
@@ -488,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 function-key-map rest-mac))
|
||||
(and (setq fkey (lookup-key fkm rest-mac))
|
||||
(setq tlen fkey tkey (edmacro-subseq rest-mac 0 tlen)
|
||||
fkey (lookup-key function-key-map tkey))
|
||||
fkey (lookup-key fkm tkey))
|
||||
(loop for map in maps
|
||||
for b = (lookup-key map fkey)
|
||||
when (and (not (integerp b)) b)
|
||||
|
||||
@@ -1083,9 +1083,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
|
||||
(memq 'shift (event-modifiers
|
||||
(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 'function-key-map)
|
||||
function-key-map
|
||||
(let ((ev (lookup-key function-key-map
|
||||
(and (boundp 'local-function-key-map)
|
||||
(terminal-local-value 'local-function-key-map nil)
|
||||
(let ((ev (lookup-key (terminal-local-value 'local-function-key-map nil)
|
||||
(this-single-command-raw-keys))))
|
||||
(and (vector ev)
|
||||
(symbolp (setq ev (aref ev 0)))
|
||||
|
||||
@@ -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 'key-translation-map frame)))
|
||||
(let ((m (terminal-local-value 'local-key-translation-map frame)))
|
||||
(if (equal (keymap-prompt m) "encoded-kb")
|
||||
(set-terminal-local-value 'key-translation-map frame (keymap-parent m))
|
||||
(set-terminal-local-value 'local-key-translation-map frame (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 'key-translation-map frame))
|
||||
(set-terminal-local-value 'key-translation-map frame keymap)
|
||||
(set-keymap-parent keymap (terminal-local-value 'local-key-translation-map frame))
|
||||
(set-terminal-local-value 'local-key-translation-map frame keymap)
|
||||
(or (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)))
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
;;; Code:
|
||||
|
||||
;;; Provide some binding for startup:
|
||||
;;;###autoload (or global-key-translation-map (setq global-key-translation-map (make-sparse-keymap)))
|
||||
;;;###autoload (define-key global-key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
|
||||
;;;###autoload (or key-translation-map (setq key-translation-map (make-sparse-keymap)))
|
||||
;;;###autoload (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
|
||||
;;;###autoload (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 'keymap)
|
||||
|
||||
(defvar iso-transl-dead-key-alist
|
||||
@@ -245,9 +245,9 @@ sequence VECTOR. (VECTOR is normally one character long.)")
|
||||
(or iso-transl-ctl-x-8-map
|
||||
(fset 'iso-transl-ctl-x-8-map
|
||||
(setq iso-transl-ctl-x-8-map (make-sparse-keymap))))
|
||||
(or global-key-translation-map
|
||||
(setq global-key-translation-map (make-sparse-keymap)))
|
||||
(define-key global-key-translation-map "\C-x8" iso-transl-ctl-x-8-map)
|
||||
(or key-translation-map
|
||||
(setq key-translation-map (make-sparse-keymap)))
|
||||
(define-key key-translation-map "\C-x8" iso-transl-ctl-x-8-map)
|
||||
|
||||
;; For each entry in the alist, we'll make up to three ways to generate
|
||||
;; the character in question: the prefix `C-x 8'; the ALT modifier on
|
||||
@@ -263,7 +263,7 @@ sequence VECTOR. (VECTOR is normally one character long.)")
|
||||
(vec (vconcat (car (car alist))))
|
||||
(tail iso-transl-dead-key-alist))
|
||||
(aset vec 0 (logior (aref vec 0) ?\A-\^@))
|
||||
(define-key global-key-translation-map vec translated-vec)
|
||||
(define-key key-translation-map vec translated-vec)
|
||||
(define-key isearch-mode-map (vector (aref vec 0)) nil)
|
||||
(while tail
|
||||
(if (eq (car (car tail)) inchar)
|
||||
@@ -271,7 +271,7 @@ sequence VECTOR. (VECTOR is normally one character long.)")
|
||||
(deadkey (cdr (car tail))))
|
||||
(aset deadvec 0 deadkey)
|
||||
(define-key isearch-mode-map (vector deadkey) nil)
|
||||
(define-key global-key-translation-map deadvec translated-vec)))
|
||||
(define-key key-translation-map deadvec translated-vec)))
|
||||
(setq tail (cdr tail)))))
|
||||
(setq alist (cdr alist))))
|
||||
|
||||
|
||||
@@ -1648,9 +1648,10 @@ 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 function-key-map key)))
|
||||
(let ((lookup (lookup-key fkm key)))
|
||||
(not (or (null lookup) (integerp lookup)
|
||||
(keymapp lookup)))))
|
||||
;; Handle a function key that translates into something else.
|
||||
@@ -1664,7 +1665,7 @@ Isearch mode."
|
||||
(isearch-done)
|
||||
(apply 'isearch-unread keylist))
|
||||
(setq keylist
|
||||
(listify-key-sequence (lookup-key function-key-map key)))
|
||||
(listify-key-sequence (lookup-key fkm key)))
|
||||
(while keylist
|
||||
(setq key (car keylist))
|
||||
;; If KEY is a printing char, we handle it here
|
||||
|
||||
1392
lisp/ldefs-boot.el
1392
lisp/ldefs-boot.el
File diff suppressed because it is too large
Load Diff
@@ -395,15 +395,15 @@ It selects the customization based on the specifications in the
|
||||
(setq table (cdr table)))
|
||||
(setq iso-language language
|
||||
iso-accents-list table)
|
||||
(if global-key-translation-map
|
||||
(if key-translation-map
|
||||
(substitute-key-definition
|
||||
'iso-accents-accent-key nil global-key-translation-map)
|
||||
(setq global-key-translation-map (make-sparse-keymap)))
|
||||
'iso-accents-accent-key nil key-translation-map)
|
||||
(setq key-translation-map (make-sparse-keymap)))
|
||||
;; Set up translations for all the characters that are used as
|
||||
;; accent prefixes in this language.
|
||||
(setq tail iso-accents-list)
|
||||
(while tail
|
||||
(define-key global-key-translation-map (vector (car (car tail)))
|
||||
(define-key key-translation-map (vector (car (car tail)))
|
||||
'iso-accents-accent-key)
|
||||
(setq tail (cdr tail))))))
|
||||
|
||||
|
||||
@@ -5269,6 +5269,7 @@ See also `normal-erase-is-backspace'."
|
||||
|
||||
(if normal-erase-is-backspace
|
||||
(progn
|
||||
;; XXX Perhaps this mode should be terminal-local, not global -- lorentey
|
||||
(define-key function-key-map [delete] [?\C-d])
|
||||
(define-key function-key-map [kp-delete] [?\C-d])
|
||||
(define-key function-key-map [backspace] [?\C-?]))
|
||||
|
||||
@@ -1172,7 +1172,8 @@ 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 function-key-map (vector char))))
|
||||
(let ((translation (lookup-key (terminal-local-value 'local-function-key-map nil)
|
||||
(vector char))))
|
||||
(if (arrayp translation)
|
||||
(setq translated (aref translation 0))))
|
||||
(cond ((null translated))
|
||||
|
||||
@@ -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 (terminal-local-value 'function-key-map nil) "\e["))
|
||||
(setq AT386-keypad-map (lookup-key (terminal-local-value 'local-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 (terminal-local-value 'function-key-map nil) "\eN" [27]) ; ALT map
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\eN" [27]) ; ALT map
|
||||
)
|
||||
|
||||
;;; arch-tag: abec1b03-582f-49f8-b8cb-e2fd52ea4bd7
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; keyboard setup -- that's simple!
|
||||
(set-input-mode nil nil 0)
|
||||
(let (m (terminal-local-value 'function-key-map nil))
|
||||
(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])
|
||||
|
||||
@@ -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 (terminal-local-value 'function-key-map nil)))
|
||||
(set-keymap-parent (terminal-local-value 'function-key-map nil) m))
|
||||
(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))
|
||||
|
||||
;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
|
||||
;;; iris-ansi.el ends here
|
||||
|
||||
@@ -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 (terminal-local-value 'function-key-map nil)))
|
||||
(set-keymap-parent (terminal-local-value 'function-key-map nil) m))
|
||||
(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))
|
||||
|
||||
;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d
|
||||
;;; lk201.el ends here
|
||||
|
||||
@@ -1059,7 +1059,7 @@ 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 'function-key-map nil)))
|
||||
(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])
|
||||
@@ -1140,7 +1140,7 @@ correspoinding TextEncodingBase value."
|
||||
(set-keyboard-coding-system (or coding-system 'mac-roman))
|
||||
;; MacJapanese maps reverse solidus to ?\x80.
|
||||
(if (eq coding-system 'japanese-shift-jis)
|
||||
(define-key global-key-translation-map [?\x80] "\\"))))
|
||||
(define-key key-translation-map [?\x80] "\\"))))
|
||||
|
||||
(define-key special-event-map [language-change] 'mac-handle-language-change)
|
||||
|
||||
|
||||
@@ -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 (terminal-local-value 'function-key-map nil) "\eO"))
|
||||
(setq news-fkey-prefix (lookup-key (terminal-local-value 'local-function-key-map nil) "\eO"))
|
||||
(if (not (keymapp news-fkey-prefix))
|
||||
(error "What? Your news termcap/terminfo has no keycaps in it"))
|
||||
|
||||
|
||||
@@ -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 (terminal-local-value 'function-key-map nil)))
|
||||
(set-keymap-parent (terminal-local-value 'function-key-map nil) m))
|
||||
(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 up colors, for those versions of rxvt that support it.
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
;;
|
||||
|
||||
(defvar sun-raw-prefix (make-sparse-keymap))
|
||||
(define-key (terminal-local-value 'function-key-map nil) "\e[" sun-raw-prefix)
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[" sun-raw-prefix)
|
||||
|
||||
(define-key sun-raw-prefix "210z" [r3])
|
||||
(define-key sun-raw-prefix "213z" [r6])
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(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)))
|
||||
(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)))
|
||||
|
||||
;; Miscellaneous keys
|
||||
(mapcar (function (lambda (key-binding)
|
||||
(define-key (terminal-local-value 'function-key-map nil)
|
||||
(define-key (terminal-local-value 'local-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 (terminal-local-value 'function-key-map nil)
|
||||
(define-key (terminal-local-value 'local-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 (terminal-local-value 'function-key-map nil)
|
||||
(define-key (terminal-local-value 'local-function-key-map nil)
|
||||
(format "\e?%c" (+ i ?a))
|
||||
(vector (intern (format "f%d" (1+ i)))))
|
||||
(define-key (terminal-local-value 'function-key-map nil)
|
||||
(define-key (terminal-local-value 'local-function-key-map nil)
|
||||
(format "\e?%c" (+ i ?A))
|
||||
(vector (intern (format "S-f%d" (1+ i)))))
|
||||
(setq i (1+ i))))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89
|
||||
;;; vt200.el ends here
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae
|
||||
;;; vt201.el ends here
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871
|
||||
;;; vt220.el ends here
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7
|
||||
;;; vt240.el ends here
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f
|
||||
;;; vt300.el ends here
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c
|
||||
;;; vt320.el ends here
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5
|
||||
;;; vt400.el ends here
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(load "term/vt100" nil t)
|
||||
|
||||
;; Make F11 an escape key.
|
||||
(define-key function-key-map "\e[23~" [?\e])
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\e[23~" [?\e])
|
||||
|
||||
;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160
|
||||
;;; vt420.el ends here
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(define-key (terminal-local-value 'function-key-map nil) "\C-a" (make-keymap))
|
||||
(define-key (terminal-local-value 'local-function-key-map nil) "\C-a" (make-keymap))
|
||||
(mapcar (function (lambda (key-definition)
|
||||
(define-key (terminal-local-value 'function-key-map nil)
|
||||
(define-key (terminal-local-value 'local-function-key-map nil)
|
||||
(car key-definition) (nth 1 key-definition))))
|
||||
'(
|
||||
;; These might be set up by termcap and terminfo
|
||||
|
||||
@@ -1170,7 +1170,7 @@ 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 'function-key-map frame)))
|
||||
(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])
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
;; 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 'function-key-map nil)))
|
||||
(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)
|
||||
@@ -250,8 +250,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 (terminal-local-value 'function-key-map nil)))
|
||||
(set-keymap-parent (terminal-local-value 'function-key-map nil) m))
|
||||
(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 up colors, for those versions of xterm that support it.
|
||||
(defvar xterm-standard-colors
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; XXX Perhaps this should be terminal-local instead. --lorentey
|
||||
(define-key function-key-map "\e[M" 'xterm-mouse-translate)
|
||||
|
||||
(defvar xterm-mouse-last)
|
||||
|
||||
@@ -440,8 +440,11 @@ Lisp_Object Qpre_command_hook, Vpre_command_hook;
|
||||
Lisp_Object Qpost_command_hook, Vpost_command_hook;
|
||||
Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal;
|
||||
|
||||
/* Parent keymap of terminal-local function-key-map instances. */
|
||||
Lisp_Object Vfunction_key_map;
|
||||
|
||||
/* Parent keymap of terminal-local key-translation-map instances. */
|
||||
Lisp_Object Vglobal_key_translation_map;
|
||||
Lisp_Object Vkey_translation_map;
|
||||
|
||||
/* List of deferred actions to be performed at a later time.
|
||||
The precise format isn't relevant here; we just check whether it is nil. */
|
||||
@@ -8666,8 +8669,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
|
||||
last_nonmenu_event = Qnil;
|
||||
|
||||
delayed_switch_frame = Qnil;
|
||||
fkey.map = fkey.parent = current_kboard->Vfunction_key_map;
|
||||
keytran.map = keytran.parent = current_kboard->Vkey_translation_map;
|
||||
fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
|
||||
keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map;
|
||||
/* If there is no translation-map, turn off scanning. */
|
||||
fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1;
|
||||
keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
|
||||
@@ -10780,9 +10783,10 @@ init_kboard (kb)
|
||||
kb->reference_count = 0;
|
||||
kb->Vsystem_key_alist = Qnil;
|
||||
kb->system_key_syms = Qnil;
|
||||
kb->Vfunction_key_map = Fmake_sparse_keymap (Qnil);
|
||||
kb->Vkey_translation_map = Fmake_sparse_keymap (Qnil);
|
||||
Fset_keymap_parent (kb->Vkey_translation_map, Vglobal_key_translation_map);
|
||||
kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
|
||||
Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
|
||||
kb->Vlocal_key_translation_map = Fmake_sparse_keymap (Qnil);
|
||||
Fset_keymap_parent (kb->Vlocal_key_translation_map, Vkey_translation_map);
|
||||
kb->Vdefault_minibuffer_frame = Qnil;
|
||||
}
|
||||
|
||||
@@ -11496,7 +11500,7 @@ which binding of this variable is active at any given moment. If you
|
||||
need set or get the binding on a specific display, use
|
||||
`terminal-local-value' and `set-terminal-local-value'. */);
|
||||
|
||||
DEFVAR_KBOARD ("function-key-map", Vfunction_key_map,
|
||||
DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map,
|
||||
doc: /* Keymap mapping ASCII function key sequences onto their preferred forms.
|
||||
This allows Emacs to recognize function keys sent from ASCII
|
||||
terminals at any point in a key sequence.
|
||||
@@ -11517,14 +11521,22 @@ Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing
|
||||
key, typing `ESC O P x' would return [f1 x].
|
||||
|
||||
`function-key-map' has a separate binding for each display device.
|
||||
See Info node `(elisp)Multiple displays'.
|
||||
See Info node `(elisp)Multiple displays'. If you need to define a
|
||||
binding on all display devices, change `global-function-key-map'
|
||||
instead.
|
||||
|
||||
Note that the currently selected frame has very little to do with
|
||||
which binding of this variable is active at any given moment. If you
|
||||
need set or get the binding on a specific display, use
|
||||
`terminal-local-value' and `set-terminal-local-value'. */);
|
||||
|
||||
DEFVAR_KBOARD ("key-translation-map", Vkey_translation_map,
|
||||
DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
|
||||
doc: /* The parent keymap of all `local-function-key-map' instances.
|
||||
Function key definitions that apply to all display devices should go
|
||||
here. */);
|
||||
Vfunction_key_map = Fmake_sparse_keymap (Qnil);
|
||||
|
||||
DEFVAR_KBOARD ("local-key-translation-map", Vlocal_key_translation_map,
|
||||
doc: /* Keymap of key translations that can override keymaps.
|
||||
This keymap works like `function-key-map', but comes after that,
|
||||
and its non-prefix bindings override ordinary bindings.
|
||||
@@ -11538,11 +11550,10 @@ which binding of this variable is active at any given moment. If you
|
||||
need set or get the binding on a specific display, use
|
||||
`terminal-local-value' and `set-terminal-local-value'. */);
|
||||
|
||||
DEFVAR_LISP ("global-key-translation-map", &Vglobal_key_translation_map,
|
||||
doc: /* The parent keymap of all terminal-local `key-translation-map' instances.
|
||||
Key translations that are not specific to a display device flavour
|
||||
should go here. */);
|
||||
Vglobal_key_translation_map = Fmake_sparse_keymap (Qnil);
|
||||
DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
|
||||
doc: /* The parent keymap of all `local-key-translation-map' instances.
|
||||
Key translations that apply to all display devices should go here. */);
|
||||
Vkey_translation_map = Fmake_sparse_keymap (Qnil);
|
||||
|
||||
DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list,
|
||||
doc: /* List of deferred actions to be performed at a later time.
|
||||
@@ -11707,8 +11718,8 @@ mark_kboards ()
|
||||
mark_object (kb->Vlast_kbd_macro);
|
||||
mark_object (kb->Vsystem_key_alist);
|
||||
mark_object (kb->system_key_syms);
|
||||
mark_object (kb->Vfunction_key_map);
|
||||
mark_object (kb->Vkey_translation_map);
|
||||
mark_object (kb->Vlocal_function_key_map);
|
||||
mark_object (kb->Vlocal_key_translation_map);
|
||||
mark_object (kb->Vdefault_minibuffer_frame);
|
||||
mark_object (kb->echo_string);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ struct kboard
|
||||
/* Keymap mapping ASCII function key sequences onto their
|
||||
preferred forms. Initialized by the terminal-specific lisp
|
||||
files. See the DEFVAR for more documentation. */
|
||||
Lisp_Object Vfunction_key_map;
|
||||
Lisp_Object Vlocal_function_key_map;
|
||||
|
||||
/* Keymap of key translations that can override keymaps. */
|
||||
Lisp_Object Vkey_translation_map;
|
||||
Lisp_Object Vlocal_key_translation_map;
|
||||
|
||||
/* Minibufferless frames on this display use this frame's minibuffer. */
|
||||
Lisp_Object Vdefault_minibuffer_frame;
|
||||
@@ -304,8 +304,11 @@ extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *));
|
||||
/* User-supplied string to translate input characters through. */
|
||||
extern Lisp_Object Vkeyboard_translate_table;
|
||||
|
||||
/* Parent keymap of terminal-local function-key-map instances. */
|
||||
extern Lisp_Object Vfunction_key_map;
|
||||
|
||||
/* Parent keymap of terminal-local key-translation-map instances. */
|
||||
extern Lisp_Object Vglobal_key_translation_map;
|
||||
extern Lisp_Object Vkey_translation_map;
|
||||
|
||||
|
||||
extern int parse_menu_item P_ ((Lisp_Object, int, int));
|
||||
|
||||
@@ -2841,8 +2841,8 @@ You type Translation\n\
|
||||
insert ("\n", 1);
|
||||
}
|
||||
|
||||
if (!NILP (current_kboard->Vkey_translation_map))
|
||||
describe_map_tree (current_kboard->Vkey_translation_map, 0, Qnil, prefix,
|
||||
if (!NILP (current_kboard->Vlocal_key_translation_map))
|
||||
describe_map_tree (current_kboard->Vlocal_key_translation_map, 0, Qnil, prefix,
|
||||
"Key translations", nomenu, 1, 0, 0);
|
||||
|
||||
|
||||
@@ -2931,8 +2931,8 @@ You type Translation\n\
|
||||
"\f\nGlobal Bindings", nomenu, 0, 1, 0);
|
||||
|
||||
/* Print the function-key-map translations under this prefix. */
|
||||
if (!NILP (current_kboard->Vfunction_key_map))
|
||||
describe_map_tree (current_kboard->Vfunction_key_map, 0, Qnil, prefix,
|
||||
if (!NILP (current_kboard->Vlocal_function_key_map))
|
||||
describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix,
|
||||
"\f\nFunction key map translations", nomenu, 1, 0, 0);
|
||||
|
||||
UNGCPRO;
|
||||
|
||||
14
src/term.c
14
src/term.c
@@ -1350,13 +1350,13 @@ term_get_fkeys_1 ()
|
||||
|
||||
/* This can happen if CANNOT_DUMP or with strange options. */
|
||||
if (!initialized)
|
||||
kboard->Vfunction_key_map = Fmake_sparse_keymap (Qnil);
|
||||
kboard->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
|
||||
|
||||
for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
|
||||
{
|
||||
char *sequence = tgetstr (keys[i].cap, address);
|
||||
if (sequence)
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (sequence),
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
|
||||
Fmake_vector (make_number (1),
|
||||
intern (keys[i].name)));
|
||||
}
|
||||
@@ -1376,13 +1376,13 @@ term_get_fkeys_1 ()
|
||||
if (k0)
|
||||
/* Define f0 first, so that f10 takes precedence in case the
|
||||
key sequences happens to be the same. */
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (k0),
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
|
||||
Fmake_vector (make_number (1), intern ("f0")));
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (k_semi),
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (k_semi),
|
||||
Fmake_vector (make_number (1), intern ("f10")));
|
||||
}
|
||||
else if (k0)
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (k0),
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
|
||||
Fmake_vector (make_number (1), intern (k0_name)));
|
||||
}
|
||||
|
||||
@@ -1405,7 +1405,7 @@ term_get_fkeys_1 ()
|
||||
if (sequence)
|
||||
{
|
||||
sprintf (fkey, "f%d", i);
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (sequence),
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
|
||||
Fmake_vector (make_number (1),
|
||||
intern (fkey)));
|
||||
}
|
||||
@@ -1422,7 +1422,7 @@ term_get_fkeys_1 ()
|
||||
{ \
|
||||
char *sequence = tgetstr (cap2, address); \
|
||||
if (sequence) \
|
||||
Fdefine_key (kboard->Vfunction_key_map, build_string (sequence), \
|
||||
Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), \
|
||||
Fmake_vector (make_number (1), \
|
||||
intern (sym))); \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user