diff options
author | Thanos Apollo <[email protected]> | 2024-01-09 20:37:23 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-01-09 20:37:23 +0200 |
commit | 72e65b345d9aeb7ee5590acb2e97d5c60297dc11 (patch) | |
tree | 0f52c4cf911154f5f2ffea1aace87f4b5af932b5 | |
parent | f7c21d066267c3994f70e335281d1a439a351e6e (diff) |
Redo yeetube-mode with tabulated list
-rw-r--r-- | yeetube.el | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -397,13 +397,25 @@ FIELDS-FACE-PAIRS is a list of fields and faces." "r" #'yeetube-replay "q" #'quit-window) -(define-derived-mode yeetube-mode special-mode "Yeetube" +(define-derived-mode yeetube-mode tabulated-list-mode "Yeetube" "Yeetube mode." - :interactive t - (abbrev-mode 0) + :keymap yeetube-mode-map + (setf tabulated-list-format [("Title" 60 t) ("Views" 12 t) ("Duration" 12 t) ("Channel" 12 t)] + tabulated-list-entries + (cl-map 'list + (lambda (content) + (list content + (yeetube-propertize-vector content + :title 'yeetube-buffer-face-title + :view-count 'yeetube-buffer-face-view-count + :duration 'yeetube-buffer-face-duration + :channel 'yeetube-buffer-face-channel))) + yeetube-content) + tabulated-list-sort-key (cons "Title" nil)) (display-line-numbers-mode 0) - :lighter " yeetube-mode" - :keymap yeetube-mode-map) + (tabulated-list-init-header) + (tabulated-list-print) + (hl-line-mode)) (provide 'yeetube) ;;; yeetube.el ends here |