diff options
| author | Karoly Lorentey | 2005-05-03 01:49:33 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-05-03 01:49:33 +0000 |
| commit | 68bba4e4b3ced56b5608ee0495f94d24e7e3f40c (patch) | |
| tree | 43067ff161298f52824bd833e6d16b65dddf23e9 /lisp | |
| parent | 941d4811d5b6660e2cdb5f668d52792c7e5920e8 (diff) | |
| download | emacs-68bba4e4b3ced56b5608ee0495f94d24e7e3f40c.tar.gz emacs-68bba4e4b3ced56b5608ee0495f94d24e7e3f40c.zip | |
Fix UTF-8 tty input when first frame is an X frame. Steps towards multiple tty locale support.
* lisp/international/mule-cmds.el (set-locale-environment): Ignore
window-system; always set the keyboard coding system.
* src/termhooks.h (DISPLAY_TERMINAL_CODING, DISPLAY_KEYBOARD_CODING): New macros.
* src/coding.c (Fset_terminal_coding_system_internal, Fterminal_coding_system)
(Fset_keyboard_coding_system_internal, Fkeyboard_coding_system): Add DISPLAY
parameter.
* src/term.c (get_display): Add THROW parameter.
(get_tty_display, Fdisplay_name, Fdisplay_tty_type, Fdisplay_controlling_tty_p)
(Fdelete_display, Fdisplay_live_p): Update callers.
* src/xfns.c (check_x_display_info): Ditto.
* src/frame.c (Fmake_terminal_frame, Fframe_display): Ditto.
* src/dispextern.h (get_display): Update prototype.
* lisp/international/mule.el (set-terminal-coding-system)
(set-keyboard-coding-system): Add DISPLAY parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-338
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/international/mule-cmds.el | 13 | ||||
| -rw-r--r-- | lisp/international/mule.el | 26 | ||||
| -rw-r--r-- | lisp/term/lk201.el | 2 |
3 files changed, 27 insertions, 14 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index a91c12bcaf2..8af768f91cc 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2470,11 +2470,14 @@ See also `locale-charset-language-names', `locale-language-names', | |||
| 2470 | ;; Set the `keyboard-coding-system' if appropriate (tty | 2470 | ;; Set the `keyboard-coding-system' if appropriate (tty |
| 2471 | ;; only). At least X and MS Windows can generate | 2471 | ;; only). At least X and MS Windows can generate |
| 2472 | ;; multilingual input. | 2472 | ;; multilingual input. |
| 2473 | (unless window-system | 2473 | ;; XXX This was disabled unless `window-system', but that |
| 2474 | (let ((kcs (or coding-system | 2474 | ;; leads to buggy behaviour when a tty frame is opened |
| 2475 | (car (get-language-info language-name | 2475 | ;; later. Setting the keyboard coding system has no adverse |
| 2476 | 'coding-system))))) | 2476 | ;; effect on X, so let's do it anyway. -- Lorentey |
| 2477 | (if kcs (set-keyboard-coding-system kcs)))) | 2477 | (let ((kcs (or coding-system |
| 2478 | (car (get-language-info language-name | ||
| 2479 | 'coding-system))))) | ||
| 2480 | (if kcs (set-keyboard-coding-system kcs))) | ||
| 2478 | 2481 | ||
| 2479 | (setq locale-coding-system | 2482 | (setq locale-coding-system |
| 2480 | (car (get-language-info language-name 'coding-priority)))) | 2483 | (car (get-language-info language-name 'coding-priority)))) |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 49635652bb2..d86ce458bf4 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1199,13 +1199,17 @@ see) to CODING-SYSTEM." | |||
| 1199 | This is normally set according to the selected language environment. | 1199 | This is normally set according to the selected language environment. |
| 1200 | See also the command `set-terminal-coding-system'.") | 1200 | See also the command `set-terminal-coding-system'.") |
| 1201 | 1201 | ||
| 1202 | (defun set-terminal-coding-system (coding-system) | 1202 | (defun set-terminal-coding-system (coding-system &optional display) |
| 1203 | "Set coding system of your terminal to CODING-SYSTEM. | 1203 | "Set coding system of terminal output to CODING-SYSTEM. |
| 1204 | All text output to the terminal will be encoded | 1204 | All text output to DISPLAY will be encoded |
| 1205 | with the specified coding system. | 1205 | with the specified coding system. |
| 1206 | |||
| 1206 | For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. | 1207 | For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. |
| 1207 | The default is determined by the selected language environment | 1208 | The default is determined by the selected language environment |
| 1208 | or by the previous use of this command." | 1209 | or by the previous use of this command. |
| 1210 | |||
| 1211 | DISPLAY may be a display id, a frame, or nil for the selected frame's display. | ||
| 1212 | The setting has no effect on graphical displays." | ||
| 1209 | (interactive | 1213 | (interactive |
| 1210 | (list (let ((default (if (and (not (terminal-coding-system)) | 1214 | (list (let ((default (if (and (not (terminal-coding-system)) |
| 1211 | default-terminal-coding-system) | 1215 | default-terminal-coding-system) |
| @@ -1219,7 +1223,7 @@ or by the previous use of this command." | |||
| 1219 | (setq coding-system default-terminal-coding-system)) | 1223 | (setq coding-system default-terminal-coding-system)) |
| 1220 | (if coding-system | 1224 | (if coding-system |
| 1221 | (setq default-terminal-coding-system coding-system)) | 1225 | (setq default-terminal-coding-system coding-system)) |
| 1222 | (set-terminal-coding-system-internal coding-system) | 1226 | (set-terminal-coding-system-internal coding-system display) |
| 1223 | (redraw-frame (selected-frame))) | 1227 | (redraw-frame (selected-frame))) |
| 1224 | 1228 | ||
| 1225 | (defvar default-keyboard-coding-system nil | 1229 | (defvar default-keyboard-coding-system nil |
| @@ -1227,14 +1231,18 @@ or by the previous use of this command." | |||
| 1227 | This is normally set according to the selected language environment. | 1231 | This is normally set according to the selected language environment. |
| 1228 | See also the command `set-keyboard-coding-system'.") | 1232 | See also the command `set-keyboard-coding-system'.") |
| 1229 | 1233 | ||
| 1230 | (defun set-keyboard-coding-system (coding-system) | 1234 | (defun set-keyboard-coding-system (coding-system &optional display) |
| 1231 | "Set coding system for keyboard input to CODING-SYSTEM. | 1235 | "Set coding system for keyboard input on DISPLAY to CODING-SYSTEM. |
| 1232 | In addition, this command enables Encoded-kbd minor mode. | 1236 | In addition, this command enables Encoded-kbd minor mode. |
| 1233 | \(If CODING-SYSTEM is nil, Encoded-kbd mode is turned off -- see | 1237 | \(If CODING-SYSTEM is nil, Encoded-kbd mode is turned off -- see |
| 1234 | `encoded-kbd-mode'.) | 1238 | `encoded-kbd-mode'.) |
| 1239 | |||
| 1235 | For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. | 1240 | For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. |
| 1236 | The default is determined by the selected language environment | 1241 | The default is determined by the selected language environment |
| 1237 | or by the previous use of this command." | 1242 | or by the previous use of this command. |
| 1243 | |||
| 1244 | DISPLAY may be a display id, a frame, or nil for the selected frame's display. | ||
| 1245 | The setting has no effect on graphical displays." | ||
| 1238 | (interactive | 1246 | (interactive |
| 1239 | (list (let ((default (if (and (not (keyboard-coding-system)) | 1247 | (list (let ((default (if (and (not (keyboard-coding-system)) |
| 1240 | default-keyboard-coding-system) | 1248 | default-keyboard-coding-system) |
| @@ -1248,7 +1256,7 @@ or by the previous use of this command." | |||
| 1248 | (setq coding-system default-keyboard-coding-system)) | 1256 | (setq coding-system default-keyboard-coding-system)) |
| 1249 | (if coding-system | 1257 | (if coding-system |
| 1250 | (setq default-keyboard-coding-system coding-system)) | 1258 | (setq default-keyboard-coding-system coding-system)) |
| 1251 | (set-keyboard-coding-system-internal coding-system) | 1259 | (set-keyboard-coding-system-internal coding-system display) |
| 1252 | (setq keyboard-coding-system coding-system) | 1260 | (setq keyboard-coding-system coding-system) |
| 1253 | (encoded-kbd-mode (if coding-system 1 0))) | 1261 | (encoded-kbd-mode (if coding-system 1 0))) |
| 1254 | 1262 | ||
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 1f8d9ca77a3..b207e13b0a5 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | ;; -*- no-byte-compile: t -*- | 1 | ;; -*- no-byte-compile: t -*- |
| 2 | ;; Define function key sequences for DEC terminals. | 2 | ;; Define function key sequences for DEC terminals. |
| 3 | 3 | ||
| 4 | ;; XXX We need to find a way to have these define-keys be display-local. -- Lorentey | ||
| 5 | |||
| 4 | ;; Termcap or terminfo should set these. | 6 | ;; Termcap or terminfo should set these. |
| 5 | ;; (define-key function-key-map "\e[A" [up]) | 7 | ;; (define-key function-key-map "\e[A" [up]) |
| 6 | ;; (define-key function-key-map "\e[B" [down]) | 8 | ;; (define-key function-key-map "\e[B" [down]) |