diff options
author | Eli Zaretskii <eliz@gnu.org> | 2011-04-08 18:31:33 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2011-04-08 18:31:33 +0300 |
commit | e3971c4440fc828326aaeec79d1a53638d67ed0f (patch) | |
tree | 1852d4441b5b192898e3639b5daaa1cf24cc41d8 /lisp/ls-lisp.el | |
parent | a1de6c6a0558bc86a841b3ee4b61c237748bedc2 (diff) | |
download | emacs-e3971c4440fc828326aaeec79d1a53638d67ed0f.tar.gz emacs-e3971c4440fc828326aaeec79d1a53638d67ed0f.tar.bz2 emacs-e3971c4440fc828326aaeec79d1a53638d67ed0f.zip |
New function file-size-human-readable.
lisp/files.el (file-size-human-readable): New function.
lisp/ls-lisp.el (ls-lisp-format-file-size): Use it, instead of
computing the representation inline. Don't require `cl'.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r-- | lisp/ls-lisp.el | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 55ec835831a..44e8bce5b8d 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -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" @@ -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 " %4s" (file-size-human-readable file-size)))) (provide 'ls-lisp) |