[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/disk-usage 6ab1504 1/3: Fix TRAMP support further
From: |
Pierre Neidhardt |
Subject: |
[elpa] externals/disk-usage 6ab1504 1/3: Fix TRAMP support further |
Date: |
Sun, 3 Mar 2019 14:43:48 -0500 (EST) |
branch: externals/disk-usage
commit 6ab1504bfb8105130393b7746b54abbc478338d8
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>
Fix TRAMP support further
It works with /sudo:: now.
---
disk-usage.el | 30 +++++++++++++++++-------------
readme.org | 3 +++
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/disk-usage.el b/disk-usage.el
index 622ab05..2114ec7 100644
--- a/disk-usage.el
+++ b/disk-usage.el
@@ -263,7 +263,7 @@ See `disk-usage-add-filters' and
`disk-usage-remove-filters'.")
(and (file-accessible-directory-p directory)
(directory-files-and-attributes
directory
- 'full nil 'nosort)))))
+ 'full directory-files-no-dot-files-regexp
'nosort)))))
(or (cl-loop for l in listing
for attributes = (cl-rest l)
for path = (cl-first l)
@@ -280,9 +280,7 @@ See `disk-usage-add-filters' and
`disk-usage-remove-filters'.")
:name path
:size (file-attribute-size attributes))
;; Folders
- else if (and (eq t (file-attribute-type attributes))
- (not (string= "." (file-name-base path)))
- (not (string= ".." (file-name-base path))))
+ else if (eq t (file-attribute-type attributes))
collect
(disk-usage--file-info-make
:name path
@@ -299,15 +297,21 @@ $ find . -type f -exec du -sb {} +"
(let* ((default-directory directory)
;; Note: Cannot use `process-lines' if we want to work on remote
hosts.
(subdirs (split-string
- (with-temp-buffer
- (process-file disk-usage-find-command nil '(t nil)
nil
- (file-local-name directory)
- "-type" "d")
- (buffer-string))
- "\n" 'omit-nulls)))
- (cl-loop for dir in subdirs
- append (cl-loop for file in (directory-files-and-attributes dir
'full nil 'nosort)
- for name = (concat (file-remote-p directory) (car
file))
+ (with-temp-buffer
+ (process-file disk-usage-find-command nil '(t nil) nil
+ (file-local-name directory)
+ "-type" "d")
+ (buffer-string))
+ "\n" 'omit-nulls))
+ (remote-subdirs (mapcar (lambda (item)
+ (concat (file-remote-p directory) item))
+ subdirs)))
+ (cl-loop for dir in remote-subdirs
+ append (cl-loop for file in (directory-files-and-attributes dir
+ 'full
+
directory-files-no-dot-files-regexp
+
'nosort)
+ for name = (car file)
for attributes = (cdr file)
when (and attributes
(not (file-attribute-type attributes))
diff --git a/readme.org b/readme.org
index e1ad843..a45fea5 100644
--- a/readme.org
+++ b/readme.org
@@ -45,6 +45,9 @@ With ~disk-usage-add-filters~ you can filter out files with
arbitrary
predicates, e.g. files bigger than some size or older than a certain number of
days.
+~disk-usage~ also works with TRAMP, i.e. in folders with restricted-acess like
+=/sudo::/root= or on remote machines.
+
You can customize options in the =disk-usage= group.
* Screenshots