diff lisp/code-process.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children 11054d720c21
line wrap: on
line diff
--- a/lisp/code-process.el	Mon Aug 13 11:19:22 2007 +0200
+++ b/lisp/code-process.el	Mon Aug 13 11:20:41 2007 +0200
@@ -30,6 +30,10 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (defvar buffer-file-type)
+  (defvar binary-process-output))
+
 (defvar process-coding-system-alist nil
   "Alist to decide a coding system to use for a process I/O operation.
 The format is ((PATTERN . VAL) ...),
@@ -108,7 +112,8 @@
 you quit again before the process exits."
   (let ((temp
 	 (make-temp-name
-	  (concat (file-name-as-directory (temp-directory)) "emacs"))))
+	  (concat (file-name-as-directory (temp-directory))
+		  (if (memq system-type '(ms-dos windows-nt)) "em" "emacs")))))
     (unwind-protect
 	(let (cs-r cs-w)
 	  (let (ret)
@@ -125,9 +130,6 @@
 	    (cond ((consp ret)
 		   (setq cs-r (car ret)
 			 cs-w (cdr ret)))
-		  ((null ret)
-		   (setq cs-r buffer-file-coding-system
-			 cs-w buffer-file-coding-system))
 		  ((find-coding-system ret)
 		   (setq cs-r ret
 			 cs-w ret))))
@@ -135,7 +137,10 @@
 		 (or coding-system-for-read cs-r))
 		(coding-system-for-write
 		 (or coding-system-for-write cs-w)))
-	    (write-region start end temp nil 'silent)
+	    (if (memq system-type '(ms-dos windows-nt))
+		(let ((buffer-file-type binary-process-output))
+		  (write-region start end temp nil 'silent))
+	      (write-region start end temp nil 'silent))
 	    (if deletep (delete-region start end))
 	    (apply #'call-process program temp buffer displayp args)))
       (ignore-file-errors (delete-file temp)))))
@@ -193,9 +198,9 @@
 
 See also the function `find-operation-coding-system'.")
 
-(defun open-network-stream (name buffer host service &optional protocol)
+(defun open-network-stream (name buffer host service)
   "Open a TCP connection for a service to a host.
-Return a subprocess-object to represent the connection.
+Returns a subprocess-object to represent the connection.
 Input and output work as for subprocesses; `delete-process' closes it.
 Args are NAME BUFFER HOST SERVICE.
 NAME is name for process.  It is modified if necessary to make it unique.
@@ -206,17 +211,7 @@
  with any buffer
 Third arg is name of the host to connect to, or its IP address.
 Fourth arg SERVICE is name of the service desired, or an integer
- specifying a port number to connect to.
-Fifth argument PROTOCOL is a network protocol.  Currently 'tcp
- (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
- supported.  When omitted, 'tcp is assumed.
-
-Ouput via `process-send-string' and input via buffer or filter (see
-`set-process-filter') are stream-oriented.  That means UDP datagrams are
-not guaranteed to be sent and received in discrete packets. (But small
-datagrams around 500 bytes that are not truncated by `process-send-string'
-are usually fine.)  Note further that UDP protocol does not guard against 
-lost packets."
+ specifying a port number to connect to."
   (let (cs-r cs-w)
     (let (ret)
       (catch 'found
@@ -250,6 +245,6 @@
 	   (or coding-system-for-read cs-r))
 	  (coding-system-for-write
 	   (or coding-system-for-write cs-w)))
-      (open-network-stream-internal name buffer host service protocol))))
+      (open-network-stream-internal name buffer host service))))
 
-;;; code-process.el ends here
+;;; mule-process.el ends here