summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-09 20:36:51 +0200
committerThanos Apollo <[email protected]>2024-01-09 20:36:51 +0200
commitf7c21d066267c3994f70e335281d1a439a351e6e (patch)
treee1806cb5109160e0fc33a0a27e0a4425b92e6540
parent27b94d889ea850e5c81dcbec3d7f7cbb6e8d83d4 (diff)
Add yeetube-propertize-vector
Will be used to propertize items in tabulated-list
-rw-r--r--yeetube.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/yeetube.el b/yeetube.el
index b41d2c8..1ec9f1d 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -371,8 +371,16 @@ prompt blank to keep the default name."
(setf download-counter (1+ download-counter))
(yeetube-download--ytdlp url name yeetube-download-audio-format)))))
-;; Yeetube Mode
+(defun yeetube-propertize-vector (content &rest fields-face-pairs)
+ "Create a vector with each item propertized with its corresponding face.
+
+CONTENT is a list of strings.
+FIELDS-FACE-PAIRS is a list of fields and faces."
+ (apply #'vector
+ (cl-loop for (field face) on fields-face-pairs by #'cddr
+ collect (propertize (cl-getf content field) 'face face))))
+;; Yeetube Mode
(defvar-keymap yeetube-mode-map
:doc "Keymap for yeetube commands"
"RET" #'yeetube-play