]> code.delx.au - gnu-emacs/blobdiff - lisp/ls-lisp.el
Simplify url handling in rcirc-mode
[gnu-emacs] / lisp / ls-lisp.el
index 55ec835831aff29be6cf28281e3292b752e1a07b..14a8cabf1a74384a1b892bd751aed3cb9842da8f 100644 (file)
@@ -62,8 +62,6 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
-
 (defgroup ls-lisp nil
   "Emulate the ls program completely in Emacs Lisp."
   :version "21.1"
@@ -331,7 +329,7 @@ not contain `d', so that a full listing is expected."
             (max-gid-len 0)
             (max-file-size 0)
             ;; do all bindings here for speed
-            total-line files elt short file-size fil attr
+            total-line files elt short file-size attr
             fuid fgid uid-len gid-len)
        (cond ((memq ?A switches)
               (setq file-alist
@@ -726,13 +724,7 @@ All ls time options, namely c, t and u, are handled."
                  ls-lisp-filesize-f-fmt
                ls-lisp-filesize-d-fmt)
              file-size)
-    (if (< file-size 1024)
-       (format " %4d" file-size)
-      (do ((file-size (/ file-size 1024.0) (/ file-size 1024.0))
-          ;; kilo, mega, giga, tera, peta, exa
-          (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes)))
-         ((< file-size 1024)
-          (format " %3.0f%s"  file-size (car post-fixes)))))))
+    (format " %7s" (file-size-human-readable file-size))))
 
 (provide 'ls-lisp)