[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive bf955d34d3 28/32: Add/Change: (hyperdrive-colum
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive bf955d34d3 28/32: Add/Change: (hyperdrive-column-headers) |
Date: |
Mon, 4 Sep 2023 18:59:35 -0400 (EDT) |
branch: elpa/hyperdrive
commit bf955d34d32d7e384696be0a5dbe4bb3e8840d6a
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add/Change: (hyperdrive-column-headers)
---
hyperdrive-handlers.el | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/hyperdrive-handlers.el b/hyperdrive-handlers.el
index 7825566f9e..9e75000aa7 100644
--- a/hyperdrive-handlers.el
+++ b/hyperdrive-handlers.el
@@ -113,13 +113,7 @@ arguments."
:encode t))
entry-names))
(parent-entry (hyperdrive-parent directory-entry))
- (main-header (hyperdrive-entry-description directory-entry))
- (header (concat main-header "\n"
- (format "%6s %s %s"
- (propertize "Size" 'face
'hyperdrive-column-header)
- (format
hyperdrive-timestamp-format-string
- (propertize "Last Modified"
'face 'hyperdrive-column-header))
- (propertize "Name" 'face
'hyperdrive-column-header))))
+ (header (hyperdrive-column-headers
(hyperdrive-entry-description directory-entry)))
(num-entries (length entries)) (num-filled 0)
;; (debug-start-time (current-time))
(metadata-queue) (ewoc) (prev-entry) (prev-point))
@@ -179,6 +173,34 @@ arguments."
(when then
(funcall then)))))))
+(defun hyperdrive-column-headers (prefix)
+ "Return column headers as a string with PREFIX.
+Columns are suffixed with up/down arrows according to
+`hyperdrive-sort-entries'."
+ (let ((name-arrow "") (size-arrow "") (date-arrow ""))
+ (pcase-exhaustive hyperdrive-directory-sort
+ (`(hyperdrive-entry-name . ,predicate)
+ (setf name-arrow (pcase-exhaustive predicate
+ ('string< "▲")
+ ('string> "▼"))))
+ (`(hyperdrive-entry-size . ,predicate)
+ (setf size-arrow (pcase-exhaustive predicate
+ ('< "▲")
+ ('> "▼"))))
+ (`(hyperdrive-entry-date . ,predicate)
+ (setf date-arrow (pcase-exhaustive predicate
+ ('time-less-p< "▲")
+ ((pred functionp) "▼")))))
+ (concat prefix "\n"
+ (format "%6s%s %s%s %s%s"
+ (propertize "Size" 'face 'hyperdrive-column-header)
+ size-arrow
+ (format hyperdrive-timestamp-format-string
+ (propertize "Last Modified" 'face
'hyperdrive-column-header))
+ date-arrow
+ (propertize "Name" 'face 'hyperdrive-column-header)
+ name-arrow))))
+
(cl-defun hyperdrive-handler-streamable (entry &key _then)
;; TODO: Is there any reason to not pass THEN through?
;; FIXME: Opening a streamable entry from a hyperdrive-dir buffer
- [nongnu] elpa/hyperdrive beb1f180fa 11/32: Tidy: (hyperdrive-dir-sort) Nest to avoid setf, (continued)
- [nongnu] elpa/hyperdrive beb1f180fa 11/32: Tidy: (hyperdrive-dir-sort) Nest to avoid setf, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 2b1ab2ba8e 15/32: Comment: (hyperdrive-sort-entries) Explain sorting behavior, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive b7bba05ca5 13/32: Fix: (hyperdrive-entry-create) Docstring, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive c56644f9ea 14/32: Tidy: Whitespace, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 45802e59cc 18/32: Fix: (hyperdrive-handler-directory) Ensure buffer-modified-p nil, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive bd440b6465 27/32: Remove: (hyperdrive-column-headers), ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 27c1a81a51 32/32: Merge branch 'wip/dir-sort', ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive c2af53e72d 07/32: Add: (hyperdrive-dir-sort, hyperdrive-complete-sort), ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 994b782630 09/32: Comment: Add TODO, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive aa969e7bf5 10/32: Add: Progress report in footer, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive bf955d34d3 28/32: Add/Change: (hyperdrive-column-headers),
ELPA Syncer <=
- [nongnu] elpa/hyperdrive de8a963986 05/32: WIP, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive d75559667b 06/32: WIP, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 126f767a46 12/32: Comment: Add TODO, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 7d20ba30ad 19/32: Fix/Change: Use hyperdrive-queue-size everywhere, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive fb915a005c 25/32: Comment: Add TODO, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 9100b1e748 29/32: Fix: (hyperdrive-column-headers), ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 369ec34f4f 21/32: Comment: Remove TODO, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 899202254b 23/32: Comment: Remove TODO, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 383c1c606e 17/32: Docs: Document hyperdrive-dir-sort, ELPA Syncer, 2023/09/04
- [nongnu] elpa/hyperdrive 32b319d850 20/32: Meta: Update changelog, ELPA Syncer, 2023/09/04