1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-30 19:53:09 +00:00

(ls-lisp-format-file-size): Format file size with 9 digits, not 8, to avoid

misalignment for files larger than 100MB.
This commit is contained in:
Eli Zaretskii 2005-11-19 11:39:36 +00:00
parent eeb935fd22
commit e0d473407c
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-11-19 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change)
* ls-lisp.el (ls-lisp-format-file-size): Format file size with 9
digits, not 8, to avoid misalignment for files larger than 100MB.
2005-11-19 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (menu-bar-describe-menu) <list-keybindings>: Mention

View File

@ -588,11 +588,11 @@ All ls time options, namely c, t and u, are handled."
(defun ls-lisp-format-file-size (file-size human-readable)
(if (or (not human-readable)
(< file-size 1024))
(format (if (floatp file-size) " %8.0f" " %8d") file-size)
(format (if (floatp file-size) " %9.0f" " %9d") 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 " %7.0f%s" file-size (car post-fixes))))))
((< file-size 1024) (format " %8.0f%s" file-size (car post-fixes))))))
(provide 'ls-lisp)