From 6d46a197b338ae1e3cbc758fc7901350f084a381 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 27 Oct 2024 10:12:47 +0100 Subject: widget: remove mastodon-profile--views-plist --- lisp/mastodon-profile.el | 9 ++------- lisp/mastodon-widget.el | 4 +++- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index b7cbc7f..b4a8d4f 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -554,9 +554,6 @@ The endpoint only holds a few preferences. For others, see ;;; PROFILE WIDGET -(defvar mastodon-profile--views-plist - `(:kind "View" :types mastodon-profile--view-types :default statuses)) - (defvar mastodon-profile--view-types '(statuses no-boosts no-replies only-media followers following tag)) @@ -752,12 +749,10 @@ MAX-ID is a flag to include the max_id pagination parameter." (mastodon-media--inline-images (point-min) (point)) ;; widget items description (mastodon-widget--create - (plist-get mastodon-profile--views-plist :kind) - (plist-get mastodon-profile--views-plist :types) - ;; TODO: hand current view to the widget: + "View" mastodon-profile--view-types (or (mastodon-profile--current-view-type endpoint-type no-reblogs no-replies only-media tag) - (plist-get mastodon-profile--views-plist :default)) + 'statuses) (lambda (widget &rest _ignore) (let ((value (widget-value widget))) (mastodon-profile--view-fun-call value)))) diff --git a/lisp/mastodon-widget.el b/lisp/mastodon-widget.el index 0c1026c..0c6542a 100644 --- a/lisp/mastodon-widget.el +++ b/lisp/mastodon-widget.el @@ -70,7 +70,9 @@ NOTIFY-FUN is the widget's notify function." (let* ((val-length (length (if (symbolp value) (symbol-name value) value))) - (type-list (symbol-value type)) + (type-list (if (symbolp type) + (symbol-value type) + type)) (longest (apply #'max (mapcar #'length (if (symbolp (car type-list)) -- cgit v1.2.3