Mercurial > emacs
comparison lisp/eshell/em-ls.el @ 102675:c919d46e66e4
(eshell-ls-file): Enlarge default size-width to 8.
(eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
argument nil.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 21 Mar 2009 13:01:20 +0000 |
parents | a9dc0e7c3f2b |
children | 985635bb2d2c |
comparison
equal
deleted
inserted
replaced
102674:bd7232c31c50 | 102675:c919d46e66e4 |
---|---|
504 group) 8))) | 504 group) 8))) |
505 (nth 3 attrs) | 505 (nth 3 attrs) |
506 "")) | 506 "")) |
507 (let* ((str (eshell-ls-printable-size (nth 7 attrs))) | 507 (let* ((str (eshell-ls-printable-size (nth 7 attrs))) |
508 (len (length str))) | 508 (len (length str))) |
509 (if (< len (or size-width 4)) | 509 ;; Let file sizes shorter than 9 align neatly. |
510 (concat (make-string (- (or size-width 4) len) ? ) str) | 510 (if (< len (or size-width 8)) |
511 (concat (make-string (- (or size-width 8) len) ? ) str) | |
511 str)) | 512 str)) |
512 " " (format-time-string | 513 " " (format-time-string |
513 (concat | 514 (concat |
514 "%b %e " | 515 "%b %e " |
515 (if (= (nth 5 (decode-time (current-time))) | 516 (if (= (nth 5 (decode-time (current-time))) |
563 (if (nth 7 (cdr e)) | 564 (if (nth 7 (cdr e)) |
564 (setq total (+ total (nth 7 (cdr e))) | 565 (setq total (+ total (nth 7 (cdr e))) |
565 size-width | 566 size-width |
566 (max size-width | 567 (max size-width |
567 (length (eshell-ls-printable-size | 568 (length (eshell-ls-printable-size |
568 (nth 7 (cdr e)) t)))))) | 569 (nth 7 (cdr e)) |
570 (not | |
571 ;; If we are under -l, count length | |
572 ;; of sizes in bytes, not in blocks. | |
573 (eq listing-style 'long-listing)))))))) | |
569 (funcall insert-func "total " | 574 (funcall insert-func "total " |
570 (eshell-ls-printable-size total t) "\n"))) | 575 (eshell-ls-printable-size total t) "\n"))) |
571 (let ((default-directory (expand-file-name dir))) | 576 (let ((default-directory (expand-file-name dir))) |
572 (if show-recursive | 577 (if show-recursive |
573 (eshell-ls-entries | 578 (eshell-ls-entries |