Commit 7d6d7d1a authored by Karoly Lorentey's avatar Karoly Lorentey
Browse files

Speed up loading of term/xterm.el (Dan Nicolaescu).

* lisp/term/xterm.el: Move key substitutions back before the
  define-keys.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-368
parent 440607d3
......@@ -404,7 +404,21 @@ THINGS TO DO
** BULK RENAME: The `display-' prefix of new Lisp-level functions
conflicts with stuff like `display-time-mode'. Use `device-'
instead.
or `terminal-' instead. I think I prefer `terminal-'.
** The semantics of terminal-local variables are confusing; it is not
clear what binding is in effect in any given time. See if
current_kboard (or at least the terminal-local bindings exported to
Lisp) might be changed to be tied to the selected frame instead.
Currently, `function-key-map' and `key-translation-map' may be
accessed reliably only using the hackish
`(set-)terminal-local-value' functions.
Perhaps there should be a difference between `last-command' &co.
and these more conventional configuration variables.
(E.g. `symbol-value' would use current_kboard to access
`last-command', but SELECTED_FRAME()->display->kboard to get the
value of `function-key-map'.
** The single-keyboard mode of MULTI_KBOARD is extremely confusing
sometimes; Emacs does not respond to stimuli from other keyboards.
......@@ -444,6 +458,10 @@ THINGS TO DO
** standard-display-table should be display-local.
standard-display-european should be display-local.
** With iswitchb-default-method set to 'always-frame, only frames on
the current display should be considered. This might involve
extending `get-buffer-window'.
** Have a look at Vlocale_coding_system. Seems like it would be a
tedious job to localize it, although most references use it for
interfacing with libc and are therefore OK with the global
......@@ -518,6 +536,8 @@ THINGS TO DO
that's why raw terminal support is broken again. I really do need
to understand input.)
** Fix stuff_char for multi-tty. Doesn't seem to be of high priority.
DIARY OF CHANGES
----------------
......
......@@ -31,6 +31,70 @@
(defvar xterm-function-map nil
"Function key map overrides for xterm.")
;; The terminal intialization C code file might have initialized
;; function keys F13->F60 from the termcap/terminfo information. On
;; a PC-style keyboard these keys correspond to
;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The
;; code here subsitutes the corresponding defintions in
;; 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)))
;; This stuff takes several seconds; don't do it unless the keys
;; seem to be defined.
(when (lookup-key m [f13])
(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)))
;; Make reloads faster.
(unless xterm-function-map
(setq xterm-function-map (make-sparse-keymap))
......@@ -192,71 +256,6 @@
(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
;; a PC-style keyboard these keys correspond to
;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The
;; code here subsitutes the corresponding defintions in
;; 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)))
;; This stuff takes several seconds; don't do it unless the keys
;; seem to be defined.
(when (lookup-key m [f13])
(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)))
;; Set up colors, for those versions of xterm that support it.
(defvar xterm-standard-colors
;; The names in the comments taken from XTerm-col.ad in the xterm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment