diff options
| author | Miles Bader | 2007-10-11 16:24:58 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-10-11 16:24:58 +0000 |
| commit | c73bd236f75b742ad4642ec94798987ae6e3e1e8 (patch) | |
| tree | ef5edc8db557fc1d25a17c379e4ae63a38b3ba5c /src/coding.c | |
| parent | ecb21060d5c1752d41d7a742be565c59b5fcb855 (diff) | |
| parent | 58ade22bf16a9ec2ff0aee6c59d8db4d1703e94f (diff) | |
| download | emacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.tar.gz emacs-c73bd236f75b742ad4642ec94798987ae6e3e1e8.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 866-879)
- Merge multi-tty branch
- Update from CVS
- Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/coding.c b/src/coding.c index 20c6c000c7d..8ab5a1107aa 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -300,6 +300,8 @@ encode_coding_XXX (coding) | |||
| 300 | #include "composite.h" | 300 | #include "composite.h" |
| 301 | #include "coding.h" | 301 | #include "coding.h" |
| 302 | #include "window.h" | 302 | #include "window.h" |
| 303 | #include "frame.h" | ||
| 304 | #include "termhooks.h" | ||
| 303 | 305 | ||
| 304 | Lisp_Object Vcoding_system_hash_table; | 306 | Lisp_Object Vcoding_system_hash_table; |
| 305 | 307 | ||
| @@ -381,15 +383,12 @@ int inhibit_iso_escape_detection; | |||
| 381 | /* Flag to make buffer-file-coding-system inherit from process-coding. */ | 383 | /* Flag to make buffer-file-coding-system inherit from process-coding. */ |
| 382 | int inherit_process_coding_system; | 384 | int inherit_process_coding_system; |
| 383 | 385 | ||
| 384 | /* Coding system to be used to encode text for terminal display. */ | ||
| 385 | struct coding_system terminal_coding; | ||
| 386 | |||
| 387 | /* Coding system to be used to encode text for terminal display when | 386 | /* Coding system to be used to encode text for terminal display when |
| 388 | terminal coding system is nil. */ | 387 | terminal coding system is nil. */ |
| 389 | struct coding_system safe_terminal_coding; | 388 | struct coding_system safe_terminal_coding; |
| 390 | 389 | ||
| 391 | /* Coding system of what is sent from terminal keyboard. */ | 390 | /* Default coding system to be used to write a file. */ |
| 392 | struct coding_system keyboard_coding; | 391 | struct coding_system default_buffer_file_coding; |
| 393 | 392 | ||
| 394 | Lisp_Object Vfile_coding_system_alist; | 393 | Lisp_Object Vfile_coding_system_alist; |
| 395 | Lisp_Object Vprocess_coding_system_alist; | 394 | Lisp_Object Vprocess_coding_system_alist; |
| @@ -8286,23 +8285,22 @@ Return the corresponding character code in Big5. */) | |||
| 8286 | } | 8285 | } |
| 8287 | 8286 | ||
| 8288 | 8287 | ||
| 8289 | DEFUN ("set-terminal-coding-system-internal", | 8288 | DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal, |
| 8290 | Fset_terminal_coding_system_internal, | 8289 | Sset_terminal_coding_system_internal, 1, 2, 0, |
| 8291 | Sset_terminal_coding_system_internal, 1, 1, 0, | ||
| 8292 | doc: /* Internal use only. */) | 8290 | doc: /* Internal use only. */) |
| 8293 | (coding_system) | 8291 | (coding_system, terminal) |
| 8294 | Lisp_Object coding_system; | 8292 | Lisp_Object coding_system; |
| 8293 | Lisp_Object terminal; | ||
| 8295 | { | 8294 | { |
| 8295 | struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); | ||
| 8296 | CHECK_SYMBOL (coding_system); | 8296 | CHECK_SYMBOL (coding_system); |
| 8297 | setup_coding_system (Fcheck_coding_system (coding_system), | 8297 | setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); |
| 8298 | &terminal_coding); | ||
| 8299 | |||
| 8300 | /* We had better not send unsafe characters to terminal. */ | 8298 | /* We had better not send unsafe characters to terminal. */ |
| 8301 | terminal_coding.mode |= CODING_MODE_SAFE_ENCODING; | 8299 | terminal_coding->mode |= CODING_MODE_SAFE_ENCODING; |
| 8302 | /* Characer composition should be disabled. */ | 8300 | /* Characer composition should be disabled. */ |
| 8303 | terminal_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; | 8301 | terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; |
| 8304 | terminal_coding.src_multibyte = 1; | 8302 | terminal_coding->src_multibyte = 1; |
| 8305 | terminal_coding.dst_multibyte = 0; | 8303 | terminal_coding->dst_multibyte = 0; |
| 8306 | return Qnil; | 8304 | return Qnil; |
| 8307 | } | 8305 | } |
| 8308 | 8306 | ||
| @@ -8323,30 +8321,35 @@ DEFUN ("set-safe-terminal-coding-system-internal", | |||
| 8323 | return Qnil; | 8321 | return Qnil; |
| 8324 | } | 8322 | } |
| 8325 | 8323 | ||
| 8326 | DEFUN ("terminal-coding-system", | 8324 | DEFUN ("terminal-coding-system", Fterminal_coding_system, |
| 8327 | Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0, | 8325 | Sterminal_coding_system, 0, 1, 0, |
| 8328 | doc: /* Return coding system specified for terminal output. */) | 8326 | doc: /* Return coding system specified for terminal output on the given terminal. |
| 8329 | () | 8327 | TERMINAL may be a terminal id, a frame, or nil for the selected |
| 8328 | frame's terminal device. */) | ||
| 8329 | (terminal) | ||
| 8330 | Lisp_Object terminal; | ||
| 8330 | { | 8331 | { |
| 8331 | Lisp_Object coding_system; | 8332 | Lisp_Object coding_system; |
| 8332 | 8333 | ||
| 8333 | coding_system = CODING_ID_NAME (terminal_coding.id); | 8334 | coding_system = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol; |
| 8334 | /* For backward compatibility, return nil if it is `undecided'. */ | 8335 | /* For backward compatibility, return nil if it is `undecided'. */ |
| 8335 | return (! EQ (coding_system, Qundecided) ? coding_system : Qnil); | 8336 | return (! EQ (coding_system, Qundecided) ? coding_system : Qnil); |
| 8336 | } | 8337 | } |
| 8337 | 8338 | ||
| 8338 | DEFUN ("set-keyboard-coding-system-internal", | 8339 | DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal, |
| 8339 | Fset_keyboard_coding_system_internal, | 8340 | Sset_keyboard_coding_system_internal, 1, 2, 0, |
| 8340 | Sset_keyboard_coding_system_internal, 1, 1, 0, | ||
| 8341 | doc: /* Internal use only. */) | 8341 | doc: /* Internal use only. */) |
| 8342 | (coding_system) | 8342 | (coding_system, terminal) |
| 8343 | Lisp_Object coding_system; | 8343 | Lisp_Object coding_system; |
| 8344 | Lisp_Object terminal; | ||
| 8344 | { | 8345 | { |
| 8346 | struct terminal *t = get_terminal (terminal, 1); | ||
| 8345 | CHECK_SYMBOL (coding_system); | 8347 | CHECK_SYMBOL (coding_system); |
| 8346 | setup_coding_system (Fcheck_coding_system (coding_system), | 8348 | setup_coding_system (Fcheck_coding_system (coding_system), |
| 8347 | &keyboard_coding); | 8349 | TERMINAL_KEYBOARD_CODING (t)); |
| 8348 | /* Characer composition should be disabled. */ | 8350 | /* Characer composition should be disabled. */ |
| 8349 | keyboard_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; | 8351 | TERMINAL_KEYBOARD_CODING (t)->common_flags |
| 8352 | &= ~CODING_ANNOTATE_COMPOSITION_MASK; | ||
| 8350 | return Qnil; | 8353 | return Qnil; |
| 8351 | } | 8354 | } |
| 8352 | 8355 | ||