emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/eshell em-ls.el


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs/lisp/eshell em-ls.el
Date: Sat, 21 Mar 2009 13:01:22 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    09/03/21 13:01:22

Modified files:
        lisp/eshell    : em-ls.el 

Log message:
        (eshell-ls-file): Enlarge default size-width to 8.
        (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
        argument nil.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/eshell/em-ls.el?cvsroot=emacs&r1=1.36&r2=1.37

Patches:
Index: em-ls.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/eshell/em-ls.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- em-ls.el    5 Jan 2009 03:21:44 -0000       1.36
+++ em-ls.el    21 Mar 2009 13:01:20 -0000      1.37
@@ -506,8 +506,9 @@
                     ""))
                (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 @@
                          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)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]