diff options
| author | Karoly Lorentey | 2004-05-23 01:53:23 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-05-23 01:53:23 +0000 |
| commit | b8299c66e3307372c1d5021cf420493db5d501b4 (patch) | |
| tree | 4a1ee9727448df082b851b8cbcec72efa64d6fdf /src/coding.c | |
| parent | 04a0dc45e1e3833a3a97e45f2b20197c8bec744a (diff) | |
| download | emacs-b8299c66e3307372c1d5021cf420493db5d501b4.tar.gz emacs-b8299c66e3307372c1d5021cf420493db5d501b4.zip | |
Make terminal_coding and keyboard_coding display-local.
src/coding.c: Include frame.h and termhooks.h.
(terminal_coding, keyboard_coding): Remove.
(Fset_terminal_coding_system_internal, Fterminal_coding_system):
Use the selected frame's terminal coding system.
(Fset_safe_terminal_coding_system_internal): Fix typo.
(Fset_keyboard_coding_system_internal, Fkeyboard_coding_system):
Use the selected frame's keyboard coding system.
(init_coding_once): Don't initialize keyboard_coding and terminal_coding.
src/coding.h (terminal_coding, keyboard_coding): Remove.
src/termhooks.h (terminal_coding, keyboard_coding): New members of
struct display.
(FRAME_TERMINAL_CODING, FRAME_KEYBOARD_CODING): New macros.
src/termchar.h (kboard): Cosmetic change.
src/term.c (encode_terminal_code): Add coding parameter.
(tty_write_glyphs): Use the display-local terminal coding system.
(create_display): Allocate and initialize coding systems.
(delete_display): Free coding systems.
src/xdisp.c (decode_mode_spec): Use display-local coding systems.
src/Makefile.in: Fix dependencies for termchar.h and termhooks.h.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-167
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/coding.c b/src/coding.c index 76ef3026a2d..7e90b985143 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -346,6 +346,8 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) | |||
| 346 | #include "coding.h" | 346 | #include "coding.h" |
| 347 | #include "window.h" | 347 | #include "window.h" |
| 348 | #include "intervals.h" | 348 | #include "intervals.h" |
| 349 | #include "frame.h" | ||
| 350 | #include "termhooks.h" | ||
| 349 | 351 | ||
| 350 | #else /* not emacs */ | 352 | #else /* not emacs */ |
| 351 | 353 | ||
| @@ -428,16 +430,10 @@ int inhibit_iso_escape_detection; | |||
| 428 | /* Flag to make buffer-file-coding-system inherit from process-coding. */ | 430 | /* Flag to make buffer-file-coding-system inherit from process-coding. */ |
| 429 | int inherit_process_coding_system; | 431 | int inherit_process_coding_system; |
| 430 | 432 | ||
| 431 | /* Coding system to be used to encode text for terminal display. */ | ||
| 432 | struct coding_system terminal_coding; | ||
| 433 | |||
| 434 | /* Coding system to be used to encode text for terminal display when | 433 | /* Coding system to be used to encode text for terminal display when |
| 435 | terminal coding system is nil. */ | 434 | terminal coding system is nil. */ |
| 436 | struct coding_system safe_terminal_coding; | 435 | struct coding_system safe_terminal_coding; |
| 437 | 436 | ||
| 438 | /* Coding system of what is sent from terminal keyboard. */ | ||
| 439 | struct coding_system keyboard_coding; | ||
| 440 | |||
| 441 | /* Default coding system to be used to write a file. */ | 437 | /* Default coding system to be used to write a file. */ |
| 442 | struct coding_system default_buffer_file_coding; | 438 | struct coding_system default_buffer_file_coding; |
| 443 | 439 | ||
| @@ -7184,16 +7180,17 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern | |||
| 7184 | (coding_system) | 7180 | (coding_system) |
| 7185 | Lisp_Object coding_system; | 7181 | Lisp_Object coding_system; |
| 7186 | { | 7182 | { |
| 7183 | struct coding_system *terminal_coding = FRAME_TERMINAL_CODING (SELECTED_FRAME ()); | ||
| 7187 | CHECK_SYMBOL (coding_system); | 7184 | CHECK_SYMBOL (coding_system); |
| 7188 | setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); | 7185 | setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); |
| 7189 | /* We had better not send unsafe characters to terminal. */ | 7186 | /* We had better not send unsafe characters to terminal. */ |
| 7190 | terminal_coding.mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR; | 7187 | terminal_coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR; |
| 7191 | /* Character composition should be disabled. */ | 7188 | /* Character composition should be disabled. */ |
| 7192 | terminal_coding.composing = COMPOSITION_DISABLED; | 7189 | terminal_coding->composing = COMPOSITION_DISABLED; |
| 7193 | /* Error notification should be suppressed. */ | 7190 | /* Error notification should be suppressed. */ |
| 7194 | terminal_coding.suppress_error = 1; | 7191 | terminal_coding->suppress_error = 1; |
| 7195 | terminal_coding.src_multibyte = 1; | 7192 | terminal_coding->src_multibyte = 1; |
| 7196 | terminal_coding.dst_multibyte = 0; | 7193 | terminal_coding->dst_multibyte = 0; |
| 7197 | return Qnil; | 7194 | return Qnil; |
| 7198 | } | 7195 | } |
| 7199 | 7196 | ||
| @@ -7209,7 +7206,7 @@ DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_sys | |||
| 7209 | /* Character composition should be disabled. */ | 7206 | /* Character composition should be disabled. */ |
| 7210 | safe_terminal_coding.composing = COMPOSITION_DISABLED; | 7207 | safe_terminal_coding.composing = COMPOSITION_DISABLED; |
| 7211 | /* Error notification should be suppressed. */ | 7208 | /* Error notification should be suppressed. */ |
| 7212 | terminal_coding.suppress_error = 1; | 7209 | safe_terminal_coding.suppress_error = 1; |
| 7213 | safe_terminal_coding.src_multibyte = 1; | 7210 | safe_terminal_coding.src_multibyte = 1; |
| 7214 | safe_terminal_coding.dst_multibyte = 0; | 7211 | safe_terminal_coding.dst_multibyte = 0; |
| 7215 | return Qnil; | 7212 | return Qnil; |
| @@ -7220,7 +7217,7 @@ DEFUN ("terminal-coding-system", Fterminal_coding_system, | |||
| 7220 | doc: /* Return coding system specified for terminal output. */) | 7217 | doc: /* Return coding system specified for terminal output. */) |
| 7221 | () | 7218 | () |
| 7222 | { | 7219 | { |
| 7223 | return terminal_coding.symbol; | 7220 | return FRAME_TERMINAL_CODING (SELECTED_FRAME ())->symbol; |
| 7224 | } | 7221 | } |
| 7225 | 7222 | ||
| 7226 | DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, | 7223 | DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, |
| @@ -7230,9 +7227,10 @@ DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_intern | |||
| 7230 | Lisp_Object coding_system; | 7227 | Lisp_Object coding_system; |
| 7231 | { | 7228 | { |
| 7232 | CHECK_SYMBOL (coding_system); | 7229 | CHECK_SYMBOL (coding_system); |
| 7233 | setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); | 7230 | setup_coding_system (Fcheck_coding_system (coding_system), |
| 7231 | FRAME_KEYBOARD_CODING (SELECTED_FRAME ())); | ||
| 7234 | /* Character composition should be disabled. */ | 7232 | /* Character composition should be disabled. */ |
| 7235 | keyboard_coding.composing = COMPOSITION_DISABLED; | 7233 | FRAME_KEYBOARD_CODING (SELECTED_FRAME ())->composing = COMPOSITION_DISABLED; |
| 7236 | return Qnil; | 7234 | return Qnil; |
| 7237 | } | 7235 | } |
| 7238 | 7236 | ||
| @@ -7241,7 +7239,7 @@ DEFUN ("keyboard-coding-system", Fkeyboard_coding_system, | |||
| 7241 | doc: /* Return coding system specified for decoding keyboard input. */) | 7239 | doc: /* Return coding system specified for decoding keyboard input. */) |
| 7242 | () | 7240 | () |
| 7243 | { | 7241 | { |
| 7244 | return keyboard_coding.symbol; | 7242 | return FRAME_KEYBOARD_CODING (SELECTED_FRAME ())->symbol; |
| 7245 | } | 7243 | } |
| 7246 | 7244 | ||
| 7247 | 7245 | ||
| @@ -7488,8 +7486,6 @@ init_coding_once () | |||
| 7488 | iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3; | 7486 | iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3; |
| 7489 | iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer; | 7487 | iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer; |
| 7490 | 7488 | ||
| 7491 | setup_coding_system (Qnil, &keyboard_coding); | ||
| 7492 | setup_coding_system (Qnil, &terminal_coding); | ||
| 7493 | setup_coding_system (Qnil, &safe_terminal_coding); | 7489 | setup_coding_system (Qnil, &safe_terminal_coding); |
| 7494 | setup_coding_system (Qnil, &default_buffer_file_coding); | 7490 | setup_coding_system (Qnil, &default_buffer_file_coding); |
| 7495 | 7491 | ||