diff options
| author | Karoly Lorentey | 2005-09-09 19:04:34 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-09-09 19:04:34 +0000 |
| commit | af520c4a4e04e55c854bb782af8df8412028c481 (patch) | |
| tree | 10def401ec0f2c648dc480d2ff5185d43ee45f7d | |
| parent | 5b65d888a676b023b7232b460105551e51a58a13 (diff) | |
| download | emacs-af520c4a4e04e55c854bb782af8df8412028c481.tar.gz emacs-af520c4a4e04e55c854bb782af8df8412028c481.zip | |
Fix function-key-map massaging vs `C-x 5 2' in lisp/term/*.el. (Submitted by Dan Nicolaescu.)
* term/lk201.el (terminal-init-lk201):
* term/iris-ansi.el (terminal-init-iris-ansi):
* term/rxvt.el (terminal-init-rxvt): Protect function-key-map
against multiple invocations from the same terminal.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-403
| -rw-r--r-- | README.multi-tty | 13 | ||||
| -rw-r--r-- | lisp/term/iris-ansi.el | 15 | ||||
| -rw-r--r-- | lisp/term/lk201.el | 16 | ||||
| -rw-r--r-- | lisp/term/rxvt.el | 99 |
4 files changed, 71 insertions, 72 deletions
diff --git a/README.multi-tty b/README.multi-tty index 7d0d420a0a7..b14f2a55157 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -386,19 +386,6 @@ is probably not very interesting for anyone else.) | |||
| 386 | THINGS TO DO | 386 | THINGS TO DO |
| 387 | ------------ | 387 | ------------ |
| 388 | 388 | ||
| 389 | ** Go through lisp/term/*.el once more and protect terminal-local | ||
| 390 | initializations with '(when (eq 1 (length (frames-on-display-list)))' | ||
| 391 | as in xterm.el. This is to prevent resource allocation explosions | ||
| 392 | when C-x 5 2 is used repeatedly. | ||
| 393 | |||
| 394 | ** Dan Nicolaescu writes: | ||
| 395 | > The terminal initialization code still has some issues. | ||
| 396 | > This can be seen when using emacsclient -t on a 256 color xterm. The | ||
| 397 | > terminal frame is only created with 8 color. | ||
| 398 | > The reason is that terminal-init-xterm calls | ||
| 399 | > xterm-register-default-colors which calls (display-color-cells (selected-frame)) | ||
| 400 | > and probably `selected-frame' is not completely setup at that time. | ||
| 401 | |||
| 402 | ** emacsclient --no-wait and --eval is currently broken. | 389 | ** emacsclient --no-wait and --eval is currently broken. |
| 403 | 390 | ||
| 404 | ** xt-mouse.el needs to be adapted for multi-tty. It currently | 391 | ** xt-mouse.el needs to be adapted for multi-tty. It currently |
diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 42f0912ed2f..d751ca69057 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el | |||
| @@ -331,12 +331,15 @@ | |||
| 331 | 331 | ||
| 332 | (defun terminal-init-iris-ansi () | 332 | (defun terminal-init-iris-ansi () |
| 333 | "Terminal initialization function for iris-ansi." | 333 | "Terminal initialization function for iris-ansi." |
| 334 | ;; Use inheritance to let the main keymap override these defaults. | 334 | ;; The terminal-local stuff only need to be set up on the first |
| 335 | ;; This way we don't override terminfo-derived settings or settings | 335 | ;; frame on that device. |
| 336 | ;; made in the .emacs file. | 336 | (when (eq 1 (length (frames-on-display-list))) |
| 337 | (let ((m (copy-keymap iris-function-map))) | 337 | ;; Use inheritance to let the main keymap override these defaults. |
| 338 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | 338 | ;; This way we don't override terminfo-derived settings or settings |
| 339 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))) | 339 | ;; made in the .emacs file. |
| 340 | (let ((m (copy-keymap iris-function-map))) | ||
| 341 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | ||
| 342 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)))) | ||
| 340 | 343 | ||
| 341 | ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b | 344 | ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b |
| 342 | ;;; iris-ansi.el ends here | 345 | ;;; iris-ansi.el ends here |
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 960793ce996..4eb84b65702 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el | |||
| @@ -76,12 +76,16 @@ | |||
| 76 | (define-key lk201-function-map "\eOy" [kp-9])) | 76 | (define-key lk201-function-map "\eOy" [kp-9])) |
| 77 | 77 | ||
| 78 | (defun terminal-init-lk201 () | 78 | (defun terminal-init-lk201 () |
| 79 | ;; Use inheritance to let the main keymap override these defaults. | 79 | ;; The terminal-local stuff only need to be set up on the first |
| 80 | ;; This way we don't override terminfo-derived settings or settings | 80 | ;; frame on that device. |
| 81 | ;; made in the .emacs file. | 81 | (when (eq 1 (length (frames-on-display-list))) |
| 82 | (let ((m (copy-keymap lk201-function-map))) | 82 | |
| 83 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | 83 | ;; Use inheritance to let the main keymap override these defaults. |
| 84 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))) | 84 | ;; This way we don't override terminfo-derived settings or settings |
| 85 | ;; made in the .emacs file. | ||
| 86 | (let ((m (copy-keymap lk201-function-map))) | ||
| 87 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | ||
| 88 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)))) | ||
| 85 | 89 | ||
| 86 | ;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d | 90 | ;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d |
| 87 | ;;; lk201.el ends here | 91 | ;;; lk201.el ends here |
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 017dad2e7af..5729b670a16 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el | |||
| @@ -119,53 +119,58 @@ | |||
| 119 | 119 | ||
| 120 | (defun terminal-init-rxvt () | 120 | (defun terminal-init-rxvt () |
| 121 | "Terminal initialization function for rxvt." | 121 | "Terminal initialization function for rxvt." |
| 122 | ;; The terminal intialization C code file might have initialized | 122 | |
| 123 | ;; function keys F11->F42 from the termcap/terminfo information. On | 123 | ;; The terminal-local stuff only need to be set up on the first |
| 124 | ;; a PC-style keyboard these keys correspond to | 124 | ;; frame on that device. |
| 125 | ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The | 125 | (when (eq 1 (length (frames-on-display-list))) |
| 126 | ;; code here subsitutes the corresponding defintions in | 126 | ;; The terminal intialization C code file might have initialized |
| 127 | ;; function-key-map. This substitution is needed because if a key | 127 | ;; function keys F11->F42 from the termcap/terminfo information. On |
| 128 | ;; definition if found in function-key-map, there are no further | 128 | ;; a PC-style keyboard these keys correspond to |
| 129 | ;; lookups in other keymaps. | 129 | ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The |
| 130 | (substitute-key-definition [f11] [S-f1] function-key-map) | 130 | ;; code here subsitutes the corresponding defintions in |
| 131 | (substitute-key-definition [f12] [S-f2] function-key-map) | 131 | ;; function-key-map. This substitution is needed because if a key |
| 132 | (substitute-key-definition [f13] [S-f3] function-key-map) | 132 | ;; definition if found in function-key-map, there are no further |
| 133 | (substitute-key-definition [f14] [S-f4] function-key-map) | 133 | ;; lookups in other keymaps. |
| 134 | (substitute-key-definition [f15] [S-f5] function-key-map) | 134 | (let ((m (terminal-local-value 'local-function-key-map nil))) |
| 135 | (substitute-key-definition [f16] [S-f6] function-key-map) | 135 | (substitute-key-definition [f11] [S-f1] m) |
| 136 | (substitute-key-definition [f17] [S-f7] function-key-map) | 136 | (substitute-key-definition [f12] [S-f2] m) |
| 137 | (substitute-key-definition [f18] [S-f8] function-key-map) | 137 | (substitute-key-definition [f13] [S-f3] m) |
| 138 | (substitute-key-definition [f19] [S-f9] function-key-map) | 138 | (substitute-key-definition [f14] [S-f4] m) |
| 139 | (substitute-key-definition [f20] [S-f10] function-key-map) | 139 | (substitute-key-definition [f15] [S-f5] m) |
| 140 | 140 | (substitute-key-definition [f16] [S-f6] m) | |
| 141 | (substitute-key-definition [f23] [C-f1] function-key-map) | 141 | (substitute-key-definition [f17] [S-f7] m) |
| 142 | (substitute-key-definition [f24] [C-f2] function-key-map) | 142 | (substitute-key-definition [f18] [S-f8] m) |
| 143 | (substitute-key-definition [f25] [C-f3] function-key-map) | 143 | (substitute-key-definition [f19] [S-f9] m) |
| 144 | (substitute-key-definition [f26] [C-f4] function-key-map) | 144 | (substitute-key-definition [f20] [S-f10] m) |
| 145 | (substitute-key-definition [f27] [C-f5] function-key-map) | 145 | |
| 146 | (substitute-key-definition [f28] [C-f6] function-key-map) | 146 | (substitute-key-definition [f23] [C-f1] m) |
| 147 | (substitute-key-definition [f29] [C-f7] function-key-map) | 147 | (substitute-key-definition [f24] [C-f2] m) |
| 148 | (substitute-key-definition [f30] [C-f8] function-key-map) | 148 | (substitute-key-definition [f25] [C-f3] m) |
| 149 | (substitute-key-definition [f31] [C-f9] function-key-map) | 149 | (substitute-key-definition [f26] [C-f4] m) |
| 150 | (substitute-key-definition [f32] [C-f10] function-key-map) | 150 | (substitute-key-definition [f27] [C-f5] m) |
| 151 | 151 | (substitute-key-definition [f28] [C-f6] m) | |
| 152 | (substitute-key-definition [f33] [C-S-f1] function-key-map) | 152 | (substitute-key-definition [f29] [C-f7] m) |
| 153 | (substitute-key-definition [f34] [C-S-f2] function-key-map) | 153 | (substitute-key-definition [f30] [C-f8] m) |
| 154 | (substitute-key-definition [f35] [C-S-f3] function-key-map) | 154 | (substitute-key-definition [f31] [C-f9] m) |
| 155 | (substitute-key-definition [f36] [C-S-f4] function-key-map) | 155 | (substitute-key-definition [f32] [C-f10] m) |
| 156 | (substitute-key-definition [f37] [C-S-f5] function-key-map) | 156 | |
| 157 | (substitute-key-definition [f38] [C-S-f6] function-key-map) | 157 | (substitute-key-definition [f33] [C-S-f1] m) |
| 158 | (substitute-key-definition [f39] [C-S-f7] function-key-map) | 158 | (substitute-key-definition [f34] [C-S-f2] m) |
| 159 | (substitute-key-definition [f40] [C-S-f8] function-key-map) | 159 | (substitute-key-definition [f35] [C-S-f3] m) |
| 160 | (substitute-key-definition [f41] [C-S-f9] function-key-map) | 160 | (substitute-key-definition [f36] [C-S-f4] m) |
| 161 | (substitute-key-definition [f42] [C-S-f10] function-key-map) | 161 | (substitute-key-definition [f37] [C-S-f5] m) |
| 162 | 162 | (substitute-key-definition [f38] [C-S-f6] m) | |
| 163 | ;; Use inheritance to let the main keymap override those defaults. | 163 | (substitute-key-definition [f39] [C-S-f7] m) |
| 164 | ;; This way we don't override terminfo-derived settings or settings | 164 | (substitute-key-definition [f40] [C-S-f8] m) |
| 165 | ;; made in the .emacs file. | 165 | (substitute-key-definition [f41] [C-S-f9] m) |
| 166 | (let ((m (copy-keymap rxvt-function-map))) | 166 | (substitute-key-definition [f42] [C-S-f10] m)) |
| 167 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | 167 | |
| 168 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)) | 168 | ;; Use inheritance to let the main keymap override those defaults. |
| 169 | ;; This way we don't override terminfo-derived settings or settings | ||
| 170 | ;; made in the .emacs file. | ||
| 171 | (let ((m (copy-keymap rxvt-function-map))) | ||
| 172 | (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) | ||
| 173 | (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))) | ||
| 169 | 174 | ||
| 170 | ;; Initialize colors and background mode. | 175 | ;; Initialize colors and background mode. |
| 171 | (rxvt-register-default-colors) | 176 | (rxvt-register-default-colors) |