aboutsummaryrefslogtreecommitdiffstats
path: root/yeetube.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-09 20:37:23 +0200
committerThanos Apollo <[email protected]>2024-01-09 20:37:23 +0200
commit72e65b345d9aeb7ee5590acb2e97d5c60297dc11 (patch)
tree0f52c4cf911154f5f2ffea1aace87f4b5af932b5 /yeetube.el
parentf7c21d066267c3994f70e335281d1a439a351e6e (diff)
Redo yeetube-mode with tabulated list
Diffstat (limited to 'yeetube.el')
-rw-r--r--yeetube.el22
1 files changed, 17 insertions, 5 deletions
diff --git a/yeetube.el b/yeetube.el
index 1ec9f1d..2314c59 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -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