aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-10-13 11:00:11 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-10-13 12:04:20 +0200
commit96057a1b090b93adf4e72781e8894aae9f158588 (patch)
tree21ec8a8ca6d85ed47a56f4ab96a92e0b97f801b8
parent7ed54ce921e357d2b7d655921b694a5599cd9be0 (diff)
transient: factor out a field infix, to simplify mastodon-profile-fields
-rw-r--r--lisp/mastodon-transient.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el
index fe70eac..dcf8fa4 100644
--- a/lisp/mastodon-transient.el
+++ b/lisp/mastodon-transient.el
@@ -173,15 +173,15 @@ the format fields.X.keyname."
[:description
"Fields"
["Name"
- ("1 n" "" "fields.1.name" :alist-key fields.1.name :class mastodon-transient-field)
- ("2 n" "" "fields.2.name" :alist-key fields.2.name :class mastodon-transient-field)
- ("3 n" "" "fields.3.name" :alist-key fields.3.name :class mastodon-transient-field)
- ("4 n" "" "fields.4.name" :alist-key fields.4.name :class mastodon-transient-field)]
+ ("1 n" "" mastodon-transient-field-infix :alist-key fields.1.name)
+ ("2 n" "" mastodon-transient-field-infix :alist-key fields.2.name)
+ ("3 n" "" mastodon-transient-field-infix :alist-key fields.3.name)
+ ("4 n" "" mastodon-transient-field-infix :alist-key fields.4.name)]
["Value"
- ("1 v" "" "fields.1.value" :alist-key fields.1.value :class mastodon-transient-field)
- ("2 v" "" "fields.2.value" :alist-key fields.2.value :class mastodon-transient-field)
- ("3 v" "" "fields.3.value" :alist-key fields.3.value :class mastodon-transient-field)
- ("4 v" "" "fields.4.value" :alist-key fields.4.value :class mastodon-transient-field)]]
+ ("1 v" "" mastodon-transient-field-infix :alist-key fields.1.value)
+ ("2 v" "" mastodon-transient-field-infix :alist-key fields.2.value)
+ ("3 v" "" mastodon-transient-field-infix :alist-key fields.3.value)
+ ("4 v" "" mastodon-transient-field-infix :alist-key fields.4.value)]]
["Update"
("C-c C-c" "Save settings" mastodon-profile-fields-update)
("C-c C-k" :info "Revert all changes")]
@@ -193,9 +193,12 @@ the format fields.X.keyname."
;;; CLASSES
(defclass mastodon-transient-field (tp-option-str)
- ((always-read :initarg :always-read :initform t))
- "An infix option class for our options.
-We always read.")
+ ()
+ "An infix for our fields options.")
+
+(transient-define-infix mastodon-transient-field-infix ()
+ :class 'mastodon-transient-field
+ :argument "junk")
(cl-defmethod transient-init-value ((obj mastodon-transient-field))
"Initialize value of OBJ."