aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-16 09:50:16 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-16 09:50:16 +0200
commita203ad2fe6a759f3ac340198b4a168fd0d636a16 (patch)
treef9cd5681e0ef6df2f537b5a214c8a126a0248228 /lisp
parent5a1f2d19de73fa233187b705e4fe72f31db194ff (diff)
refactoring in update-meta-fields-alist
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-profile.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index b4684da..9aed0da 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -444,18 +444,14 @@ Returns the results as an alist."
(mastodon-profile--get-source-value 'fields))))
;; offer empty fields if user currently has less than four filled:
(while (< (length fields-old) 4)
- (setq fields-old
- (append fields-old '(("" . "")))))
- (let ((alist
+ (setq fields-old (append fields-old '(("" . "")))))
+ (let ((f-str "Metadata %s [%s/4] (max. 255 chars): ")
+ (alist
(cl-loop for f in fields-old
for x from 1 to 5
collect
- (cons (read-string
- (format "Metadata key [%s/4] (max. 255 chars): " x)
- (car f))
- (read-string
- (format "Metadata value [%s/4] (max. 255 chars): " x)
- (cdr f))))))
+ (cons (read-string (format f-str "key" x) (car f))
+ (read-string (format f-str "value" x) (cdr f))))))
(mapcar (lambda (x)
(cons (mastodon-profile--limit-to-255 (car x))
(mastodon-profile--limit-to-255 (cdr x))))