From 87143791c21235b1bd674ef17f8affd77c3fbaa5 Mon Sep 17 00:00:00 2001 From: Boruch Baum Date: Sun, 4 Feb 2024 18:49:22 -0500 Subject: feat(defcustom): yeetube-default-sort-{column,ascending} --- yeetube.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/yeetube.el b/yeetube.el index 375108b..3bc992d 100644 --- a/yeetube.el +++ b/yeetube.el @@ -83,6 +83,18 @@ Valid options include: (const "Date") (const "Views") (const "Rating")) + +(defcustom yeetube-default-sort-column "Title" + "Which column to sort the search results table." + :type '(radio (const "Title") + (const "Views") + (const "Duration") + (const "Channel")) + :group 'yeetube) + +(defcustom yeetube-default-sort-ascending nil + "Whether to sort the search results in ascending order." + :type 'boolean :group 'yeetube) (defgroup yeetube-faces nil @@ -496,7 +508,8 @@ FIELDS-FACE-PAIRS is a list of fields and faces." :duration 'yeetube-face-duration :channel 'yeetube-face-channel))) (reverse yeetube-content)) - tabulated-list-sort-key nil) + tabulated-list-sort-key (cons yeetube-default-sort-column + yeetube-default-sort-ascending)) (display-line-numbers-mode 0) (tabulated-list-init-header) (tabulated-list-print)) -- cgit v1.2.3