From b7e9b5b0c8c114f3416d21f8e7632fcd78afe551 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 15 Aug 2008 06:55:43 +0000 Subject: [PATCH] (eshell-ls-files): List one per line in a pipeline, unless at the end of the pipeline. (Bug#699). --- lisp/ChangeLog | 7 +++++++ lisp/eshell/em-ls.el | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db9af12b7e6..611b616d42a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-08-15 Glenn Morris + + * eshell/esh-cmd.el (eshell-do-pipelines): Indicate the last command in + a pipeline. + * eshell/em-ls.el (eshell-ls-files): List one per line in a pipeline, + unless at the end of the pipeline. (Bug#699). + 2008-08-14 Chong Yidong * minibuffer.el (completion-boundaries): Doc fix. diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index db256bd8c9d..eb3389ce7cf 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -635,7 +635,14 @@ In Eshell's implementation of ls, ENTRIES is always reversed." "Output a list of FILES. Each member of FILES is either a string or a cons cell of the form \(FILE . ATTRS)." - (if (memq listing-style '(long-listing single-column)) + ;; Mimic behavior of coreutils ls, which lists a single file per + ;; line when output is not a tty. Exceptions: if -x was supplied, + ;; or if we are the _last_ command in a pipeline. + ;; FIXME Not really the same since not testing output destination. + (if (or (and eshell-in-pipeline-p + (not (eq eshell-in-pipeline-p 'last)) + (not (eq listing-style 'by-lines))) + (memq listing-style '(long-listing single-column))) (eshell-for file files (if file (eshell-ls-file file size-width copy-fileinfo))) -- 2.39.2