annotate src/console-tty.c @ 5139:a48ef26d87ee

Clean up prototypes for Lisp variables/symbols. Put decls for them with the other stuff related to the file they're in. In the process, fix a few places with incorrect initialization of symbols and variables. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-03-12 Ben Wing <ben@xemacs.org> * lisp.h: * lisp.h (redo-symbols): Removed. Put the Lisp variables and symbols where they belong, with other stuff related to the file they're in. * event-Xt.c (THIS_IS_X): * event-Xt.c (syms_of_event_Xt): * event-Xt.c (reinit_vars_of_event_Xt): * event-gtk.c: * event-gtk.c (syms_of_event_gtk): * event-gtk.c (reinit_vars_of_event_gtk): * event-stream.c: * event-stream.c (syms_of_event_stream): * event-stream.c (reinit_vars_of_event_stream): * events.c (reinit_vars_of_events): * events.c (vars_of_events): `sans-modifiers' was defsymbol'ed more than once. Move it to events-stream.c. `self-insert-command' was defsymbol'ed more than once. Vevent_resource should be staticpro_nodump()ed as it's declared in a reinit_*() method. * lread.c (vars_of_lread): Vfile_domain wasn't staticpro'ed. * minibuf.c: * minibuf.c (reinit_complex_vars_of_minibuf): Vminibuffer_zero and Vecho_area_buffer weren't staticpro'ed.
author Ben Wing <ben@xemacs.org>
date Fri, 12 Mar 2010 20:23:50 -0600
parents 16112448d484
children b5df3737028a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* TTY console functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
4 Copyright (C) 1996, 2001, 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 /* Authors: Ben Wing and Chuck Thompson. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
30 #include "console-tty-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #include "console-stream.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
32
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
33 #include "elhash.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "faces.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
35 #include "file-coding.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include "frame.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
37 #include "glyphs.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #include "lstream.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
39 #include "process.h"
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
40
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #include "sysdep.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 #include "sysfile.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 DEFINE_CONSOLE_TYPE (tty);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 DECLARE_IMAGE_INSTANTIATOR_FORMAT (string);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 Lisp_Object Qterminal_type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 Lisp_Object Qcontrolling_process;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
53 Lisp_Object Vtty_seen_characters;
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
54
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
55 static const struct memory_description tty_console_data_description_1 [] = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
56 { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
59 { XD_END }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
60 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
61
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
62 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
63 DEFINE_LRECORD_IMPLEMENTATION ("tty-console", tty_console,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
64 1, /*dumpable-flag*/
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
65 0, 0, 0, 0, 0,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
66 tty_console_data_description_1,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
67 Lisp_Tty_Console);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
68 #else /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
69 const struct sized_memory_description tty_console_data_description = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
70 sizeof (struct tty_console), tty_console_data_description_1
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
71 };
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
72 #endif /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 872
diff changeset
73
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 allocate_tty_console_struct (struct console *con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 /* zero out all slots except the lisp ones ... */
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
79 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
80 CONSOLE_TTY_DATA (con) = alloc_lrecord_type (struct tty_console,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
81 &lrecord_tty_console);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
82 #else /* not NEW_GC */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
84 #endif /* not NEW_GC */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 CONSOLE_TTY_DATA (con)->terminal_type = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 CONSOLE_TTY_DATA (con)->instream = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 CONSOLE_TTY_DATA (con)->outstream = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 tty_init_console (struct console *con, Lisp_Object props)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 Lisp_Object tty = CONSOLE_CONNECTION (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 Lisp_Object terminal_type = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 Lisp_Object controlling_process = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 struct tty_console *tty_con;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 struct gcpro gcpro1, gcpro2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 GCPRO2 (terminal_type, controlling_process);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 terminal_type = Fplist_get (props, Qterminal_type, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 controlling_process = Fplist_get (props, Qcontrolling_process, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 /* Determine the terminal type */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 if (!NILP (terminal_type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 CHECK_STRING (terminal_type);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 {
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 814
diff changeset
110 Ibyte *temp_type = egetenv ("TERM");
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 if (!temp_type)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
114 invalid_state ("Cannot determine terminal type", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 else
4953
304aebb79cd3 function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents: 4117
diff changeset
117 terminal_type = build_istring (temp_type);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 /* Determine the controlling process */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 if (!NILP (controlling_process))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 CHECK_INT (controlling_process);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 /* Open the specified console */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 allocate_tty_console_struct (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 tty_con = CONSOLE_TTY_DATA (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 if (internal_equal (tty, Vstdio_str, 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 tty_con->infd = fileno (stdin);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 tty_con->outfd = fileno (stdout);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 tty_con->is_stdio = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 tty_con->infd = tty_con->outfd =
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
138 qxe_open (XSTRING_DATA (tty), O_RDWR);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 if (tty_con->infd < 0)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
140 signal_error (Qio_error, "Unable to open tty", tty);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 tty_con->is_stdio = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
802
19dfb459d51a [xemacs-hg @ 2002-04-03 10:47:37 by ben]
ben
parents: 800
diff changeset
144 /* set_descriptor_non_blocking (tty_con->infd); */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
146 Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 tty_con->instream =
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
148 make_coding_input_stream (XLSTREAM (tty_con->instream),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
149 get_coding_system_for_text_file (Qkeyboard, 0),
814
a634e3b7acc8 [xemacs-hg @ 2002-04-14 12:41:59 by ben]
ben
parents: 802
diff changeset
150 CODING_DECODE,
a634e3b7acc8 [xemacs-hg @ 2002-04-14 12:41:59 by ben]
ben
parents: 802
diff changeset
151 LSTREAM_FL_READ_ONE_BYTE_AT_A_TIME);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
152 Lstream_set_buffering (XLSTREAM (tty_con->instream), LSTREAM_UNBUFFERED, 0);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
153 tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 tty_con->outstream =
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
155 make_coding_output_stream (XLSTREAM (tty_con->outstream),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
156 get_coding_system_for_text_file (Qterminal, 0),
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
157 CODING_ENCODE, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 tty_con->terminal_type = terminal_type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 tty_con->controlling_process = controlling_process;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3571
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
161 /* Defaults to 1 with Mule, 0 without. In the latter case the attribute is
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
162 read-only from Lisp. */
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
163 tty_con->multiple_width = CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c);
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
164
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 if (NILP (CONSOLE_NAME (con)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 CONSOLE_NAME (con) = Ffile_name_nondirectory (tty);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
168 pid_t tty_pg;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
169 pid_t controlling_tty_pg;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 int cfd;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 /* OK, the only sure-fire way I can think of to determine
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 whether a particular TTY is our controlling TTY is to check
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 if it has the same foreground process group as our controlling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 TTY. This is OK because a process group can never simultaneously
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 be the foreground process group of two TTY's (in that case it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 would have two controlling TTY's, which is not allowed). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 EMACS_GET_TTY_PROCESS_GROUP (tty_con->infd, &tty_pg);
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 814
diff changeset
180 cfd = qxe_open ((Ibyte *) "/dev/tty", O_RDWR, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 EMACS_GET_TTY_PROCESS_GROUP (cfd, &controlling_tty_pg);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
182 retry_close (cfd);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 if (tty_pg == controlling_tty_pg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 tty_con->controlling_terminal = 1;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
186 Vcontrolling_terminal = wrap_console (con);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 munge_tty_process_group ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 tty_con->controlling_terminal = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 tty_mark_console (struct console *con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 struct tty_console *tty_con = CONSOLE_TTY_DATA (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 mark_object (tty_con->terminal_type);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 mark_object (tty_con->instream);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 mark_object (tty_con->outstream);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 static int
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
206 tty_initially_selected_for_input (struct console *UNUSED (con))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 free_tty_console_struct (struct console *con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 struct tty_console *tty_con = CONSOLE_TTY_DATA (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 if (tty_con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 if (tty_con->term_entry_buffer) /* allocated in term_init () */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 {
4976
16112448d484 Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
219 xfree (tty_con->term_entry_buffer);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 tty_con->term_entry_buffer = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 }
4117
229bd619740a [xemacs-hg @ 2007-08-15 11:06:02 by crestani]
crestani
parents: 3571
diff changeset
222 #ifndef NEW_GC
4976
16112448d484 Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents: 4953
diff changeset
223 xfree (tty_con);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2850
diff changeset
224 #endif /* not NEW_GC */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 CONSOLE_TTY_DATA (con) = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 tty_delete_console (struct console *con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 Lstream_close (XLSTREAM (CONSOLE_TTY_DATA (con)->instream));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 Lstream_close (XLSTREAM (CONSOLE_TTY_DATA (con)->outstream));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 if (!CONSOLE_TTY_DATA (con)->is_stdio)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
235 retry_close (CONSOLE_TTY_DATA (con)->infd);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 if (CONSOLE_TTY_DATA (con)->controlling_terminal)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 Vcontrolling_terminal = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 unmunge_tty_process_group ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 free_tty_console_struct (con);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 static struct console *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 decode_tty_console (Lisp_Object console)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
248 console = wrap_console (decode_console (console));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 CHECK_TTY_CONSOLE (console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 return XCONSOLE (console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 DEFUN ("console-tty-terminal-type", Fconsole_tty_terminal_type,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 Return the terminal type of TTY console CONSOLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 return CONSOLE_TTY_DATA (decode_tty_console (console))->terminal_type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 DEFUN ("console-tty-controlling-process", Fconsole_tty_controlling_process,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 Return the controlling process of tty console CONSOLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 (console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 return CONSOLE_TTY_DATA (decode_tty_console (console))->controlling_process;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 DEFUN ("console-tty-input-coding-system", Fconsole_tty_input_coding_system,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 Return the input coding system of tty console CONSOLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
278 return coding_stream_detected_coding_system
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 DEFUN ("set-console-tty-input-coding-system", Fset_console_tty_input_coding_system,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 Set the input coding system of tty console CONSOLE to CODESYS.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 CONSOLE defaults to the selected console.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 CODESYS defaults to the value of `keyboard-coding-system'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 (console, codesys))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
290 set_coding_stream_coding_system
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->instream),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
292 get_coding_system_for_text_file (NILP (codesys) ? Qkeyboard : codesys,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
293 0));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 DEFUN ("console-tty-output-coding-system", Fconsole_tty_output_coding_system,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 Return TTY CONSOLE's output coding system.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 (console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
303 return coding_stream_coding_system
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 DEFUN ("set-console-tty-output-coding-system", Fset_console_tty_output_coding_system,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 Set the coding system of tty output of console CONSOLE to CODESYS.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 CONSOLE defaults to the selected console.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 CODESYS defaults to the value of `terminal-coding-system'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (console, codesys))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
315 set_coding_stream_coding_system
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
317 get_coding_system_for_text_file (NILP (codesys) ? Qterminal : codesys,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 578
diff changeset
318 0));
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
319 /* Redraw tty */
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
320 face_property_was_changed (Vdefault_face, Qfont, Qtty);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323
3571
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
324 DEFUN ("console-tty-multiple-width", Fconsole_tty_multiple_width,
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
325 0, 1, 0, /*
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
326 Return whether CONSOLE treats East Asian double-width chars as such.
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
327
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
328 CONSOLE defaults to the selected console. Without XEmacs support for
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
329 double-width characters, this always gives nil.
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
330 */
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
331 (console))
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
332 {
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
333 return CONSOLE_TTY_MULTIPLE_WIDTH (decode_tty_console(console))
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
334 ? Qt : Qnil;
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
335 }
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
336
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
337 DEFUN ("set-console-tty-multiple-width", Fset_console_tty_multiple_width,
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
338 0, 2, 0, /*
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
339 Set whether CONSOLE treats East Asian double-width characters as such.
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
340
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
341 CONSOLE defaults to the selected console, and VALUE defaults to nil.
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
342 Without XEmacs support for double-width characters, this throws an error if
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
343 VALUE is non-nil.
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
344 */
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
345 (console, value))
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
346 {
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
347 struct console *c = decode_tty_console (console);
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
348
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
349 /* So people outside of East Asia can put (set-console-tty-multiple-width
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
350 (selected-console) nil) in their init files, independent of whether
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
351 Mule is enabled. */
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
352 if (!CONSOLE_TTY_MULTIPLE_WIDTH (c) && NILP(value))
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
353 {
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
354 return Qnil;
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
355 }
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
356
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
357 if (!CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH (c))
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
358 {
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
359 invalid_change
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
360 ("No console support for double-width chars",
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
361 Fmake_symbol(CONSOLE_NAME(c)));
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
362 }
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
363
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
364 CONSOLE_TTY_DATA(c)->multiple_width = NILP(value) ? 0 : 1;
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
365
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
366 return Qnil;
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
367 }
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
368
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
369 /* #### Move this function to lisp */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 Set the input and output coding systems of tty console CONSOLE to CODESYS.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 CONSOLE defaults to the selected console.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 If CODESYS is nil, the values of `keyboard-coding-system' and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 `terminal-coding-system' will be used for the input and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 output coding systems of CONSOLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 (console, codesys))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 Fset_console_tty_input_coding_system (console, codesys);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 Fset_console_tty_output_coding_system (console, codesys);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 tty_semi_canonicalize_console_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
388 Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 return stream_semi_canonicalize_console_connection (connection, errb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 tty_canonicalize_console_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
395 Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 return stream_canonicalize_console_connection (connection, errb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 tty_semi_canonicalize_device_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
402 Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 return stream_semi_canonicalize_console_connection (connection, errb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 tty_canonicalize_device_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
409 Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 return stream_canonicalize_console_connection (connection, errb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
414 static Lisp_Object
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
415 tty_perhaps_init_unseen_key_defaults (struct console *UNUSED(con),
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
416 Lisp_Object key)
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
417 {
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
418 Ichar val;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
419 extern Lisp_Object Vcurrent_global_map;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
420
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
421 if (SYMBOLP(key))
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
422 {
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
423 /* We've no idea what to default an unknown symbol to on the TTY. */
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
424 return Qnil;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
425 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
426
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
427 CHECK_CHAR(key);
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
428
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
429 if (!(HASH_TABLEP(Vtty_seen_characters)))
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
430 {
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
431 /* All the keysyms we deal with are character objects; therefore, we
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
432 can use eq as the test without worrying. */
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
433 Vtty_seen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK,
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
434 HASH_TABLE_EQ);
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
435 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
436
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
437 /* Might give the user an opaque error if make_lisp_hash_table fails,
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
438 but it won't crash. */
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
439 CHECK_HASH_TABLE(Vtty_seen_characters);
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
440
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
441 val = XCHAR(key);
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
442
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
443 /* Same logic as in x_has_keysym; I'm not convinced it's always sane. */
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
444 if (val < 0x80)
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
445 {
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
446 return Qnil;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
447 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
448
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
449 if (!NILP(Fgethash(key, Vtty_seen_characters, Qnil)))
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
450 {
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
451 return Qnil;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
452 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
453
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
454 if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil)))
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
455 {
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
456 Fputhash(key, Qt, Vtty_seen_characters);
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
457 Fdefine_key (Vcurrent_global_map, key, Qself_insert_command);
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
458 return Qt;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
459 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
460
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
461 return Qnil;
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
462 }
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
463
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 /* initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 syms_of_console_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 DEFSUBR (Fconsole_tty_terminal_type);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 DEFSUBR (Fconsole_tty_controlling_process);
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
474 DEFSYMBOL (Qterminal_type);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
475 DEFSYMBOL (Qcontrolling_process);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 DEFSUBR (Fconsole_tty_output_coding_system);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 DEFSUBR (Fset_console_tty_output_coding_system);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 DEFSUBR (Fconsole_tty_input_coding_system);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 DEFSUBR (Fset_console_tty_input_coding_system);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 DEFSUBR (Fset_console_tty_coding_system);
3571
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
481 DEFSUBR (Fconsole_tty_multiple_width);
f6cd5fe9bf4c [xemacs-hg @ 2006-08-24 21:21:34 by aidan]
aidan
parents: 3092
diff changeset
482 DEFSUBR (Fset_console_tty_multiple_width);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 console_type_create_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 INITIALIZE_CONSOLE_TYPE (tty, "tty", "console-tty-p");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 /* console methods */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 CONSOLE_HAS_METHOD (tty, init_console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 CONSOLE_HAS_METHOD (tty, mark_console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 CONSOLE_HAS_METHOD (tty, initially_selected_for_input);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 CONSOLE_HAS_METHOD (tty, delete_console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 CONSOLE_HAS_METHOD (tty, canonicalize_console_connection);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 CONSOLE_HAS_METHOD (tty, canonicalize_device_connection);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 CONSOLE_HAS_METHOD (tty, semi_canonicalize_console_connection);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 CONSOLE_HAS_METHOD (tty, semi_canonicalize_device_connection);
2828
a25c824ed558 [xemacs-hg @ 2005-06-26 18:04:49 by aidan]
aidan
parents: 2286
diff changeset
499 CONSOLE_HAS_METHOD (tty, perhaps_init_unseen_key_defaults);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 reinit_console_type_create_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 REINITIALIZE_CONSOLE_TYPE (tty);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 image_instantiator_format_create_glyphs_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 IIFORMAT_VALID_CONSOLE (tty, nothing);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 IIFORMAT_VALID_CONSOLE (tty, string);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 IIFORMAT_VALID_CONSOLE (tty, formatted_string);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 IIFORMAT_VALID_CONSOLE (tty, inherit);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 vars_of_console_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 {
2850
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
520 DEFVAR_LISP ("tty-seen-characters", &Vtty_seen_characters /*
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
521 Hash table of non-ASCII characters the TTY subsystem has seen.
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
522 */ );
ad0054aa11f1 [xemacs-hg @ 2005-07-08 08:27:32 by aidan]
aidan
parents: 2828
diff changeset
523 Vtty_seen_characters = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 Fprovide (Qtty);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 }