Mercurial > hg > xemacs-beta
comparison lisp/device.el @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | 3ecd8885ac67 |
children | 0784d089fdc9 |
comparison
equal
deleted
inserted
replaced
439:357dd071b03c | 440:8de8e3f6228a |
---|---|
29 | 29 |
30 ;; This file is dumped with XEmacs. | 30 ;; This file is dumped with XEmacs. |
31 | 31 |
32 ;;; Code: | 32 ;;; Code: |
33 | 33 |
34 ;;; Initialization | |
35 | |
36 ; Specifier tag 'printer which matches printers | |
37 (define-specifier-tag 'printer (function device-printer-p)) | |
38 | |
39 ; Specifier tag 'display which matches displays | |
40 (define-specifier-tag 'display (function | |
41 (lambda (device) | |
42 (not (device-printer-p device))))) | |
43 | |
44 ;;; Functions | |
45 | |
34 (defun device-list () | 46 (defun device-list () |
35 "Return a list of all devices." | 47 "Return a list of all devices." |
36 (apply 'nconc (mapcar 'console-device-list (console-list)))) | 48 (apply 'nconc (mapcar 'console-device-list (console-list)))) |
37 | 49 |
38 (defun device-type (&optional device) | 50 (defun device-type (&optional device) |
39 "Return the type of the specified device (e.g. `x' or `tty'). | 51 "Return the type of the specified device (e.g. `x' or `tty'). |
40 This is equivalent to the type of the device's console. | 52 This is equivalent to the type of the device's console. |
41 Value is `tty' for a tty device (a character-only terminal), | 53 Value is `tty' for a tty device (a character-only terminal), |
42 `x' for a device that is a screen on an X display, | 54 `x' for a device that is a screen on an X display, |
43 `ns' for a device that is a NeXTstep connection (not yet implemented), | 55 `ns' for a device that is a NeXTstep connection (not yet implemented), |
44 `mswindows' for a device that is a Windows or Windows NT connection, | 56 `mswindows' for a device that is a MS Windows workstation, |
45 `pc' for a device that is a direct-write MS-DOS screen (not yet implemented), | 57 `msprinter' for a device that is a MS Windows printer connection, |
46 `stream' for a stream device (which acts like a stdio stream), and | 58 `stream' for a stream device (which acts like a stdio stream), and |
47 `dead' for a deleted device." | 59 `dead' for a deleted device." |
48 (or device (setq device (selected-device))) | 60 (or device (setq device (selected-device))) |
49 (if (not (device-live-p device)) 'dead | 61 (if (not (device-live-p device)) 'dead |
50 (console-type (device-console device)))) | 62 (console-type (device-console device)))) |
106 (or device (setq device (selected-device))) | 118 (or device (setq device (selected-device))) |
107 (console-on-window-system-p (device-console device))) | 119 (console-on-window-system-p (device-console device))) |
108 | 120 |
109 (defun call-device-method (name device &rest args) | 121 (defun call-device-method (name device &rest args) |
110 "Call a DEVICE-specific function with the generic name NAME. | 122 "Call a DEVICE-specific function with the generic name NAME. |
111 If DEVICE is not provide the selected device is used." | 123 If DEVICE is not provided then the selected device is used." |
112 (or device (setq device (selected-device))) | 124 (or device (setq device (selected-device))) |
113 (or (symbolp name) (error "function name must be a symbol")) | 125 (or (symbolp name) (error "function name must be a symbol")) |
114 (let ((devmeth (intern (concat (symbol-name | 126 (let ((devmeth (intern (concat (symbol-name |
115 (device-type device)) "-" (symbol-name name))))) | 127 (device-type device)) "-" (symbol-name name))))) |
116 (if (functionp devmeth) | 128 (if (functionp devmeth) |