[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/disk-usage 3ffaf8e 14/48: Fix header display
From: |
Stefan Monnier |
Subject: |
[elpa] externals/disk-usage 3ffaf8e 14/48: Fix header display |
Date: |
Tue, 19 Feb 2019 07:59:59 -0500 (EST) |
branch: externals/disk-usage
commit 3ffaf8e47f2ba3bb1fb0486a1907638ffa229ba9
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>
Fix header display
---
disk-usage.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/disk-usage.el b/disk-usage.el
index b2d1ee3..e7bfbbf 100644
--- a/disk-usage.el
+++ b/disk-usage.el
@@ -143,16 +143,19 @@ This is slow but does not require any external process."
disk-usage--du-args path))
(buffer-string))))))
-(defun disk-usage--set-format (total-size)
+(defun disk-usage--set-format (&optional total-size)
(setq tabulated-list-format
`[("Size"
,(if (eq disk-usage--format-size #'file-size-human-readable)
8
12)
,disk-usage--sort . (:right-align t))
- (,(format "Files totalling %sB (%s) in '%s'"
- total-size
- (file-size-human-readable total-size)
+ (,(format "Files %sin '%s'"
+ (if total-size
+ (format "totalling %sB (%s) "
+ total-size
+ (file-size-human-readable total-size))
+ "")
default-directory)
0 t)]))
@@ -161,6 +164,7 @@ This is slow but does not require any external process."
;; TODO: Set tabulated-list-entries to a function?
(let ((listing (disk-usage--list directory)))
(disk-usage--set-format (disk-usage--total listing))
+ (tabulated-list-init-header)
(setq tabulated-list-entries
(mapcar (lambda (e)
(list e (vector (number-to-string (aref e 0))
@@ -259,8 +263,7 @@ beings."
;; TODO: Option to display extra attributes and default column to sort.
(setq tabulated-list-sort-key (cons "Size" 'flip))
(setq tabulated-list-printer #'disk-usage--print-entry)
- (add-hook 'tabulated-list-revert-hook 'disk-usage--refresh nil t)
- (tabulated-list-init-header))
+ (add-hook 'tabulated-list-revert-hook 'disk-usage--refresh nil t))
;;;###autoload
(defun disk-usage (&optional directory)
- [elpa] externals/disk-usage aa3996e 24/48: Default to disk-usage--list, (continued)
- [elpa] externals/disk-usage aa3996e 24/48: Default to disk-usage--list, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 90607dc 23/48: Use file-info structure instead of vectors, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage ed9dc23 11/48: Keep cursor on current entry when re-ordering buffer, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage dcfbd19 29/48: Rename sort functions, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 0c135ed 21/48: Handle inaccessible directories, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 19103ba 42/48: Add unmark-at-point, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 3357ba9 32/48: Include screenshots, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 2626642 15/48: Remove spurious "evil" keyword, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage eefa57f 28/48: Turn disk-usage-size-format-function into a defcustom, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage af22dd4 13/48: Display symlinks when not displaying full paths, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 3ffaf8e 14/48: Fix header display,
Stefan Monnier <=
- [elpa] externals/disk-usage 7fe5f1b 40/48: Fix keymap setup in disk-usage-by-types-mode, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage d959b7b 36/48: Display % column and sort types by total size, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 3bbb09a 44/48: Right-align columns with units, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 441abf9 20/48: Add disk-usage-by-types, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 2d6fe3c 08/48: Resolve directory statically in button action, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 5998d42 41/48: Version 1.0.0, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 21b5749 38/48: Add disk-usage-files, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage e44979a 45/48: Version 1.1.0, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage 696dd5c2 17/48: Fix free references, Stefan Monnier, 2019/02/19
- [elpa] externals/disk-usage c55d478 34/48: Document modes and prefix argument, Stefan Monnier, 2019/02/19