summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-08-15 06:52:23 +0000
committerGlenn Morris <rgm@gnu.org>2008-08-15 06:52:23 +0000
commit56608bca7498d1bff8a5422eae5055e043888651 (patch)
tree79be98e09d8a55c68a3d5815ad592fdf91d751f5
parentcf10b65ebef41b7e958b0ffbbf46d96ce1d16f96 (diff)
downloademacs-56608bca7498d1bff8a5422eae5055e043888651.tar.gz
(eshell-ls-files): List one per line in a pipeline. (Bug#699)
-rw-r--r--lisp/eshell/em-ls.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index a31fb26b5f1..bdfe66420fb 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -638,7 +638,12 @@ 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.
+ ;; Not really the same since not testing output destination.
+ (if (or (and eshell-in-pipeline-p
+ (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)))