# HG changeset patch # User Glenn Morris # Date 1218783337 0 # Node ID ed4b73533ff6959b79307e848fddd6454d4d6e77 # Parent 3c44de892298791f6e663c0dd9d1cbc4ee2c138b (eshell-ls-files): List one per line in a pipeline, unless at the end of the pipeline. (Bug#699). diff -r 3c44de892298 -r ed4b73533ff6 lisp/eshell/em-ls.el --- a/lisp/eshell/em-ls.el Fri Aug 15 06:55:11 2008 +0000 +++ b/lisp/eshell/em-ls.el Fri Aug 15 06:55:37 2008 +0000 @@ -635,7 +635,14 @@ "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)))