emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 447994e8b2 13/30: Change: (hyperdrive-dir-colum


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 447994e8b2 13/30: Change: (hyperdrive-dir-column-headers) Clickable column headers
Date: Wed, 6 Sep 2023 18:59:43 -0400 (EDT)

branch: elpa/hyperdrive
commit 447994e8b25bd7ed72aab745b618cd16514c63b7
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Change: (hyperdrive-dir-column-headers) Clickable column headers
---
 hyperdrive-dir.el | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/hyperdrive-dir.el b/hyperdrive-dir.el
index 36d120dd94..2cf84ed072 100644
--- a/hyperdrive-dir.el
+++ b/hyperdrive-dir.el
@@ -127,16 +127,23 @@ 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 (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))
+      (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))
     (concat prefix "\n"
             (apply #'format (concat "%6s  " hyperdrive-timestamp-format-string 
"  %s")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]