diff options
| author | Karoly Lorentey | 2005-06-28 15:06:17 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-06-28 15:06:17 +0000 |
| commit | 7d6d7d1a6130cb56ff9a6940bb8e01d8dacb0ef9 (patch) | |
| tree | e9cf3036086c63047670a72ca1ec0abe94b5a750 | |
| parent | 440607d3e6d1df8d2867bef5c4c750fda4a4262b (diff) | |
| download | emacs-7d6d7d1a6130cb56ff9a6940bb8e01d8dacb0ef9.tar.gz emacs-7d6d7d1a6130cb56ff9a6940bb8e01d8dacb0ef9.zip | |
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
| -rw-r--r-- | README.multi-tty | 22 | ||||
| -rw-r--r-- | lisp/term/xterm.el | 129 |
2 files changed, 85 insertions, 66 deletions
diff --git a/README.multi-tty b/README.multi-tty index f1e7277ed1e..d722df72a02 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -404,7 +404,21 @@ THINGS TO DO | |||
| 404 | 404 | ||
| 405 | ** BULK RENAME: The `display-' prefix of new Lisp-level functions | 405 | ** BULK RENAME: The `display-' prefix of new Lisp-level functions |
| 406 | conflicts with stuff like `display-time-mode'. Use `device-' | 406 | conflicts with stuff like `display-time-mode'. Use `device-' |
| 407 | instead. | 407 | or `terminal-' instead. I think I prefer `terminal-'. |
| 408 | |||
| 409 | ** The semantics of terminal-local variables are confusing; it is not | ||
| 410 | clear what binding is in effect in any given time. See if | ||
| 411 | current_kboard (or at least the terminal-local bindings exported to | ||
| 412 | Lisp) might be changed to be tied to the selected frame instead. | ||
| 413 | Currently, `function-key-map' and `key-translation-map' may be | ||
| 414 | accessed reliably only using the hackish | ||
| 415 | `(set-)terminal-local-value' functions. | ||
| 416 | |||
| 417 | Perhaps there should be a difference between `last-command' &co. | ||
| 418 | and these more conventional configuration variables. | ||
| 419 | (E.g. `symbol-value' would use current_kboard to access | ||
| 420 | `last-command', but SELECTED_FRAME()->display->kboard to get the | ||
| 421 | value of `function-key-map'. | ||
| 408 | 422 | ||
| 409 | ** The single-keyboard mode of MULTI_KBOARD is extremely confusing | 423 | ** The single-keyboard mode of MULTI_KBOARD is extremely confusing |
| 410 | sometimes; Emacs does not respond to stimuli from other keyboards. | 424 | sometimes; Emacs does not respond to stimuli from other keyboards. |
| @@ -444,6 +458,10 @@ THINGS TO DO | |||
| 444 | ** standard-display-table should be display-local. | 458 | ** standard-display-table should be display-local. |
| 445 | standard-display-european should be display-local. | 459 | standard-display-european should be display-local. |
| 446 | 460 | ||
| 461 | ** With iswitchb-default-method set to 'always-frame, only frames on | ||
| 462 | the current display should be considered. This might involve | ||
| 463 | extending `get-buffer-window'. | ||
| 464 | |||
| 447 | ** Have a look at Vlocale_coding_system. Seems like it would be a | 465 | ** Have a look at Vlocale_coding_system. Seems like it would be a |
| 448 | tedious job to localize it, although most references use it for | 466 | tedious job to localize it, although most references use it for |
| 449 | interfacing with libc and are therefore OK with the global | 467 | interfacing with libc and are therefore OK with the global |
| @@ -518,6 +536,8 @@ THINGS TO DO | |||
| 518 | that's why raw terminal support is broken again. I really do need | 536 | that's why raw terminal support is broken again. I really do need |
| 519 | to understand input.) | 537 | to understand input.) |
| 520 | 538 | ||
| 539 | ** Fix stuff_char for multi-tty. Doesn't seem to be of high priority. | ||
| 540 | |||
| 521 | DIARY OF CHANGES | 541 | DIARY OF CHANGES |
| 522 | ---------------- | 542 | ---------------- |
| 523 | 543 | ||
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 88d1ffa98e6..602621a4354 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el | |||
| @@ -31,6 +31,70 @@ | |||
| 31 | (defvar xterm-function-map nil | 31 | (defvar xterm-function-map nil |
| 32 | "Function key map overrides for xterm.") | 32 | "Function key map overrides for xterm.") |
| 33 | 33 | ||
| 34 | ;; The terminal intialization C code file might have initialized | ||
| 35 | ;; function keys F13->F60 from the termcap/terminfo information. On | ||
| 36 | ;; a PC-style keyboard these keys correspond to | ||
| 37 | ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The | ||
| 38 | ;; code here subsitutes the corresponding defintions in | ||
| 39 | ;; function-key-map. This substitution is needed because if a key | ||
| 40 | ;; definition if found in function-key-map, there are no further | ||
| 41 | ;; lookups in other keymaps. | ||
| 42 | (let ((m (terminal-local-value 'function-key-map nil))) | ||
| 43 | ;; This stuff takes several seconds; don't do it unless the keys | ||
| 44 | ;; seem to be defined. | ||
| 45 | (when (lookup-key m [f13]) | ||
| 46 | (substitute-key-definition [f13] [S-f1] m) | ||
| 47 | (substitute-key-definition [f14] [S-f2] m) | ||
| 48 | (substitute-key-definition [f15] [S-f3] m) | ||
| 49 | (substitute-key-definition [f16] [S-f4] m) | ||
| 50 | (substitute-key-definition [f17] [S-f5] m) | ||
| 51 | (substitute-key-definition [f18] [S-f6] m) | ||
| 52 | (substitute-key-definition [f19] [S-f7] m) | ||
| 53 | (substitute-key-definition [f20] [S-f8] m) | ||
| 54 | (substitute-key-definition [f21] [S-f9] m) | ||
| 55 | (substitute-key-definition [f22] [S-f10] m) | ||
| 56 | (substitute-key-definition [f23] [S-f11] m) | ||
| 57 | (substitute-key-definition [f24] [S-f12] m) | ||
| 58 | |||
| 59 | (substitute-key-definition [f25] [C-f1] m) | ||
| 60 | (substitute-key-definition [f26] [C-f2] m) | ||
| 61 | (substitute-key-definition [f27] [C-f3] m) | ||
| 62 | (substitute-key-definition [f28] [C-f4] m) | ||
| 63 | (substitute-key-definition [f29] [C-f5] m) | ||
| 64 | (substitute-key-definition [f30] [C-f6] m) | ||
| 65 | (substitute-key-definition [f31] [C-f7] m) | ||
| 66 | (substitute-key-definition [f32] [C-f8] m) | ||
| 67 | (substitute-key-definition [f33] [C-f9] m) | ||
| 68 | (substitute-key-definition [f34] [C-f10] m) | ||
| 69 | (substitute-key-definition [f35] [C-f11] m) | ||
| 70 | (substitute-key-definition [f36] [C-f12] m) | ||
| 71 | |||
| 72 | (substitute-key-definition [f37] [C-S-f1] m) | ||
| 73 | (substitute-key-definition [f38] [C-S-f2] m) | ||
| 74 | (substitute-key-definition [f39] [C-S-f3] m) | ||
| 75 | (substitute-key-definition [f40] [C-S-f4] m) | ||
| 76 | (substitute-key-definition [f41] [C-S-f5] m) | ||
| 77 | (substitute-key-definition [f42] [C-S-f6] m) | ||
| 78 | (substitute-key-definition [f43] [C-S-f7] m) | ||
| 79 | (substitute-key-definition [f44] [C-S-f8] m) | ||
| 80 | (substitute-key-definition [f45] [C-S-f9] m) | ||
| 81 | (substitute-key-definition [f46] [C-S-f10] m) | ||
| 82 | (substitute-key-definition [f47] [C-S-f11] m) | ||
| 83 | (substitute-key-definition [f48] [C-S-f12] m) | ||
| 84 | |||
| 85 | (substitute-key-definition [f49] [A-f1] m) | ||
| 86 | (substitute-key-definition [f50] [A-f2] m) | ||
| 87 | (substitute-key-definition [f51] [A-f3] m) | ||
| 88 | (substitute-key-definition [f52] [A-f4] m) | ||
| 89 | (substitute-key-definition [f53] [A-f5] m) | ||
| 90 | (substitute-key-definition [f54] [A-f6] m) | ||
| 91 | (substitute-key-definition [f55] [A-f7] m) | ||
| 92 | (substitute-key-definition [f56] [A-f8] m) | ||
| 93 | (substitute-key-definition [f57] [A-f9] m) | ||
| 94 | (substitute-key-definition [f58] [A-f10] m) | ||
| 95 | (substitute-key-definition [f59] [A-f11] m) | ||
| 96 | (substitute-key-definition [f60] [A-f12] m))) | ||
| 97 | |||
| 34 | ;; Make reloads faster. | 98 | ;; Make reloads faster. |
| 35 | (unless xterm-function-map | 99 | (unless xterm-function-map |
| 36 | (setq xterm-function-map (make-sparse-keymap)) | 100 | (setq xterm-function-map (make-sparse-keymap)) |
| @@ -192,71 +256,6 @@ | |||
| 192 | (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil))) | 256 | (set-keymap-parent m (keymap-parent (terminal-local-value 'function-key-map nil))) |
| 193 | (set-keymap-parent (terminal-local-value 'function-key-map nil) m)) | 257 | (set-keymap-parent (terminal-local-value 'function-key-map nil) m)) |
| 194 | 258 | ||
| 195 | ;; The terminal intialization C code file might have initialized | ||
| 196 | ;; function keys F13->F60 from the termcap/terminfo information. On | ||
| 197 | ;; a PC-style keyboard these keys correspond to | ||
| 198 | ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-. The | ||
| 199 | ;; code here subsitutes the corresponding defintions in | ||
| 200 | ;; function-key-map. This substitution is needed because if a key | ||
| 201 | ;; definition if found in function-key-map, there are no further | ||
| 202 | ;; lookups in other keymaps. | ||
| 203 | (let ((m (terminal-local-value 'function-key-map nil))) | ||
| 204 | ;; This stuff takes several seconds; don't do it unless the keys | ||
| 205 | ;; seem to be defined. | ||
| 206 | (when (lookup-key m [f13]) | ||
| 207 | (substitute-key-definition [f13] [S-f1] m) | ||
| 208 | (substitute-key-definition [f14] [S-f2] m) | ||
| 209 | (substitute-key-definition [f15] [S-f3] m) | ||
| 210 | (substitute-key-definition [f16] [S-f4] m) | ||
| 211 | (substitute-key-definition [f17] [S-f5] m) | ||
| 212 | (substitute-key-definition [f18] [S-f6] m) | ||
| 213 | (substitute-key-definition [f19] [S-f7] m) | ||
| 214 | (substitute-key-definition [f20] [S-f8] m) | ||
| 215 | (substitute-key-definition [f21] [S-f9] m) | ||
| 216 | (substitute-key-definition [f22] [S-f10] m) | ||
| 217 | (substitute-key-definition [f23] [S-f11] m) | ||
| 218 | (substitute-key-definition [f24] [S-f12] m) | ||
| 219 | |||
| 220 | (substitute-key-definition [f25] [C-f1] m) | ||
| 221 | (substitute-key-definition [f26] [C-f2] m) | ||
| 222 | (substitute-key-definition [f27] [C-f3] m) | ||
| 223 | (substitute-key-definition [f28] [C-f4] m) | ||
| 224 | (substitute-key-definition [f29] [C-f5] m) | ||
| 225 | (substitute-key-definition [f30] [C-f6] m) | ||
| 226 | (substitute-key-definition [f31] [C-f7] m) | ||
| 227 | (substitute-key-definition [f32] [C-f8] m) | ||
| 228 | (substitute-key-definition [f33] [C-f9] m) | ||
| 229 | (substitute-key-definition [f34] [C-f10] m) | ||
| 230 | (substitute-key-definition [f35] [C-f11] m) | ||
| 231 | (substitute-key-definition [f36] [C-f12] m) | ||
| 232 | |||
| 233 | (substitute-key-definition [f37] [C-S-f1] m) | ||
| 234 | (substitute-key-definition [f38] [C-S-f2] m) | ||
| 235 | (substitute-key-definition [f39] [C-S-f3] m) | ||
| 236 | (substitute-key-definition [f40] [C-S-f4] m) | ||
| 237 | (substitute-key-definition [f41] [C-S-f5] m) | ||
| 238 | (substitute-key-definition [f42] [C-S-f6] m) | ||
| 239 | (substitute-key-definition [f43] [C-S-f7] m) | ||
| 240 | (substitute-key-definition [f44] [C-S-f8] m) | ||
| 241 | (substitute-key-definition [f45] [C-S-f9] m) | ||
| 242 | (substitute-key-definition [f46] [C-S-f10] m) | ||
| 243 | (substitute-key-definition [f47] [C-S-f11] m) | ||
| 244 | (substitute-key-definition [f48] [C-S-f12] m) | ||
| 245 | |||
| 246 | (substitute-key-definition [f49] [A-f1] m) | ||
| 247 | (substitute-key-definition [f50] [A-f2] m) | ||
| 248 | (substitute-key-definition [f51] [A-f3] m) | ||
| 249 | (substitute-key-definition [f52] [A-f4] m) | ||
| 250 | (substitute-key-definition [f53] [A-f5] m) | ||
| 251 | (substitute-key-definition [f54] [A-f6] m) | ||
| 252 | (substitute-key-definition [f55] [A-f7] m) | ||
| 253 | (substitute-key-definition [f56] [A-f8] m) | ||
| 254 | (substitute-key-definition [f57] [A-f9] m) | ||
| 255 | (substitute-key-definition [f58] [A-f10] m) | ||
| 256 | (substitute-key-definition [f59] [A-f11] m) | ||
| 257 | (substitute-key-definition [f60] [A-f12] m))) | ||
| 258 | |||
| 259 | |||
| 260 | ;; Set up colors, for those versions of xterm that support it. | 259 | ;; Set up colors, for those versions of xterm that support it. |
| 261 | (defvar xterm-standard-colors | 260 | (defvar xterm-standard-colors |
| 262 | ;; The names in the comments taken from XTerm-col.ad in the xterm | 261 | ;; The names in the comments taken from XTerm-col.ad in the xterm |