diff lisp/eshell/esh-io.el @ 31241:3099993cba0f

See ChangeLog
author John Wiegley <johnw@newartisans.com>
date Tue, 29 Aug 2000 00:47:45 +0000
parents 34b1ab9d583d
children 8e57189d61b4
line wrap: on
line diff
--- a/lisp/eshell/esh-io.el	Tue Aug 29 00:37:10 2000 +0000
+++ b/lisp/eshell/esh-io.el	Tue Aug 29 00:47:45 2000 +0000
@@ -132,8 +132,8 @@
 output function.  Otherwise, the second element itself is the output
 function.
 
-The output function is then called repeatedly with a single strings,
-with represents success pieces of the output of the command, until nil
+The output function is then called repeatedly with single strings,
+which represents successive pieces of the output of the command, until nil
 is passed, meaning EOF.
 
 NOTE: /dev/null is handled specially as a virtual target, and should
@@ -231,7 +231,9 @@
   (standard-output output-mode &optional standard-error error-mode)
   "Create a new set of file handles for a command.
 The default location for standard output and standard error will go to
-STANDARD-OUTPUT and STANDARD-ERROR, respectively."
+STANDARD-OUTPUT and STANDARD-ERROR, respectively.
+OUTPUT-MODE and ERROR-MODE are either `overwrite', `append' or `insert';
+a nil value of mode defaults to `insert'."
   (let ((handles (make-vector eshell-number-of-handles nil))
 	(output-target (eshell-get-target standard-output output-mode))
 	(error-target (eshell-get-target standard-error error-mode)))
@@ -272,7 +274,7 @@
 
    ;; If we're redirecting to a process (via a pipe, or process
    ;; redirection), send it EOF so that it knows we're finished.
-   ((processp target)
+   ((eshell-processp target)
     (if (eq (process-status target) 'run)
 	(process-send-eof target)))
 
@@ -326,7 +328,8 @@
 
 (defun eshell-get-target (target &optional mode)
   "Convert TARGET, which is a raw argument, into a valid output target.
-MODE is either `overwrite', `append' or `insert'."
+MODE is either `overwrite', `append' or `insert'; if it is omitted or nil,
+it defaults to `insert'."
   (setq mode (or mode 'insert))
   (cond
    ((stringp target)
@@ -367,7 +370,7 @@
     (if (eq mode 'overwrite)
 	(set target nil))
     target)
-   ((or (processp target)
+   ((or (eshell-processp target)
 	(markerp target))
     target)
    (t
@@ -394,7 +397,7 @@
 	(if (and (listp current)
 		 (not (member where current)))
 	    (setq current (append current (list where)))
-	  (setq current (list where)))
+	  (setq current where))
 	(if (not (aref eshell-current-handles index))
 	    (aset eshell-current-handles index (cons nil 1)))
 	(setcar (aref eshell-current-handles index) current)))))
@@ -438,20 +441,20 @@
 	  eshell-print-queue-count (1+ eshell-print-queue-count))))
 
 (defsubst eshell-print (object)
-  "Output OBJECT to the error handle."
+  "Output OBJECT to the standard output handle."
   (eshell-output-object object eshell-output-handle))
 
 (defsubst eshell-error (object)
-  "Output OBJECT to the error handle."
+  "Output OBJECT to the standard error handle."
   (eshell-output-object object eshell-error-handle))
 
 (defsubst eshell-errorn (object)
-  "Output OBJECT to the error handle."
+  "Output OBJECT followed by a newline to the standard error handle."
   (eshell-error object)
   (eshell-error "\n"))
 
 (defsubst eshell-printn (object)
-  "Output OBJECT to the error handle."
+  "Output OBJECT followed by a newline to the standard output handle."
   (eshell-print object)
   (eshell-print "\n"))
 
@@ -485,7 +488,7 @@
 	    (if moving
 		(goto-char target))))))
 
-   ((processp target)
+   ((eshell-processp target)
     (when (eq (process-status target) 'run)
       (setq object (eshell-stringify object))
       (process-send-string target object)))