[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/disk-usage 7b14829 22/26: Normalize filter names
From: |
Pierre Neidhardt |
Subject: |
[elpa] externals/disk-usage 7b14829 22/26: Normalize filter names |
Date: |
Tue, 26 Feb 2019 03:06:40 -0500 (EST) |
branch: externals/disk-usage
commit 7b148294a2807ce770b37bb6a7c54080be459990
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>
Normalize filter names
---
disk-usage.el | 43 +++++++++++++++++++++++++++----------------
1 file changed, 27 insertions(+), 16 deletions(-)
diff --git a/disk-usage.el b/disk-usage.el
index 01667f2..63b7fd9 100644
--- a/disk-usage.el
+++ b/disk-usage.el
@@ -134,7 +134,8 @@
(interactive)
(clrhash disk-usage--cache))
-(defun disk-usage-filter-1-hour (_path attributes &optional seconds)
+(defun disk-usage-filter-1-hour> (_path attributes &optional seconds)
+ "Discard regular files older than 1 hour."
(if (null (file-attribute-type attributes))
;; Regular files
(time-less-p
@@ -144,7 +145,8 @@
;; Always keep directories and symlinks.
t))
-(defun disk-usage-filter-1-day (_path attributes &optional days)
+(defun disk-usage-filter-1-day> (_path attributes &optional days)
+ "Discard regular files older than 1 day."
(if (null (file-attribute-type attributes))
;; Regular files
(time-less-p
@@ -154,28 +156,37 @@
;; Always keep directories and symlinks.
t))
-(defun disk-usage-filter-1-week (path attributes)
- (disk-usage-filter-1-day path attributes 7))
+(defun disk-usage-filter-1-week> (path attributes)
+ (disk-usage-filter-1-day> path attributes 7))
-(defun disk-usage-filter-4-weeks (path attributes)
- (disk-usage-filter-1-day path attributes 28))
+(defun disk-usage-filter-4-weeks> (path attributes)
+ (disk-usage-filter-1-day> path attributes 28))
-(defun disk-usage-filter-1M-size (_path attributes &optional size)
+(defun disk-usage-filter-1-MiB> (_path attributes &optional size)
+ "Discard regular files bigger than 1 MiB."
(if (null (file-attribute-type attributes))
;; Regular files
- (> (file-attribute-size attributes) (or size (* 1024 1024)))
+ (< (file-attribute-size attributes) (or size (* 1024 1024)))
;; Always keep directories and symlinks.
t))
-(defun disk-usage-filter-10M-size (path attributes)
- (disk-usage-filter-1M-size path attributes (* 10 1024 1024)))
+(defun disk-usage-filter-10-MiB> (path attributes)
+ (disk-usage-filter-1-MiB> path attributes (* 10 1024 1024)))
-(defcustom disk-usage-available-filters '(disk-usage-filter-1-hour
- disk-usage-filter-1-day
- disk-usage-filter-1-week
- disk-usage-filter-4-week
- disk-usage-filter-1M-size
- disk-usage-filter-10M-size)
+(defun disk-usage-filter-100-MiB> (path attributes)
+ (disk-usage-filter-1-MiB> path attributes (* 100 1024 1024)))
+
+(defun disk-usage-filter-1-GiB> (path attributes)
+ (disk-usage-filter-1-MiB> path attributes (* 1024 1024 1024)))
+
+(defcustom disk-usage-available-filters '(disk-usage-filter-1-hour>
+ disk-usage-filter-1-day>
+ disk-usage-filter-1-week>
+ disk-usage-filter-4-weeks>
+ disk-usage-filter-1-MiB>
+ disk-usage-filter-10-MiB>
+ disk-usage-filter-100-MiB>
+ disk-usage-filter-1-GiB>)
"Filters can be used to leave out files from the listing.
A filter is a function that takes a path and file attributes and
- [elpa] externals/disk-usage bcae407 21/26: Replace (delq (mapcar ...)) with cl-loop, (continued)
- [elpa] externals/disk-usage bcae407 21/26: Replace (delq (mapcar ...)) with cl-loop, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 54d4aee 25/26: Propertize size, percent and children columns, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 8bf5d5c 08/26: Break some long lines, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 0fff6a8 12/26: Fix 'nil' children issue on inaccessible directories, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage a53be8d 26/26: Version 1.2.0, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 6a01954 05/26: Rename disk-usage--path-at-point -> disk-usage--file-name-at-point, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 364c62b 20/26: Bind "a" and "A" to filter commands in disk-usage-by-types, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 6a214bc 09/26: Add many docstrings, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 488ddc8 14/26: Add support for filters, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 7708379 07/26: Use process-file instead of call-process, Pierre Neidhardt, 2019/02/26
- [elpa] externals/disk-usage 7b14829 22/26: Normalize filter names,
Pierre Neidhardt <=
- [elpa] externals/disk-usage 2d36a87 04/26: Fix disk-usage--path-at-point to return directory, Pierre Neidhardt, 2019/02/26