]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell-ls-file): Enlarge default size-width to 8.
authorEli Zaretskii <eliz@gnu.org>
Sat, 21 Mar 2009 13:01:20 +0000 (13:01 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 21 Mar 2009 13:01:20 +0000 (13:01 +0000)
(eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
argument nil.

lisp/eshell/em-ls.el

index 468d190c2bc01aadb1abf22d320cea6ac36b7f50..ddf335254118a1e961b01eab387dfa59d5853528 100644 (file)
@@ -506,8 +506,9 @@ whose cdr is the list of file attributes."
                     ""))
                (let* ((str (eshell-ls-printable-size (nth 7 attrs)))
                       (len (length str)))
-                 (if (< len (or size-width 4))
-                     (concat (make-string (- (or size-width 4) len) ? ) str)
+                 ;; Let file sizes shorter than 9 align neatly.
+                 (if (< len (or size-width 8))
+                     (concat (make-string (- (or size-width 8) len) ? ) str)
                    str))
                " " (format-time-string
                     (concat
@@ -565,7 +566,11 @@ relative to that directory."
                          size-width
                          (max size-width
                               (length (eshell-ls-printable-size
-                                       (nth 7 (cdr e)) t))))))
+                                       (nth 7 (cdr e))
+                                       (not
+                                        ;; If we are under -l, count length
+                                        ;; of sizes in bytes, not in blocks.
+                                        (eq listing-style 'long-listing))))))))
              (funcall insert-func "total "
                       (eshell-ls-printable-size total t) "\n")))
          (let ((default-directory (expand-file-name dir)))