[Emacs] Fix Eshell banner

Fix reference to undefined variable

Fix incorrect calculation of usage percentage of memory
This commit is contained in:
Lucien Cartier-Tilet 2020-12-10 09:08:22 +01:00
parent 880a0e14df
commit 0a54b4d67f
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -1664,7 +1664,7 @@ Now, we can get our partitions. For this, well make a call to the shell comma
(mount (nth 5 partition)))
(when (s-prefix? "/dev" filesystem)
(make-phundrak/mounted-partitions
:path (if (> phundrak--max-length-path (length mount))
:path (if (> phundrak//eshell-banner--max-length (length mount))
mount
(phundrak/abbr-path mount t))
:size size
@ -1724,7 +1724,7 @@ This function will be used in two distinct functions: ~phundrak/eshell-banner~ w
(defun phundrak//eshell-banner--display-memory (type used total text-padding ramp-length)
(let ((percentage (if (= used 0)
0
(/ total used))))
(/ (* 100 used) total))))
(concat (s-pad-right text-padding "." type)
": "
(phundrak//eshell-banner--progress-bar ramp-length