Mercurial > emacs
comparison lisp/subr.el @ 62372:4560134d21fa
(open-network-stream-nowait): Remove.
(open-network-stream-server): Remove.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 15 May 2005 20:42:43 +0000 |
parents | fd364cee20ef |
children | 602fb25a831a |
comparison
equal
deleted
inserted
replaced
62371:146db6da77b4 | 62372:4560134d21fa |
---|---|
1039 "Read the following input sexp, and run it whenever FILE is loaded. | 1039 "Read the following input sexp, and run it whenever FILE is loaded. |
1040 This makes or adds to an entry on `after-load-alist'. | 1040 This makes or adds to an entry on `after-load-alist'. |
1041 FILE should be the name of a library, with no directory name." | 1041 FILE should be the name of a library, with no directory name." |
1042 (eval-after-load file (read))) | 1042 (eval-after-load file (read))) |
1043 | 1043 |
1044 ;;; make-network-process wrappers | 1044 ;;; open-network-stream is a wrapper around make-network-process. |
1045 | 1045 |
1046 (if (featurep 'make-network-process) | 1046 (when (featurep 'make-network-process) |
1047 (progn | 1047 (defun open-network-stream (name buffer host service) |
1048 | |
1049 (defun open-network-stream (name buffer host service) | |
1050 "Open a TCP connection for a service to a host. | 1048 "Open a TCP connection for a service to a host. |
1051 Returns a subprocess-object to represent the connection. | 1049 Returns a subprocess-object to represent the connection. |
1052 Input and output work as for subprocesses; `delete-process' closes it. | 1050 Input and output work as for subprocesses; `delete-process' closes it. |
1053 | 1051 |
1054 Args are NAME BUFFER HOST SERVICE. | 1052 Args are NAME BUFFER HOST SERVICE. |
1060 with any buffer. | 1058 with any buffer. |
1061 HOST is name of the host to connect to, or its IP address. | 1059 HOST is name of the host to connect to, or its IP address. |
1062 SERVICE is name of the service desired, or an integer specifying | 1060 SERVICE is name of the service desired, or an integer specifying |
1063 a port number to connect to." | 1061 a port number to connect to." |
1064 (make-network-process :name name :buffer buffer | 1062 (make-network-process :name name :buffer buffer |
1065 :host host :service service)) | 1063 :host host :service service))) |
1066 | |
1067 (defun open-network-stream-nowait (name buffer host service &optional sentinel filter) | |
1068 "Initiate connection to a TCP connection for a service to a host. | |
1069 It returns nil if non-blocking connects are not supported; otherwise, | |
1070 it returns a subprocess-object to represent the connection. | |
1071 | |
1072 This function is similar to `open-network-stream', except that it | |
1073 returns before the connection is established. When the connection | |
1074 is completed, the sentinel function will be called with second arg | |
1075 matching `open' (if successful) or `failed' (on error). | |
1076 | |
1077 Args are NAME BUFFER HOST SERVICE SENTINEL FILTER. | |
1078 NAME, BUFFER, HOST, and SERVICE are as for `open-network-stream'. | |
1079 Optional args SENTINEL and FILTER specify the sentinel and filter | |
1080 functions to be used for this network stream." | |
1081 (if (featurep 'make-network-process '(:nowait t)) | |
1082 (make-network-process :name name :buffer buffer :nowait t | |
1083 :host host :service service | |
1084 :filter filter :sentinel sentinel))) | |
1085 | |
1086 (defun open-network-stream-server (name buffer service &optional sentinel filter) | |
1087 "Create a network server process for a TCP service. | |
1088 It returns nil if server processes are not supported; otherwise, | |
1089 it returns a subprocess-object to represent the server. | |
1090 | |
1091 When a client connects to the specified service, a new subprocess | |
1092 is created to handle the new connection, and the sentinel function | |
1093 is called for the new process. | |
1094 | |
1095 Args are NAME BUFFER SERVICE SENTINEL FILTER. | |
1096 NAME is name for the server process. Client processes are named by | |
1097 appending the ip-address and port number of the client to NAME. | |
1098 BUFFER is the buffer (or buffer name) to associate with the server | |
1099 process. Client processes will not get a buffer if a process filter | |
1100 is specified or BUFFER is nil; otherwise, a new buffer is created for | |
1101 the client process. The name is similar to the process name. | |
1102 Third arg SERVICE is name of the service desired, or an integer | |
1103 specifying a port number to connect to. It may also be t to select | |
1104 an unused port number for the server. | |
1105 Optional args SENTINEL and FILTER specify the sentinel and filter | |
1106 functions to be used for the client processes; the server process | |
1107 does not use these function." | |
1108 (if (featurep 'make-network-process '(:server t)) | |
1109 (make-network-process :name name :buffer buffer | |
1110 :service service :server t :noquery t | |
1111 :sentinel sentinel :filter filter))) | |
1112 | |
1113 )) ;; (featurep 'make-network-process) | |
1114 | |
1115 | 1064 |
1116 ;; compatibility | 1065 ;; compatibility |
1117 | 1066 |
1118 (make-obsolete 'process-kill-without-query | 1067 (make-obsolete 'process-kill-without-query |
1119 "use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'." | 1068 "use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'." |
2361 | 2310 |
2362 (defun assq-delete-all (key alist) | 2311 (defun assq-delete-all (key alist) |
2363 "Delete from ALIST all elements whose car is `eq' to KEY. | 2312 "Delete from ALIST all elements whose car is `eq' to KEY. |
2364 Return the modified alist. | 2313 Return the modified alist. |
2365 Elements of ALIST that are not conses are ignored." | 2314 Elements of ALIST that are not conses are ignored." |
2366 (while (and (consp (car alist)) | 2315 (while (and (consp (car alist)) |
2367 (eq (car (car alist)) key)) | 2316 (eq (car (car alist)) key)) |
2368 (setq alist (cdr alist))) | 2317 (setq alist (cdr alist))) |
2369 (let ((tail alist) tail-cdr) | 2318 (let ((tail alist) tail-cdr) |
2370 (while (setq tail-cdr (cdr tail)) | 2319 (while (setq tail-cdr (cdr tail)) |
2371 (if (and (consp (car tail-cdr)) | 2320 (if (and (consp (car tail-cdr)) |
2376 | 2325 |
2377 (defun rassq-delete-all (value alist) | 2326 (defun rassq-delete-all (value alist) |
2378 "Delete from ALIST all elements whose cdr is `eq' to VALUE. | 2327 "Delete from ALIST all elements whose cdr is `eq' to VALUE. |
2379 Return the modified alist. | 2328 Return the modified alist. |
2380 Elements of ALIST that are not conses are ignored." | 2329 Elements of ALIST that are not conses are ignored." |
2381 (while (and (consp (car alist)) | 2330 (while (and (consp (car alist)) |
2382 (eq (cdr (car alist)) value)) | 2331 (eq (cdr (car alist)) value)) |
2383 (setq alist (cdr alist))) | 2332 (setq alist (cdr alist))) |
2384 (let ((tail alist) tail-cdr) | 2333 (let ((tail alist) tail-cdr) |
2385 (while (setq tail-cdr (cdr tail)) | 2334 (while (setq tail-cdr (cdr tail)) |
2386 (if (and (consp (car tail-cdr)) | 2335 (if (and (consp (car tail-cdr)) |