diff options
author | jao <jao@gnu.org> | 2022-09-16 02:48:18 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-16 02:48:18 +0100 |
commit | e01de415c020d900e347833a24ee45bb8fe222be (patch) | |
tree | 8c48d4272ccb37dcbdec77b537bf519b7a27052e /lib/eos | |
parent | 87af94ca96f02384c270f8f30684693e8aee7e0a (diff) | |
download | elibs-e01de415c020d900e347833a24ee45bb8fe222be.tar.gz elibs-e01de415c020d900e347833a24ee45bb8fe222be.tar.bz2 |
jao-dirmon: show also negative deltas
Diffstat (limited to 'lib/eos')
-rw-r--r-- | lib/eos/jao-dirmon.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/eos/jao-dirmon.el b/lib/eos/jao-dirmon.el index ab267fc..9d748d1 100644 --- a/lib/eos/jao-dirmon.el +++ b/lib/eos/jao-dirmon.el @@ -44,11 +44,12 @@ (defun jao-dirmon--show-deltas (old current deltas) (with-temp-buffer (insert "High deltas since " (car old) "\n\n") - (dolist (d deltas) + (dolist (d (seq-sort-by #'cdr #'> deltas)) (insert (format "- %s: %s Mb\n" (car d) (cdr d)))) (insert "\n\nSizeable dirs\n\n") - (dolist (c (seq-sort-by #'cdr #'> current)) - (when (> (cdr c) jao-dirmon-threshold) + (let ((threshold (* 10 jao-dirmon-threshold))) + (dolist (c (seq-take-while (lambda (x) (> (cdr x) threshold)) + (seq-sort-by #'cdr #'> current))) (insert (format "- %s: %s Mb\n" (car c) (cdr c))))) (beginning-of-buffer) (pop-to-buffer (current-buffer) nil t) @@ -64,7 +65,7 @@ (high ())) (dolist (c current) (let ((d (- (cdr c) (alist-get (car c) old 0 nil #'string=)))) - (when (> d jao-dirmon-threshold) + (when (> (abs d) jao-dirmon-threshold) (push c high)))) (setq jao-dirmon-last-delta high) (jao-dirmon--show-deltas old current jao-dirmon-last-delta) |