Mercurial > emacs
comparison src/coding.c @ 83298:ed09a89e2b25
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
| author | Karoly Lorentey <lorentey@elte.hu> |
|---|---|
| date | Tue, 03 May 2005 01:49:33 +0000 |
| parents | ad07ff6e4555 |
| children | e58cb448e07c |
comparison
equal
deleted
inserted
replaced
| 83297:8e357d90cc9f | 83298:ed09a89e2b25 |
|---|---|
| 7303 error ("Can't encode to Big5: %d", XFASTINT (ch)); | 7303 error ("Can't encode to Big5: %d", XFASTINT (ch)); |
| 7304 return val; | 7304 return val; |
| 7305 } | 7305 } |
| 7306 | 7306 |
| 7307 DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal, | 7307 DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal, |
| 7308 Sset_terminal_coding_system_internal, 1, 1, 0, | 7308 Sset_terminal_coding_system_internal, 1, 2, 0, |
| 7309 doc: /* Internal use only. */) | 7309 doc: /* Internal use only. */) |
| 7310 (coding_system) | 7310 (coding_system, display) |
| 7311 Lisp_Object coding_system; | 7311 Lisp_Object coding_system; |
| 7312 { | 7312 Lisp_Object display; |
| 7313 struct coding_system *terminal_coding = FRAME_TERMINAL_CODING (SELECTED_FRAME ()); | 7313 { |
| 7314 struct coding_system *terminal_coding = DISPLAY_TERMINAL_CODING (get_display (display, 1)); | |
| 7314 CHECK_SYMBOL (coding_system); | 7315 CHECK_SYMBOL (coding_system); |
| 7315 setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); | 7316 setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); |
| 7316 /* We had better not send unsafe characters to terminal. */ | 7317 /* We had better not send unsafe characters to terminal. */ |
| 7317 terminal_coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR; | 7318 terminal_coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR; |
| 7318 /* Character composition should be disabled. */ | 7319 /* Character composition should be disabled. */ |
| 7341 safe_terminal_coding.dst_multibyte = 0; | 7342 safe_terminal_coding.dst_multibyte = 0; |
| 7342 return Qnil; | 7343 return Qnil; |
| 7343 } | 7344 } |
| 7344 | 7345 |
| 7345 DEFUN ("terminal-coding-system", Fterminal_coding_system, | 7346 DEFUN ("terminal-coding-system", Fterminal_coding_system, |
| 7346 Sterminal_coding_system, 0, 0, 0, | 7347 Sterminal_coding_system, 0, 1, 0, |
| 7347 doc: /* Return coding system specified for terminal output. */) | 7348 doc: /* Return coding system specified for terminal output on the given display. |
| 7348 () | 7349 DISPLAY may be a display id, a frame, or nil for the selected frame's display. */) |
| 7349 { | 7350 (display) |
| 7350 return FRAME_TERMINAL_CODING (SELECTED_FRAME ())->symbol; | 7351 Lisp_Object display; |
| 7352 { | |
| 7353 return DISPLAY_TERMINAL_CODING (get_display (display, 1))->symbol; | |
| 7351 } | 7354 } |
| 7352 | 7355 |
| 7353 DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, | 7356 DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, |
| 7354 Sset_keyboard_coding_system_internal, 1, 1, 0, | 7357 Sset_keyboard_coding_system_internal, 1, 2, 0, |
| 7355 doc: /* Internal use only. */) | 7358 doc: /* Internal use only. */) |
| 7356 (coding_system) | 7359 (coding_system, display) |
| 7357 Lisp_Object coding_system; | 7360 Lisp_Object coding_system; |
| 7358 { | 7361 Lisp_Object display; |
| 7362 { | |
| 7363 struct display *d = get_display (display, 1); | |
| 7359 CHECK_SYMBOL (coding_system); | 7364 CHECK_SYMBOL (coding_system); |
| 7365 | |
| 7360 setup_coding_system (Fcheck_coding_system (coding_system), | 7366 setup_coding_system (Fcheck_coding_system (coding_system), |
| 7361 FRAME_KEYBOARD_CODING (SELECTED_FRAME ())); | 7367 DISPLAY_KEYBOARD_CODING (d)); |
| 7362 /* Character composition should be disabled. */ | 7368 /* Character composition should be disabled. */ |
| 7363 FRAME_KEYBOARD_CODING (SELECTED_FRAME ())->composing = COMPOSITION_DISABLED; | 7369 DISPLAY_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED; |
| 7364 return Qnil; | 7370 return Qnil; |
| 7365 } | 7371 } |
| 7366 | 7372 |
| 7367 DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, | 7373 DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, |
| 7368 Skeyboard_coding_system, 0, 0, 0, | 7374 Skeyboard_coding_system, 0, 1, 0, |
| 7369 doc: /* Return coding system specified for decoding keyboard input. */) | 7375 doc: /* Return coding system specified for decoding keyboard input. */) |
| 7370 () | 7376 (display) |
| 7371 { | 7377 Lisp_Object display; |
| 7372 return FRAME_KEYBOARD_CODING (SELECTED_FRAME ())->symbol; | 7378 { |
| 7379 return DISPLAY_KEYBOARD_CODING (get_display (display, 1))->symbol; | |
| 7373 } | 7380 } |
| 7374 | 7381 |
| 7375 | 7382 |
| 7376 DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, | 7383 DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, |
| 7377 Sfind_operation_coding_system, 1, MANY, 0, | 7384 Sfind_operation_coding_system, 1, MANY, 0, |
