0
|
1 @c -*-texinfo-*-
|
|
2 @c This is part of the XEmacs Lisp Reference Manual.
|
|
3 @c Copyright (C) 1995, 1996 Ben Wing.
|
|
4 @c See the file lispref.texi for copying conditions.
|
|
5 @setfilename ../../info/consoles-devices.info
|
|
6 @node Consoles and Devices, Positions, Frames, top
|
|
7 @chapter Consoles and Devices
|
|
8 @cindex devices
|
|
9 @cindex consoles
|
|
10
|
|
11 A @dfn{console} is an object representing a single input connection
|
|
12 to XEmacs, such as an X display or a TTY connection. It is possible
|
|
13 for XEmacs to have frames on multiple consoles at once (even on
|
|
14 heterogeneous types -- you can simultaneously have a frame on an
|
|
15 X display and a TTY connection). Normally, there is only one
|
|
16 console in existence.
|
|
17
|
|
18 A @dfn{device} is an object representing a single output device, such
|
|
19 as a particular screen on an X display. (Usually there is exactly one
|
|
20 device per X console connection, but there may be more than one if you
|
|
21 have a multi-headed X display. For TTY connections, there is always
|
|
22 exactly one device per console.)
|
|
23
|
|
24 Each device has one or more @dfn{frames} in which text can be
|
|
25 displayed. For X displays and the like, a frame corresponds to the
|
|
26 normal window-system concept of a window. Frames can overlap, be
|
|
27 displayed at various locations within the display, be resized, etc. For
|
|
28 TTY, only one frame can be displayed at a time, and it occupies the
|
2
|
29 entire TTY display area.
|
|
30 @ignore @c Not yet implemented
|
|
31 However, you can still define multiple frames
|
0
|
32 and switch between them. Their contents are entirely separate from each
|
|
33 other. These sorts of frames resemble the ``virtual console''
|
|
34 capability provided under Linux or the multiple screens provided by the
|
|
35 multiplexing program @samp{screen} under Unix.
|
2
|
36 @end ignore
|
0
|
37
|
|
38 When you start up XEmacs, an initial console and device are created to
|
|
39 receive input and display frames on. This will either be an X display
|
|
40 or a TTY connection, depending on what mode you started XEmacs in (this
|
|
41 is determined by the @samp{DISPLAY} environment variable, the
|
|
42 @samp{-nw}, @samp{-t} and @samp{-display} command-line options, etc.).
|
|
43
|
|
44 You can connect to other X displays and TTY connections by creating
|
|
45 new console objects, and to other X screens on an existing display by
|
|
46 creating new device objects, as described below. Many functions (for
|
|
47 example the frame-creation functions) take an optional device argument
|
|
48 specifying which device the function pertains to. If the argument is
|
|
49 omitted, it defaults to the selected device (see below).
|
|
50
|
|
51 @defun consolep object
|
|
52 This returns non-@code{nil} if @var{object} is a console.
|
|
53 @end defun
|
|
54
|
|
55 @defun devicep object
|
|
56 This returns non-@code{nil} if @var{object} is a device.
|
|
57 @end defun
|
|
58
|
|
59 @menu
|
|
60 * Basic Console Functions:: Functions for working with consoles.
|
|
61 * Basic Device Functions:: Functions for working with devices.
|
|
62 * Console Types and Device Classes::
|
|
63 I/O and color characteristics.
|
|
64 * Connecting to a Console or Device::
|
|
65 * The Selected Console and Device::
|
|
66 * Console and Device I/O:: Controlling input and output.
|
|
67 @end menu
|
|
68
|
|
69 @node Basic Console Functions
|
|
70 @section Basic Console Functions
|
|
71
|
|
72 @defun console-list
|
|
73 This function returns a list of all existing consoles.
|
|
74 @end defun
|
|
75
|
|
76 @defun console-device-list &optional console
|
|
77 This function returns a list of all devices on @var{console}. If
|
|
78 @var{console} is @code{nil}, the selected console will be used.
|
|
79 @end defun
|
|
80
|
|
81 @node Basic Device Functions
|
|
82 @section Basic Device Functions
|
|
83
|
|
84 @defun device-list
|
|
85 This function returns a list of all existing devices.
|
|
86 @end defun
|
|
87
|
|
88 @defun device-or-frame-p object
|
|
89 This function returns non-@code{nil} if @var{object} is a device or
|
|
90 frame. This function is useful because devices and frames are similar
|
|
91 in many respects and many functions can operate on either one.
|
|
92 @end defun
|
|
93
|
|
94 @defun device-frame-list device
|
|
95 This function returns a list of all frames on @var{device}.
|
|
96 @end defun
|
|
97
|
|
98 @defun frame-device frame
|
|
99 This function returns the device that @var{frame} is on.
|
|
100 @end defun
|
|
101
|
|
102 @node Console Types and Device Classes
|
|
103 @section Console Types and Device Classes
|
|
104
|
|
105 Every device is of a particular @dfn{type}, which describes how the
|
|
106 connection to that device is made and how the device operates, and
|
|
107 a particular @dfn{class}, which describes other characteristics of
|
|
108 the device (currently, the color capabilities of the device).
|
|
109
|
|
110 The currently-defined device types are
|
|
111
|
|
112 @table @code
|
|
113 @item x
|
|
114 A connection to an X display (such as @samp{willow:0}).
|
|
115
|
|
116 @item tty
|
|
117 A connection to a tty (such as @samp{/dev/ttyp3}).
|
|
118
|
|
119 @item stream
|
|
120 A stdio connection. This describes a device for which input and output
|
|
121 is only possible in a stream-like fashion, such as when XEmacs in running
|
|
122 in batch mode. The very first device created by XEmacs is a terminal
|
|
123 device and is used to print out messages of various sorts (for example,
|
|
124 the help message when you use the @samp{-help} command-line option).
|
|
125 @end table
|
|
126
|
|
127 The currently-defined device classes are
|
|
128 @table @code
|
|
129 @item color
|
|
130 A color device.
|
|
131
|
|
132 @item grayscale
|
|
133 A grayscale device (a device that can display multiple shades of gray,
|
|
134 but no color).
|
|
135
|
|
136 @item mono
|
|
137 A device that can only display two colors (e.g. black and white).
|
|
138 @end table
|
|
139
|
|
140 @defun device-type device
|
|
141 This function returns the type of @var{device}. This is a symbol whose
|
|
142 name is one of the device types mentioned above.
|
|
143 @end defun
|
|
144
|
|
145 @defun device-or-frame-type device-or-frame
|
|
146 This function returns the type of @var{device-or-frame}.
|
|
147 @end defun
|
|
148
|
|
149 @defun device-class device
|
|
150 This function returns the class (color behavior) of @var{device}. This
|
|
151 is a symbol whose name is one of the device classes mentioned above.
|
|
152 @end defun
|
|
153
|
|
154 @defun valid-device-type-p device-type
|
|
155 This function returns whether @var{device-type} (which should be a symbol)
|
|
156 species a valid device type.
|
|
157 @end defun
|
|
158
|
|
159 @defun valid-device-class-p device-class
|
|
160 This function returns whether @var{device-class} (which should be a symbol)
|
|
161 species a valid device class.
|
|
162 @end defun
|
|
163
|
|
164 @defvar terminal-device
|
|
165 This variable holds the initial terminal device object, which
|
|
166 represents XEmacs's stdout.
|
|
167 @end defvar
|
|
168
|
|
169 @node Connecting to a Console or Device
|
|
170 @section Connecting to a Console or Device
|
|
171
|
|
172 @defun make-device &optional type device-data
|
|
173 This function creates a new device.
|
|
174 @end defun
|
|
175
|
|
176 The following two functions create devices of specific types and are
|
|
177 written in terms of @code{make-device}.
|
|
178
|
|
179 @defun make-tty-device &optional tty terminal-type
|
|
180 This function creates a new tty device on @var{tty}. This also creates
|
|
181 the tty's first frame. @var{tty} should be a string giving the name of
|
|
182 a tty device file (e.g. @samp{/dev/ttyp3} under SunOS et al.), as
|
|
183 returned by the @samp{tty} command issued from the Unix shell. A value
|
|
184 of @code{nil} means use the stdin and stdout as passed to XEmacs from
|
|
185 the shell. If @var{terminal-type} is non-@code{nil}, it should be a
|
|
186 string specifying the type of the terminal attached to the specified
|
|
187 tty. If it is @code{nil}, the terminal type will be inferred from the
|
|
188 @samp{TERM} environment variable.
|
|
189 @end defun
|
|
190
|
|
191 @defun make-x-device &optional display argv-list
|
|
192 This function creates a new device connected to @var{display}. Optional
|
|
193 argument @var{argv-list} is a list of strings describing command line
|
|
194 options.
|
|
195 @end defun
|
|
196
|
|
197 @defun delete-device device
|
|
198 This function deletes @var{device}, permanently eliminating it from use.
|
|
199 This disconnects XEmacs's connection to the device.
|
|
200 @end defun
|
|
201
|
|
202 @defvar create-device-hook
|
|
203 This variable, if non-@code{nil}, should contain a list of functions,
|
|
204 which are called when a device is created.
|
|
205 @end defvar
|
|
206
|
|
207 @defvar delete-device-hook
|
|
208 This variable, if non-@code{nil}, should contain a list of functions,
|
|
209 which are called when a device is deleted.
|
|
210 @end defvar
|
|
211
|
|
212 @defun console-live-p object
|
|
213 This function returns non-@code{nil} if @var{object} is a console that
|
|
214 has not been deleted.
|
|
215 @end defun
|
|
216
|
|
217 @defun device-live-p object
|
|
218 This function returns non-@code{nil} if @var{object} is a device that
|
|
219 has not been deleted.
|
|
220 @end defun
|
|
221
|
|
222 @defun device-x-display device
|
|
223 This function returns the X display which @var{device} is connected to,
|
|
224 if @var{device} is an X device.
|
|
225 @end defun
|
|
226
|
|
227 @node The Selected Console and Device
|
|
228 @section The Selected Console and Device
|
|
229
|
|
230 @defun select-console console
|
|
231 This function selects the console @var{console}. Subsequent editing
|
|
232 commands apply to its selected device, selected frame, and selected
|
|
233 window. The selection of @var{console} lasts until the next time the
|
|
234 user does something to select a different console, or until the next
|
|
235 time this function is called.
|
|
236 @end defun
|
|
237
|
|
238 @defun selected-console
|
|
239 This function returns the console which is currently active.
|
|
240 @end defun
|
|
241
|
|
242 @defun select-device device
|
|
243 This function selects the device @var{device}.
|
|
244 @end defun
|
|
245
|
|
246 @defun selected-device &optional console
|
|
247 This function returns the device which is currently active. If optional
|
|
248 @var{console} is non-@code{nil}, this function returns the device that
|
|
249 would be currently active if @var{console} were the selected console.
|
|
250 @end defun
|
|
251
|
|
252 @node Console and Device I/O
|
|
253 @section Console and Device I/O
|
|
254
|
|
255 @defun console-disable-input console
|
|
256 This function disables input on console @var{console}.
|
|
257 @end defun
|
|
258
|
|
259 @defun console-enable-input console
|
|
260 This function enables input on console @var{console}.
|
|
261 @end defun
|
|
262
|
|
263 Each device has a @dfn{baud rate} value associated with it.
|
|
264 On most systems, changing this value will affect the amount of padding
|
|
265 and other strategic decisions made during redisplay.
|
|
266
|
|
267 @defun device-baud-rate &optional device
|
|
268 This function returns the output baud rate of @var{device}.
|
|
269 @end defun
|
|
270
|
|
271 @defun set-device-baud-rate device rate
|
|
272 This function sets the output baud rate of @var{device} to @var{rate}.
|
|
273 @end defun
|