[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/eshell esh-cmd.el
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] emacs/lisp/eshell esh-cmd.el |
Date: |
Sun, 23 Nov 2008 03:02:49 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Glenn Morris <gm> 08/11/23 03:02:49
Modified files:
lisp/eshell : esh-cmd.el
Log message:
(eshell-in-pipeline-p): Add doc-string.
(eshell-do-pipelines): Add optional argument to distinguish recursive
calls. Use to set eshell-in-pipeline-p to 'first for the first command
in a pipeline.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/eshell/esh-cmd.el?cvsroot=emacs&r1=1.44&r2=1.45
Patches:
Index: esh-cmd.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/eshell/esh-cmd.el,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- esh-cmd.el 8 Oct 2008 07:42:43 -0000 1.44
+++ esh-cmd.el 23 Nov 2008 03:02:48 -0000 1.45
@@ -274,7 +274,10 @@
(defvar eshell-current-command nil)
(defvar eshell-command-name nil)
(defvar eshell-command-arguments nil)
-(defvar eshell-in-pipeline-p nil)
+(defvar eshell-in-pipeline-p nil
+ "Internal Eshell variable, non-nil inside a pipeline.
+Has the value 'first, 'last for the first/last commands in the pipeline,
+otherwise t.")
(defvar eshell-in-subcommand-p nil)
(defvar eshell-last-arguments nil)
(defvar eshell-last-command-name nil)
@@ -816,8 +819,9 @@
(eshell-protect-handles eshell-current-handles)
,object))
-(defmacro eshell-do-pipelines (pipeline)
- "Execute the commands in PIPELINE, connecting each to one another."
+(defmacro eshell-do-pipelines (pipeline &optional notfirst)
+ "Execute the commands in PIPELINE, connecting each to one another.
+This macro calls itself recursively, with NOTFIRST non-nil."
(when (setq pipeline (cadr pipeline))
`(eshell-copy-handles
(progn
@@ -825,7 +829,7 @@
`(let (nextproc)
(progn
(set 'nextproc
- (eshell-do-pipelines (quote ,(cdr pipeline))))
+ (eshell-do-pipelines (quote ,(cdr pipeline)) t))
(eshell-set-output-handle ,eshell-output-handle
'append nextproc)
(eshell-set-output-handle ,eshell-error-handle
@@ -839,10 +843,13 @@
(setcar head
(intern-soft
(concat (symbol-name (car head)) "*"))))))
- ;; Indicate to the command if it is the last in the pipeline.
- ;; Currently only used by eshell-ls-files.
- ;; Perhaps nil, rather than 'last, would be OK?
- (let ((eshell-in-pipeline-p ,(if (cdr pipeline) t (quote 'last))))
+ ;; First and last elements in a pipeline may need special treatment.
+ ;; (Currently only eshell-ls-files uses 'last.)
+ ;; Affects process-connection-type in eshell-gather-process-output.
+ (let ((eshell-in-pipeline-p
+ ,(cond ((not notfirst) (quote 'first))
+ ((cdr pipeline) t)
+ (t (quote 'last)))))
,(car pipeline))))))
(defmacro eshell-do-pipelines-synchronously (pipeline)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/lisp/eshell esh-cmd.el,
Glenn Morris <=