emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/disk-usage 2d6fe3c 08/48: Resolve directory statically


From: Stefan Monnier
Subject: [elpa] externals/disk-usage 2d6fe3c 08/48: Resolve directory statically in button action
Date: Tue, 19 Feb 2019 07:59:58 -0500 (EST)

branch: externals/disk-usage
commit 2d6fe3c2d25dfd5feed51a24db8e7d0aa07ab7c7
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]