diff options
| author | Eli Zaretskii | 2011-02-18 16:48:28 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-02-18 16:48:28 +0200 |
| commit | d6de49a103fd814420f0a5dd2cc9d8136f60eb44 (patch) | |
| tree | fa0a25f0c84b394c9221673b77af747da36d0e79 | |
| parent | 135dee5572ab4908ac313430392184daca883445 (diff) | |
| download | emacs-d6de49a103fd814420f0a5dd2cc9d8136f60eb44.tar.gz emacs-d6de49a103fd814420f0a5dd2cc9d8136f60eb44.zip | |
Fix bug #7840 with default terminal and keyboard encodings.
terminal.c (create_terminal): Use default-keyboard-coding-system
and default-terminal-coding-system to initialize coding systems of
the new terminal.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/terminal.c | 21 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9fbc83f6c0c..767cf386ee8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-02-18 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * terminal.c (create_terminal): Use default-keyboard-coding-system | ||
| 4 | and default-terminal-coding-system to initialize coding systems of | ||
| 5 | the new terminal. (Bug#7840) | ||
| 6 | |||
| 1 | 2011-02-18 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2011-02-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * lisp.h (BYTE_MARK_STACK): New macro. | 9 | * lisp.h (BYTE_MARK_STACK): New macro. |
diff --git a/src/terminal.c b/src/terminal.c index 09c57bc2b0c..309cc0095e8 100644 --- a/src/terminal.c +++ b/src/terminal.c | |||
| @@ -223,6 +223,7 @@ struct terminal * | |||
| 223 | create_terminal (void) | 223 | create_terminal (void) |
| 224 | { | 224 | { |
| 225 | struct terminal *terminal = allocate_terminal (); | 225 | struct terminal *terminal = allocate_terminal (); |
| 226 | Lisp_Object terminal_coding, keyboard_coding; | ||
| 226 | 227 | ||
| 227 | terminal->name = NULL; | 228 | terminal->name = NULL; |
| 228 | terminal->next_terminal = terminal_list; | 229 | terminal->next_terminal = terminal_list; |
| @@ -235,8 +236,24 @@ create_terminal (void) | |||
| 235 | terminal->terminal_coding = | 236 | terminal->terminal_coding = |
| 236 | (struct coding_system *) xmalloc (sizeof (struct coding_system)); | 237 | (struct coding_system *) xmalloc (sizeof (struct coding_system)); |
| 237 | 238 | ||
| 238 | setup_coding_system (Qno_conversion, terminal->keyboard_coding); | 239 | /* If default coding systems for the terminal and the keyboard are |
| 239 | setup_coding_system (Qundecided, terminal->terminal_coding); | 240 | already defined, use them in preference to the defaults. This is |
| 241 | needed when Emacs runs in daemon mode. */ | ||
| 242 | keyboard_coding = | ||
| 243 | find_symbol_value (intern ("default-keyboard-coding-system")); | ||
| 244 | if (NILP (keyboard_coding) | ||
| 245 | || EQ (keyboard_coding, Qunbound) | ||
| 246 | || NILP (Fcoding_system_p (keyboard_coding))) | ||
| 247 | keyboard_coding = Qno_conversion; | ||
| 248 | terminal_coding = | ||
| 249 | find_symbol_value (intern ("default-terminal-coding-system")); | ||
| 250 | if (NILP (terminal_coding) | ||
| 251 | || EQ (terminal_coding, Qunbound) | ||
| 252 | || NILP (Fcoding_system_p (terminal_coding))) | ||
| 253 | terminal_coding = Qundecided; | ||
| 254 | |||
| 255 | setup_coding_system (keyboard_coding, terminal->keyboard_coding); | ||
| 256 | setup_coding_system (terminal_coding, terminal->terminal_coding); | ||
| 240 | 257 | ||
| 241 | terminal->param_alist = Qnil; | 258 | terminal->param_alist = Qnil; |
| 242 | return terminal; | 259 | return terminal; |