branch: externals/disk-usage commit 2d6fe3c2d25dfd5feed51a24db8e7d0aa07ab7c7 Author: Pierre Neidhardt <m...@ambrevar.xyz> Commit: Pierre Neidhardt <m...@ambrevar.xyz>
Resolve directory statically in button action --- disk-usage.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/disk-usage.el b/disk-usage.el index 4fd0a2e..f801a7e 100644 --- a/disk-usage.el +++ b/disk-usage.el @@ -163,10 +163,14 @@ This is slow but does not require any external process." (let ((listing (disk-usage--list directory))) (disk-usage--set-format (disk-usage--total listing)) (setq tabulated-list-entries - (mapcar (lambda (e) (list nil (vector (number-to-string (aref e 0)) - (if (file-directory-p (aref e 1)) - (cons (aref e 1) (list 'action (lambda (s) (disk-usage (button-label s))))) - (aref e 1))))) + (mapcar (lambda (e) + (list nil (vector (number-to-string (aref e 0)) + (if (file-directory-p (aref e 1)) + (cons (aref e 1) + (list 'action + (lambda (_) + (disk-usage (aref e 1))))) + (aref e 1))))) listing)))) (defun disk-usage--sort-size-< (a b)