comparison lisp/prim/device.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 0293115a14e9
children 1a767b41a199
comparison
equal deleted inserted replaced
29:7976500f47f9 30:ec9a17fef872
31 (defun device-type (&optional device) 31 (defun device-type (&optional device)
32 "Return the type of the specified device (e.g. `x' or `tty'). 32 "Return the type of the specified device (e.g. `x' or `tty').
33 This is equivalent to the type of the device's console. 33 This is equivalent to the type of the device's console.
34 Value is `tty' for a tty device (a character-only terminal), 34 Value is `tty' for a tty device (a character-only terminal),
35 `x' for a device that is a screen on an X display, 35 `x' for a device that is a screen on an X display,
36 `ns' for a device that is a NeXTstep connection (not yet implemeted), 36 `ns' for a device that is a NeXTstep connection (not yet implemented),
37 `win32' for a device that is a Windows or Windows NT connection (not yet 37 `win32' for a device that is a Windows or Windows NT connection (not yet
38 implemented), 38 implemented),
39 `pc' for a device that is a direct-write MS-DOS screen (not yet implemented), 39 `pc' for a device that is a direct-write MS-DOS screen (not yet implemented),
40 `stream' for a stream device (which acts like a stdio stream), and 40 `stream' for a stream device (which acts like a stdio stream), and
41 `dead' for a deleted device." 41 `dead' for a deleted device."
42 (or device (setq device (selected-device))) 42 (or device (setq device (selected-device)))
43 (if (not (device-live-p device)) 'dead 43 (if (not (device-live-p device)) 'dead
44 (console-type (device-console device)))) 44 (console-type (device-console device))))
45 45
46 (defun make-tty-device (&optional tty terminal-type) 46 (defun make-tty-device (&optional tty terminal-type controlling-process)
47 "Create a new device on TTY. 47 "Create a new device on TTY.
48 TTY should be the name of a tty device file (e.g. \"/dev/ttyp3\" under 48 TTY should be the name of a tty device file (e.g. \"/dev/ttyp3\" under
49 SunOS et al.), as returned by the `tty' command. A value of nil means 49 SunOS et al.), as returned by the `tty' command. A value of nil means
50 use the stdin and stdout as passed to XEmacs from the shell. 50 use the stdin and stdout as passed to XEmacs from the shell.
51 If TERMINAL-TYPE is non-nil, it should be a string specifying the 51 If TERMINAL-TYPE is non-nil, it should be a string specifying the
52 type of the terminal attached to the specified tty. If it is nil, 52 type of the terminal attached to the specified tty. If it is nil,
53 the terminal type will be inferred from the TERM environment variable." 53 the terminal type will be inferred from the TERM environment variable.
54 (make-device 'tty tty (list 'terminal-type terminal-type))) 54 If CONTROLLING-PROCESS is non-nil, it should be an integer
55 specifying the process id of the process in control of the specified tty. If
56 it is nil, it is assumes to be the value returned by emacs-pid."
57 (make-device 'tty tty (list 'terminal-type terminal-type
58 'controlling-process controlling-process)))
55 59
56 (defun make-x-device (&optional display) 60 (defun make-x-device (&optional display)
57 "Create a new device connected to DISPLAY." 61 "Create a new device connected to DISPLAY."
58 (make-device 'x display)) 62 (make-device 'x display))
59 63