comparison lisp/subr.el @ 55502:75efe89a09b7

(start-process-shell-command): Fix docstring. Put usage info in a format usable by `describe-function'. (open-network-stream, open-network-stream-nowait, open-network-stream-server): Fix docstring.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 10 May 2004 17:43:35 +0000
parents e191e6d1554e
children 30d4272bcc4b
comparison
equal deleted inserted replaced
55501:cb74de063b76 55502:75efe89a09b7
1117 Returns a subprocess-object to represent the connection. 1117 Returns a subprocess-object to represent the connection.
1118 Input and output work as for subprocesses; `delete-process' closes it. 1118 Input and output work as for subprocesses; `delete-process' closes it.
1119 1119
1120 Args are NAME BUFFER HOST SERVICE. 1120 Args are NAME BUFFER HOST SERVICE.
1121 NAME is name for process. It is modified if necessary to make it unique. 1121 NAME is name for process. It is modified if necessary to make it unique.
1122 BUFFER is the buffer (or buffer-name) to associate with the process. 1122 BUFFER is the buffer (or buffer name) to associate with the process.
1123 Process output goes at end of that buffer, unless you specify 1123 Process output goes at end of that buffer, unless you specify
1124 an output stream or filter function to handle the output. 1124 an output stream or filter function to handle the output.
1125 BUFFER may be also nil, meaning that this process is not associated 1125 BUFFER may be also nil, meaning that this process is not associated
1126 with any buffer 1126 with any buffer.
1127 Third arg is name of the host to connect to, or its IP address. 1127 HOST is name of the host to connect to, or its IP address.
1128 Fourth arg SERVICE is name of the service desired, or an integer 1128 SERVICE is name of the service desired, or an integer specifying
1129 specifying a port number to connect to." 1129 a port number to connect to."
1130 (make-network-process :name name :buffer buffer 1130 (make-network-process :name name :buffer buffer
1131 :host host :service service)) 1131 :host host :service service))
1132 1132
1133 (defun open-network-stream-nowait (name buffer host service &optional sentinel filter) 1133 (defun open-network-stream-nowait (name buffer host service &optional sentinel filter)
1134 "Initiate connection to a TCP connection for a service to a host. 1134 "Initiate connection to a TCP connection for a service to a host.
1135 It returns nil if non-blocking connects are not supported; otherwise, 1135 It returns nil if non-blocking connects are not supported; otherwise,
1136 it returns a subprocess-object to represent the connection. 1136 it returns a subprocess-object to represent the connection.
1137 1137
1138 This function is similar to `open-network-stream', except that this 1138 This function is similar to `open-network-stream', except that it
1139 function returns before the connection is established. When the 1139 returns before the connection is established. When the connection
1140 connection is completed, the sentinel function will be called with 1140 is completed, the sentinel function will be called with second arg
1141 second arg matching `open' (if successful) or `failed' (on error). 1141 matching `open' (if successful) or `failed' (on error).
1142 1142
1143 Args are NAME BUFFER HOST SERVICE SENTINEL FILTER. 1143 Args are NAME BUFFER HOST SERVICE SENTINEL FILTER.
1144 NAME, BUFFER, HOST, and SERVICE are as for `open-network-stream'. 1144 NAME, BUFFER, HOST, and SERVICE are as for `open-network-stream'.
1145 Optional args, SENTINEL and FILTER specifies the sentinel and filter 1145 Optional args SENTINEL and FILTER specify the sentinel and filter
1146 functions to be used for this network stream." 1146 functions to be used for this network stream."
1147 (if (featurep 'make-network-process '(:nowait t)) 1147 (if (featurep 'make-network-process '(:nowait t))
1148 (make-network-process :name name :buffer buffer :nowait t 1148 (make-network-process :name name :buffer buffer :nowait t
1149 :host host :service service 1149 :host host :service service
1150 :filter filter :sentinel sentinel))) 1150 :filter filter :sentinel sentinel)))
1158 is created to handle the new connection, and the sentinel function 1158 is created to handle the new connection, and the sentinel function
1159 is called for the new process. 1159 is called for the new process.
1160 1160
1161 Args are NAME BUFFER SERVICE SENTINEL FILTER. 1161 Args are NAME BUFFER SERVICE SENTINEL FILTER.
1162 NAME is name for the server process. Client processes are named by 1162 NAME is name for the server process. Client processes are named by
1163 appending the ip-address and port number of the client to NAME. 1163 appending the ip-address and port number of the client to NAME.
1164 BUFFER is the buffer (or buffer-name) to associate with the server 1164 BUFFER is the buffer (or buffer name) to associate with the server
1165 process. Client processes will not get a buffer if a process filter 1165 process. Client processes will not get a buffer if a process filter
1166 is specified or BUFFER is nil; otherwise, a new buffer is created for 1166 is specified or BUFFER is nil; otherwise, a new buffer is created for
1167 the client process. The name is similar to the process name. 1167 the client process. The name is similar to the process name.
1168 Third arg SERVICE is name of the service desired, or an integer 1168 Third arg SERVICE is name of the service desired, or an integer
1169 specifying a port number to connect to. It may also be t to selected 1169 specifying a port number to connect to. It may also be t to select
1170 an unused port number for the server. 1170 an unused port number for the server.
1171 Optional args, SENTINEL and FILTER specifies the sentinel and filter 1171 Optional args SENTINEL and FILTER specify the sentinel and filter
1172 functions to be used for the client processes; the server process 1172 functions to be used for the client processes; the server process
1173 does not use these function." 1173 does not use these function."
1174 (if (featurep 'make-network-process '(:server t)) 1174 (if (featurep 'make-network-process '(:server t))
1175 (make-network-process :name name :buffer buffer 1175 (make-network-process :name name :buffer buffer
1176 :service service :server t :noquery t 1176 :service service :server t :noquery t
1177 :sentinel sentinel :filter filter))) 1177 :sentinel sentinel :filter filter)))
1178 1178
1723 1723
1724 ;; Synchronous shell commands. 1724 ;; Synchronous shell commands.
1725 1725
1726 (defun start-process-shell-command (name buffer &rest args) 1726 (defun start-process-shell-command (name buffer &rest args)
1727 "Start a program in a subprocess. Return the process object for it. 1727 "Start a program in a subprocess. Return the process object for it.
1728 Args are NAME BUFFER COMMAND &rest COMMAND-ARGS.
1729 NAME is name for process. It is modified if necessary to make it unique. 1728 NAME is name for process. It is modified if necessary to make it unique.
1730 BUFFER is the buffer or (buffer-name) to associate with the process. 1729 BUFFER is the buffer (or buffer name) to associate with the process.
1731 Process output goes at end of that buffer, unless you specify 1730 Process output goes at end of that buffer, unless you specify
1732 an output stream or filter function to handle the output. 1731 an output stream or filter function to handle the output.
1733 BUFFER may be also nil, meaning that this process is not associated 1732 BUFFER may be also nil, meaning that this process is not associated
1734 with any buffer 1733 with any buffer
1735 Third arg is command name, the name of a shell command. 1734 COMMAND is the name of a shell command.
1736 Remaining arguments are the arguments for the command. 1735 Remaining arguments are the arguments for the command.
1737 Wildcards and redirection are handled as usual in the shell." 1736 Wildcards and redirection are handled as usual in the shell.
1737
1738 \(fn NAME BUFFER COMMAND &rest COMMAND-ARGS)"
1738 (cond 1739 (cond
1739 ((eq system-type 'vax-vms) 1740 ((eq system-type 'vax-vms)
1740 (apply 'start-process name buffer args)) 1741 (apply 'start-process name buffer args))
1741 ;; We used to use `exec' to replace the shell with the command, 1742 ;; We used to use `exec' to replace the shell with the command,
1742 ;; but that failed to handle (...) and semicolon, etc. 1743 ;; but that failed to handle (...) and semicolon, etc.