[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 09e4dba5b2 14/30: Tidy: (hyperdrive-dir-column-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 09e4dba5b2 14/30: Tidy: (hyperdrive-dir-column-headers) let-bind selected/arrow-after |
Date: |
Wed, 6 Sep 2023 18:59:43 -0400 (EDT) |
branch: elpa/hyperdrive
commit 09e4dba5b2cea492c0f3f995e2303d3fcd9685be
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Tidy: (hyperdrive-dir-column-headers) let-bind selected/arrow-after
---
hyperdrive-dir.el | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/hyperdrive-dir.el b/hyperdrive-dir.el
index 2cf84ed072..123ebb7dd0 100644
--- a/hyperdrive-dir.el
+++ b/hyperdrive-dir.el
@@ -127,24 +127,20 @@ Columns are suffixed with up/down arrows according to
'face 'hyperdrive-header-arrow))
(headers))
(pcase-dolist (`(,column . ,(map (:desc desc))) hyperdrive-dir-sort-fields)
- (push (propertize
- (concat (and (eq column sort-column)
- ;; For right-aligned columns, put the arrow before
desc.
- (or (eq column 'size)
- (eq column 'mtime))
- arrow)
- (propertize desc 'face 'hyperdrive-column-header)
- (and (eq column sort-column)
- ;; For left-aligned columns, put the arrow after
desc.
- (eq column 'name)
- arrow))
- 'keymap
- (define-keymap
- "<mouse-1>" (lambda (&optional _e)
- (interactive "e")
- (hyperdrive-dir-sort
- (hyperdrive-dir-toggle-sort-direction column
hyperdrive-directory-sort)))))
- headers))
+ (let ((selected (eq column sort-column))
+ ;; Put the arrow after desc, since the column is left-aligned.
+ (arrow-after (eq column 'name)))
+ (push (propertize
+ (concat (and selected (not arrow-after) arrow)
+ (propertize desc 'face 'hyperdrive-column-header)
+ (and selected arrow-after arrow))
+ 'keymap
+ (define-keymap
+ "<mouse-1>" (lambda (&optional _e)
+ (interactive "e")
+ (hyperdrive-dir-sort
+ (hyperdrive-dir-toggle-sort-direction column
hyperdrive-directory-sort)))))
+ headers)))
(concat prefix "\n"
(apply #'format (concat "%6s " hyperdrive-timestamp-format-string
" %s")
(nreverse headers)))))
- [nongnu] elpa/hyperdrive updated (9e27c5c43a -> fcda78fd06), ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 2d40411cc3 06/30: Change/Fix: (hyperdrive-dir-sort) Leave buffer-modified-p nil, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive f336801c0f 20/30: Change: (hyperdrive-dir-column-headers) Highlight selected header, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive ff71f006dc 02/30: Change: (-directory-sort) Use :ascending and :descending keywords, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 736f2e9d03 01/30: Change: (hyperdrive--fill) Check writability based on Allow header, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive dbbe0ecd43 05/30: Add: (hyperdrive-time-greater-p) Inverse of time-less-p, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 6d41b67aab 04/30: Comment: Add TODO, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 838b34927c 03/30: Change: (hyperdrive-sort-entries) Rename BY argument to DIRECTION, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 5f1d617ae1 11/30: Change: (hyperdrive-dir-sort-fields) Add description, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 09e4dba5b2 14/30: Tidy: (hyperdrive-dir-column-headers) let-bind selected/arrow-after,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 57d02e33f4 15/30: Change: (hyperdrive-dir-column-headers) Add mouse-face, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 303109d76e 19/30: Fix: Typo, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 8d47207e21 21/30: Docs: Document clickable directory column headers, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive dc54ccbfbf 12/30: Tidy: (hyperdrive-dir-column-headers) Reduce duplication, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 80d68a0378 16/30: Change: Replace -timestamp-width with -timestamp-format-string, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive dc2488436d 17/30: Change: (hyperdrive-dir-column-headers) Fix column headers highlight, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive a39567f697 24/30: Change: (hyperdrive--fill) Use string-match-p, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive 447994e8b2 13/30: Change: (hyperdrive-dir-column-headers) Clickable column headers, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive db30be6a57 28/30: Comment: Update TODO, ELPA Syncer, 2023/09/06
- [nongnu] elpa/hyperdrive bbd78c6361 23/30: Docs: Update customization option docs, ELPA Syncer, 2023/09/06