Mercurial > hg > xemacs-beta
comparison src/console-tty.c @ 3571:f6cd5fe9bf4c
[xemacs-hg @ 2006-08-24 21:21:34 by aidan]
Vary support for multiple-width characters on a per-console basis.
author | aidan |
---|---|
date | Thu, 24 Aug 2006 21:21:36 +0000 |
parents | 141c2920ea48 |
children | 229bd619740a |
comparison
equal
deleted
inserted
replaced
3570:1ebada1a4643 | 3571:f6cd5fe9bf4c |
---|---|
156 get_coding_system_for_text_file (Qterminal, 0), | 156 get_coding_system_for_text_file (Qterminal, 0), |
157 CODING_ENCODE, 0); | 157 CODING_ENCODE, 0); |
158 tty_con->terminal_type = terminal_type; | 158 tty_con->terminal_type = terminal_type; |
159 tty_con->controlling_process = controlling_process; | 159 tty_con->controlling_process = controlling_process; |
160 | 160 |
161 /* Defaults to 1 with Mule, 0 without. In the latter case the attribute is | |
162 read-only from Lisp. */ | |
163 tty_con->multiple_width = CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c); | |
164 | |
161 if (NILP (CONSOLE_NAME (con))) | 165 if (NILP (CONSOLE_NAME (con))) |
162 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); | 166 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty); |
163 { | 167 { |
164 pid_t tty_pg; | 168 pid_t tty_pg; |
165 pid_t controlling_tty_pg; | 169 pid_t controlling_tty_pg; |
317 /* Redraw tty */ | 321 /* Redraw tty */ |
318 face_property_was_changed (Vdefault_face, Qfont, Qtty); | 322 face_property_was_changed (Vdefault_face, Qfont, Qtty); |
319 return Qnil; | 323 return Qnil; |
320 } | 324 } |
321 | 325 |
326 DEFUN ("console-tty-multiple-width", Fconsole_tty_multiple_width, | |
327 0, 1, 0, /* | |
328 Return whether CONSOLE treats East Asian double-width chars as such. | |
329 | |
330 CONSOLE defaults to the selected console. Without XEmacs support for | |
331 double-width characters, this always gives nil. | |
332 */ | |
333 (console)) | |
334 { | |
335 return CONSOLE_TTY_MULTIPLE_WIDTH (decode_tty_console(console)) | |
336 ? Qt : Qnil; | |
337 } | |
338 | |
339 DEFUN ("set-console-tty-multiple-width", Fset_console_tty_multiple_width, | |
340 0, 2, 0, /* | |
341 Set whether CONSOLE treats East Asian double-width characters as such. | |
342 | |
343 CONSOLE defaults to the selected console, and VALUE defaults to nil. | |
344 Without XEmacs support for double-width characters, this throws an error if | |
345 VALUE is non-nil. | |
346 */ | |
347 (console, value)) | |
348 { | |
349 struct console *c = decode_tty_console (console); | |
350 | |
351 /* So people outside of East Asia can put (set-console-tty-multiple-width | |
352 (selected-console) nil) in their init files, independent of whether | |
353 Mule is enabled. */ | |
354 if (!CONSOLE_TTY_MULTIPLE_WIDTH (c) && NILP(value)) | |
355 { | |
356 return Qnil; | |
357 } | |
358 | |
359 if (!CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH (c)) | |
360 { | |
361 invalid_change | |
362 ("No console support for double-width chars", | |
363 Fmake_symbol(CONSOLE_NAME(c))); | |
364 } | |
365 | |
366 CONSOLE_TTY_DATA(c)->multiple_width = NILP(value) ? 0 : 1; | |
367 | |
368 return Qnil; | |
369 } | |
370 | |
322 /* #### Move this function to lisp */ | 371 /* #### Move this function to lisp */ |
323 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, | 372 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system, |
324 0, 2, 0, /* | 373 0, 2, 0, /* |
325 Set the input and output coding systems of tty console CONSOLE to CODESYS. | 374 Set the input and output coding systems of tty console CONSOLE to CODESYS. |
326 CONSOLE defaults to the selected console. | 375 CONSOLE defaults to the selected console. |
429 DEFSUBR (Fconsole_tty_output_coding_system); | 478 DEFSUBR (Fconsole_tty_output_coding_system); |
430 DEFSUBR (Fset_console_tty_output_coding_system); | 479 DEFSUBR (Fset_console_tty_output_coding_system); |
431 DEFSUBR (Fconsole_tty_input_coding_system); | 480 DEFSUBR (Fconsole_tty_input_coding_system); |
432 DEFSUBR (Fset_console_tty_input_coding_system); | 481 DEFSUBR (Fset_console_tty_input_coding_system); |
433 DEFSUBR (Fset_console_tty_coding_system); | 482 DEFSUBR (Fset_console_tty_coding_system); |
483 DEFSUBR (Fconsole_tty_multiple_width); | |
484 DEFSUBR (Fset_console_tty_multiple_width); | |
434 } | 485 } |
435 | 486 |
436 void | 487 void |
437 console_type_create_tty (void) | 488 console_type_create_tty (void) |
438 { | 489 { |