Mercurial > emacs
comparison lisp/eshell/em-ls.el @ 97484:ed4b73533ff6
(eshell-ls-files): List one per line in a pipeline, unless at the end
of the pipeline. (Bug#699).
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 15 Aug 2008 06:55:37 +0000 |
parents | 45dbb3c749a6 |
children | f79ec7c34dc5 |
comparison
equal
deleted
inserted
replaced
97483:3c44de892298 | 97484:ed4b73533ff6 |
---|---|
633 | 633 |
634 (defun eshell-ls-files (files &optional size-width copy-fileinfo) | 634 (defun eshell-ls-files (files &optional size-width copy-fileinfo) |
635 "Output a list of FILES. | 635 "Output a list of FILES. |
636 Each member of FILES is either a string or a cons cell of the form | 636 Each member of FILES is either a string or a cons cell of the form |
637 \(FILE . ATTRS)." | 637 \(FILE . ATTRS)." |
638 (if (memq listing-style '(long-listing single-column)) | 638 ;; Mimic behavior of coreutils ls, which lists a single file per |
639 ;; line when output is not a tty. Exceptions: if -x was supplied, | |
640 ;; or if we are the _last_ command in a pipeline. | |
641 ;; FIXME Not really the same since not testing output destination. | |
642 (if (or (and eshell-in-pipeline-p | |
643 (not (eq eshell-in-pipeline-p 'last)) | |
644 (not (eq listing-style 'by-lines))) | |
645 (memq listing-style '(long-listing single-column))) | |
639 (eshell-for file files | 646 (eshell-for file files |
640 (if file | 647 (if file |
641 (eshell-ls-file file size-width copy-fileinfo))) | 648 (eshell-ls-file file size-width copy-fileinfo))) |
642 (let ((f files) | 649 (let ((f files) |
643 last-f | 650 last-f |