From 951ad5d60e4ff24ad108f60a9f45df8e241ef7c2 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 2 Oct 2024 10:15:45 +0200 Subject: add mastodon-transient.el --- lisp/mastodon-transient.el | 111 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 lisp/mastodon-transient.el (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el new file mode 100644 index 0000000..7de780c --- /dev/null +++ b/lisp/mastodon-transient.el @@ -0,0 +1,111 @@ +;;; mastodon-transient.el --- transient menus for mastodon.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 martian hiatus + +;; Author: martian hiatus +;; Keywords: convenience + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'tp) + +(defun mastodon-transient-parse-source-key (key) + "Parse mastodon source KEY. +If KEY needs to be source[key], format like so, else just return +the inner key part." + (let* ((split (split-string key "[][]")) + (array-key (cadr split))) + (if (or (= 1 (length split)) ;; no split + (member array-key '("privacy" "sensitive" "language"))) + key + array-key))) + +(defun mastodon-transient-parse-source-keys (alist) + "Parse ALIST containing source[key] keys." + (cl-loop for a in alist + collect (cons (mastodon-transient-parse-source-key (car a)) + (cdr a)))) + +;; FIXME: PATCHing source vals as JSON request body doesn't work! +;; existing `mastodon-profile--update-preference' doesn't use it! it just uses +;; query params! strange thing is it works for non-source params +(transient-define-suffix mastodon-user-settings-update (&optional args) + "Update current user settings on the server." + :transient 'transient--do-exit + ;; interactive receives args from the prefix: + (interactive (list (transient-args 'mastodon-user-settings))) + (let* ((alist (tp-transient-to-alist args)) + (only-changed (tp-only-changed-args alist)) + (arrays (tp-dots-to-arrays only-changed)) + (parsed-source (mastodon-transient-parse-source-keys arrays)) + (endpoint "accounts/update_credentials") + (url (mastodon-http--api endpoint)) + (resp (mastodon-http--patch url parsed-source))) ; :json))) + (mastodon-http--triage + resp + (lambda (_) + (message "Settings updated!\n%s" parsed-source))))) + +(defun mastodon-transient-get-creds () + "Fetch account data." + (mastodon-http--get-json + (mastodon-http--api "accounts/verify_credentials") + nil :silent)) + +(transient-define-prefix mastodon-user-settings () + "A transient for setting current user settings." + :value (lambda () (tp-return-data + #'mastodon-transient-get-creds)) + [:description + ;; '() + (lambda () + "Settings") + ;; (format "User settings for %s" mastodon-active-user)) + (:info + "Note: use the empty string (\"\") to remove a value from an option.") + ] + ;; strings + ["Account info" + ("n" "display name" "display_name=" :class tp-option-str)] + ;; "choice" booleans (so we can PATCH :json-false explicitly): + ["Account options" + ("l" "locked" "locked=" :class tp-choice-bool) + ("b" "bot" "bot=" :class tp-choice-bool) + ("d" "discoverable" "discoverable=" :class tp-choice-bool) + + ("c" "hide follower/following lists" "source.hide_collections=" :class tp-choice-bool) + ("i" "indexable" "source.indexable=" :class tp-choice-bool)] + ["Tooting options" + ("p" "default privacy" "source.privacy=" :class tp-option + :choices (lambda () mastodon-toot-visibility-settings-list)) + ("s" "mark sensitive" "source.sensitive=" :class tp-choice-bool) + ("g" "default language" "source.language=" :class tp-option + :choices (lambda () mastodon-iso-639-regional))] + ["Update" + ("C-c C-c" "Save settings" mastodon-user-settings-update) + ;; ("C-c C-k" :info "to revert all changes") + ] + (interactive) + (if (not mastodon-active-user) + (user-error "User not set") + (transient-setup 'mastodon-user-settings))) + +(provide 'mastodon-transient) +;;; mastodon-transient.el ends here -- cgit v1.2.3 From 113d998201546e13d924d6ac00ab0657a99cf2f3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 14:08:05 +0200 Subject: add fields transient and profile note suffix --- lisp/mastodon-transient.el | 156 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 136 insertions(+), 20 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 7de780c..533dc8c 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -26,6 +26,8 @@ (require 'tp) +;;; UTILS + (defun mastodon-transient-parse-source-key (key) "Parse mastodon source KEY. If KEY needs to be source[key], format like so, else just return @@ -43,8 +45,55 @@ the inner key part." collect (cons (mastodon-transient-parse-source-key (car a)) (cdr a)))) -;; FIXME: PATCHing source vals as JSON request body doesn't work! -;; existing `mastodon-profile--update-preference' doesn't use it! it just uses +(defun mastodon-transient-get-creds () + "Fetch account data." + (mastodon-http--get-json + (mastodon-http--api "accounts/verify_credentials") + nil :silent)) + +;; fields utils: +;; to PATCH fields, we just need fields[x][name] and fields[x][value] + +(defun mastodon-transient-fields-to-transient () + "Convert fields in `tp-server-settings' to transient key=val args." + (flatten-tree + (let-alist tp-server-settings + (cl-loop + for f in .source.fields + for count from 1 to 5 + collect + (cl-loop for x in f + collect + (concat "fields." (number-to-string count) + "." (symbol-name (car x)) + "=" (cdr x))))))) + +(defun mastodon-transient-field-dot-to-array (key) + "Convert KEY from tp dot annotation to array[key] annotation." + (let* ((split (split-string key "\\.")) + (count (length split))) + (cond ((not key) nil) + ((= 1 count) key) + (t + (concat ;; first item + (car split) + "_attributes" + ;; but last item + "[" (car (last split (1- count))) + ;; last item: + "][" (car (last split)) "]"))))) + +(defun mastodon-transient-dot-fields-to-arrays (alist) + "Parse fields ALIST in dot notation to array notation." + (cl-loop for y in alist + collect + (cons (mastodon-transient-field-dot-to-array (car y)) + (cdr y)))) + +;;; TRANSIENTS + +;; FIXME: PATCHing source vals as JSON request body doesn't work! existing +;; `mastodon-profile--update-preference' doesn't use it! it just uses ;; query params! strange thing is it works for non-source params (transient-define-suffix mastodon-user-settings-update (&optional args) "Update current user settings on the server." @@ -61,51 +110,118 @@ the inner key part." (mastodon-http--triage resp (lambda (_) - (message "Settings updated!\n%s" parsed-source))))) - -(defun mastodon-transient-get-creds () - "Fetch account data." - (mastodon-http--get-json - (mastodon-http--api "accounts/verify_credentials") - nil :silent)) + (message "Settings updated!\n%s" (pp-to-string parsed-source)))))) (transient-define-prefix mastodon-user-settings () "A transient for setting current user settings." :value (lambda () (tp-return-data #'mastodon-transient-get-creds)) [:description - ;; '() (lambda () - "Settings") - ;; (format "User settings for %s" mastodon-active-user)) + (format "User settings for %s" mastodon-active-user)) (:info - "Note: use the empty string (\"\") to remove a value from an option.") - ] + "Note: use the empty string (\"\") to remove a value from an option.")] ;; strings ["Account info" - ("n" "display name" "display_name=" :class tp-option-str)] + ("n" "display name" "display_name=" :class tp-option-str) + ("t" "update profile note" mastodon-update-profile-note) + ("f" "update profile fields" mastodon-profile-fields)] ;; "choice" booleans (so we can PATCH :json-false explicitly): ["Account options" ("l" "locked" "locked=" :class tp-choice-bool) ("b" "bot" "bot=" :class tp-choice-bool) ("d" "discoverable" "discoverable=" :class tp-choice-bool) - ("c" "hide follower/following lists" "source.hide_collections=" :class tp-choice-bool) ("i" "indexable" "source.indexable=" :class tp-choice-bool)] ["Tooting options" ("p" "default privacy" "source.privacy=" :class tp-option - :choices (lambda () mastodon-toot-visibility-settings-list)) + :choices mastodon-toot-visibility-settings-list) + ;; ("public" "unlisted" "private")) + ;; (lambda () mastodon-toot-visibility-settings-list)) ("s" "mark sensitive" "source.sensitive=" :class tp-choice-bool) ("g" "default language" "source.language=" :class tp-option - :choices (lambda () mastodon-iso-639-regional))] + :choices mastodon-iso-639-regional)] ["Update" ("C-c C-c" "Save settings" mastodon-user-settings-update) - ;; ("C-c C-k" :info "to revert all changes") - ] + ("C-c C-k" :info "to revert all changes")] (interactive) (if (not mastodon-active-user) (user-error "User not set") (transient-setup 'mastodon-user-settings))) +(transient-define-suffix mastodon-update-profile-note () + "Update current user profile note." + :transient 'transient--do-exit + (interactive) + (mastodon-profile--update-user-profile-note)) + +(transient-define-suffix mastodon-profile-fields-update (args) + "Update current user profile fields." + :transient 'transient--do-exit + (interactive (list (transient-args 'mastodon-profile-fields))) + (let* ((alist (tp-transient-to-alist args)) + ;; FIXME: maybe only changed also won't work with fields, as + ;; perhaps what is PATCHed overwrites whatever is on the server? + ;; (only-changed (tp-only-changed-args alist)) + (arrays (mastodon-transient-dot-fields-to-arrays alist)) + (endpoint "accounts/update_credentials") + (url (mastodon-http--api endpoint)) + (resp (mastodon-http--patch url arrays))) ; :json))) + (mastodon-http--triage + resp + (lambda (_) + (message "Fields updated!\n%s" (pp-to-string arrays)))))) + +(transient-define-prefix mastodon-profile-fields () + "A transient for setting profile fields." + :value (lambda () + (tp-return-data #'mastodon-transient-get-creds) + (mastodon-transient-fields-to-transient)) + ["Field 1" + :class transient-row + ("1n" "name:" "fields.1.name=" :class mastodon-transient-field) + ("1v" "value:" "fields.1.value=" :class mastodon-transient-field)] + ["Field 2" + :class transient-row + ("2n" "name:" "fields.2.name=" :class mastodon-transient-field) + ("2v" "value:" "fields.2.value=" :class mastodon-transient-field)] + ["Field 3" + :class transient-row + ("3n" "name:" "fields.3.name=" :class mastodon-transient-field) + ("3v" "value:" "fields.3.value=" :class mastodon-transient-field)] + ["Field 4" + :class transient-row + ("4n" "name:" "fields.4.name=" :class mastodon-transient-field) + ("4v" "value:" "fields.4.value=" :class mastodon-transient-field)] + ["Update" + ("C-c C-c" "Save settings" mastodon-profile-fields-update) + ("C-c C-k" :info "to revert all changes")] + (interactive) + (if (not mastodon-active-user) + (user-error "User not set") + (transient-setup 'mastodon-profile-fields))) + +;;; 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.") + +(cl-defmethod transient-format-value ((obj mastodon-transient-field)) + "Format the value of OBJ. +Format should just be a string, highlighted green if it has been +changed from the server value." + (let* ((pair (transient-infix-value obj)) + (value (when pair (cadr (split-string pair "="))))) + (if (not pair) + "" + ;; FIXME: not sure how to compare with server, as fields are not + ;; numbered in the JSON? + (propertize value + 'face (if (tp-arg-changed-p pair) + 'transient-value + 'transient-inactive-value))))) + (provide 'mastodon-transient) ;;; mastodon-transient.el ends here -- cgit v1.2.3 From 0607ad7305ed12ea5dac2e0f2f331c77ba3c91c9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 14:45:24 +0200 Subject: C-c C-k info str --- lisp/mastodon-transient.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 533dc8c..bb036b8 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -143,7 +143,7 @@ the inner key part." :choices mastodon-iso-639-regional)] ["Update" ("C-c C-c" "Save settings" mastodon-user-settings-update) - ("C-c C-k" :info "to revert all changes")] + ("C-c C-k" :info "Revert all changes")] (interactive) (if (not mastodon-active-user) (user-error "User not set") @@ -195,7 +195,7 @@ the inner key part." ("4v" "value:" "fields.4.value=" :class mastodon-transient-field)] ["Update" ("C-c C-c" "Save settings" mastodon-profile-fields-update) - ("C-c C-k" :info "to revert all changes")] + ("C-c C-k" :info "Revert all changes")] (interactive) (if (not mastodon-active-user) (user-error "User not set") -- cgit v1.2.3 From 3c6d817a9cc244b3f38dd9634d3b00b2e415f397 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 15:43:55 +0200 Subject: highligh fields in transient only if changed --- lisp/mastodon-transient.el | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index bb036b8..22e5fcc 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -54,19 +54,18 @@ the inner key part." ;; fields utils: ;; to PATCH fields, we just need fields[x][name] and fields[x][value] -(defun mastodon-transient-fields-to-transient () - "Convert fields in `tp-server-settings' to transient key=val args." +(defun mastodon-transient-fields-to-transient (fields) + "Convert fields in FIELDS to transient key=val args." (flatten-tree - (let-alist tp-server-settings - (cl-loop - for f in .source.fields - for count from 1 to 5 - collect - (cl-loop for x in f - collect - (concat "fields." (number-to-string count) - "." (symbol-name (car x)) - "=" (cdr x))))))) + (cl-loop + for f in fields + for count from 1 to 5 + collect + (cl-loop for x in f + collect + (concat "fields." (number-to-string count) + "." (symbol-name (car x)) + "=" (cdr x)))))) (defun mastodon-transient-field-dot-to-array (key) "Convert KEY from tp dot annotation to array[key] annotation." @@ -208,18 +207,26 @@ the inner key part." "An infix option class for our options. We always read.") +(defun mastodon-transient-field-changed-p (value key num) + "T if VALUE is not equal corresponding value in `tp-server-settings'. +The latter is fetched from alist number NUM, using KEY, a symbol." + (let ((elt (nth num) tp-server-settings)) + (not (equal value (alist-get key elt))))) + (cl-defmethod transient-format-value ((obj mastodon-transient-field)) "Format the value of OBJ. Format should just be a string, highlighted green if it has been changed from the server value." (let* ((pair (transient-infix-value obj)) - (value (when pair (cadr (split-string pair "="))))) + (arg (oref obj argument)) + (value (when pair (cadr (split-string pair "=")))) + (split (split-string arg "\\.")) + (num (1- (string-to-number (nth 1 split)))) + (key (intern (substring (nth 2 split) nil -1)))) (if (not pair) "" - ;; FIXME: not sure how to compare with server, as fields are not - ;; numbered in the JSON? (propertize value - 'face (if (tp-arg-changed-p pair) + 'face (if (mastodon-transient-field-changed-p value key num) 'transient-value 'transient-inactive-value))))) -- cgit v1.2.3 From d5d6a71ce556aae293a9b407a0993d0ba140e78b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 15:44:16 +0200 Subject: layout of fields transient --- lisp/mastodon-transient.el | 52 +++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 19 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 22e5fcc..7269848 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -173,25 +173,39 @@ the inner key part." (transient-define-prefix mastodon-profile-fields () "A transient for setting profile fields." - :value (lambda () - (tp-return-data #'mastodon-transient-get-creds) - (mastodon-transient-fields-to-transient)) - ["Field 1" - :class transient-row - ("1n" "name:" "fields.1.name=" :class mastodon-transient-field) - ("1v" "value:" "fields.1.value=" :class mastodon-transient-field)] - ["Field 2" - :class transient-row - ("2n" "name:" "fields.2.name=" :class mastodon-transient-field) - ("2v" "value:" "fields.2.value=" :class mastodon-transient-field)] - ["Field 3" - :class transient-row - ("3n" "name:" "fields.3.name=" :class mastodon-transient-field) - ("3v" "value:" "fields.3.value=" :class mastodon-transient-field)] - ["Field 4" - :class transient-row - ("4n" "name:" "fields.4.name=" :class mastodon-transient-field) - ("4v" "value:" "fields.4.value=" :class mastodon-transient-field)] + :value + (lambda () + (tp-return-data #'mastodon-transient-get-creds nil 'fields) + (setq tp-settings-as-transient + (mastodon-transient-fields-to-transient + tp-server-settings))) + [:description + "Fields" + ["Name" + ;; :class transient-row + ("n1" "" "fields.1.name=" :class mastodon-transient-field) + ("n2" "" "fields.2.name=" :class mastodon-transient-field) + ("n3" "" "fields.3.name=" :class mastodon-transient-field) + ("n4" "" "fields.4.name=" :class mastodon-transient-field)] + ["Value" + ("v1" "" "fields.1.value=" :class mastodon-transient-field) + ("v2" "" "fields.2.value=" :class mastodon-transient-field) + ("v3" "" "fields.3.value=" :class mastodon-transient-field) + ("v4" "" "fields.4.value=" :class mastodon-transient-field)]] + ;; ["Field" + ;; :class transient-row + ;; :pad-keys t + ;; ;; ("2n" "name:" "fields.2.name=" :class mastodon-transient-field) + ;; ("2v" "value:" "fields.2.value=" :class mastodon-transient-field)] + ;; ["Field 3" + ;; :class transient-row + ;; :pad-keys t + ;; ;; ("3n" "name:" "fields.3.name=" :class mastodon-transient-field) + ;; ("3v" "value:" "fields.3.value=" :class mastodon-transient-field)] + ;; ["Field 4" + ;; :class transient-row + ;; ;; ("4n" "name:" "fields.4.name=" :class mastodon-transient-field) + ;; ("4v" "value:" "fields.4.value=" :class mastodon-transient-field)] ["Update" ("C-c C-c" "Save settings" mastodon-profile-fields-update) ("C-c C-k" :info "Revert all changes")] -- cgit v1.2.3 From ca3c9bed31f030288bc95ef31ec0b8f3624a40cb Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 17:32:37 +0200 Subject: rename tp-bool --- lisp/mastodon-transient.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 7269848..20a1404 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -127,17 +127,17 @@ the inner key part." ("f" "update profile fields" mastodon-profile-fields)] ;; "choice" booleans (so we can PATCH :json-false explicitly): ["Account options" - ("l" "locked" "locked=" :class tp-choice-bool) - ("b" "bot" "bot=" :class tp-choice-bool) - ("d" "discoverable" "discoverable=" :class tp-choice-bool) - ("c" "hide follower/following lists" "source.hide_collections=" :class tp-choice-bool) - ("i" "indexable" "source.indexable=" :class tp-choice-bool)] + ("l" "locked" "locked=" :class tp-bool) + ("b" "bot" "bot=" :class tp-bool) + ("d" "discoverable" "discoverable=" :class tp-bool) + ("c" "hide follower/following lists" "source.hide_collections=" :class tp-bool) + ("i" "indexable" "source.indexable=" :class tp-bool)] ["Tooting options" ("p" "default privacy" "source.privacy=" :class tp-option :choices mastodon-toot-visibility-settings-list) ;; ("public" "unlisted" "private")) ;; (lambda () mastodon-toot-visibility-settings-list)) - ("s" "mark sensitive" "source.sensitive=" :class tp-choice-bool) + ("s" "mark sensitive" "source.sensitive=" :class tp-bool) ("g" "default language" "source.language=" :class tp-option :choices mastodon-iso-639-regional)] ["Update" -- cgit v1.2.3 From d57b733b3a55cf6f341ac561db7fa028c9923f65 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 19:05:52 +0200 Subject: change fields bindings --- lisp/mastodon-transient.el | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 20a1404..7738958 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -182,30 +182,15 @@ the inner key part." [:description "Fields" ["Name" - ;; :class transient-row - ("n1" "" "fields.1.name=" :class mastodon-transient-field) - ("n2" "" "fields.2.name=" :class mastodon-transient-field) - ("n3" "" "fields.3.name=" :class mastodon-transient-field) - ("n4" "" "fields.4.name=" :class mastodon-transient-field)] + ("1 n" "" "fields.1.name=" :class mastodon-transient-field) + ("2 n" "" "fields.2.name=" :class mastodon-transient-field) + ("3 n" "" "fields.3.name=" :class mastodon-transient-field) + ("4 n" "" "fields.4.name=" :class mastodon-transient-field)] ["Value" - ("v1" "" "fields.1.value=" :class mastodon-transient-field) - ("v2" "" "fields.2.value=" :class mastodon-transient-field) - ("v3" "" "fields.3.value=" :class mastodon-transient-field) - ("v4" "" "fields.4.value=" :class mastodon-transient-field)]] - ;; ["Field" - ;; :class transient-row - ;; :pad-keys t - ;; ;; ("2n" "name:" "fields.2.name=" :class mastodon-transient-field) - ;; ("2v" "value:" "fields.2.value=" :class mastodon-transient-field)] - ;; ["Field 3" - ;; :class transient-row - ;; :pad-keys t - ;; ;; ("3n" "name:" "fields.3.name=" :class mastodon-transient-field) - ;; ("3v" "value:" "fields.3.value=" :class mastodon-transient-field)] - ;; ["Field 4" - ;; :class transient-row - ;; ;; ("4n" "name:" "fields.4.name=" :class mastodon-transient-field) - ;; ("4v" "value:" "fields.4.value=" :class mastodon-transient-field)] + ("1 v" "" "fields.1.value=" :class mastodon-transient-field) + ("2 v" "" "fields.2.value=" :class mastodon-transient-field) + ("3 v" "" "fields.3.value=" :class mastodon-transient-field) + ("4 v" "" "fields.4.value=" :class mastodon-transient-field)]] ["Update" ("C-c C-c" "Save settings" mastodon-profile-fields-update) ("C-c C-k" :info "Revert all changes")] -- cgit v1.2.3 From fe27477d19cb78c75e0e9508041f58ff722ab8ca Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 20:03:10 +0200 Subject: do-return (to parent) for fields update --- lisp/mastodon-transient.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 7738958..cc314f8 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -156,7 +156,7 @@ the inner key part." (transient-define-suffix mastodon-profile-fields-update (args) "Update current user profile fields." - :transient 'transient--do-exit + :transient 'transient--do-return (interactive (list (transient-args 'mastodon-profile-fields))) (let* ((alist (tp-transient-to-alist args)) ;; FIXME: maybe only changed also won't work with fields, as @@ -167,9 +167,7 @@ the inner key part." (url (mastodon-http--api endpoint)) (resp (mastodon-http--patch url arrays))) ; :json))) (mastodon-http--triage - resp - (lambda (_) - (message "Fields updated!\n%s" (pp-to-string arrays)))))) + resp (lambda (_) (message "Fields updated!"))))) (transient-define-prefix mastodon-profile-fields () "A transient for setting profile fields." -- cgit v1.2.3 From e8195a833944ca088a7b0d9146afa12ce551178d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 3 Oct 2024 20:03:27 +0200 Subject: add method tp-arg-changed-p for fields --- lisp/mastodon-transient.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index cc314f8..05c3d13 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -204,28 +204,30 @@ the inner key part." "An infix option class for our options. We always read.") -(defun mastodon-transient-field-changed-p (value key num) - "T if VALUE is not equal corresponding value in `tp-server-settings'. -The latter is fetched from alist number NUM, using KEY, a symbol." - (let ((elt (nth num) tp-server-settings)) - (not (equal value (alist-get key elt))))) +(cl-defmethod tp-arg-changed-p ((_obj mastodon-transient-field) pair) + "T if value of OBJ is changed. +PAIR is a transient arg of the form \"fields.1.name=val\"." + (let* ((pair-split (split-string pair "=")) + (keys-split (split-string (car pair-split) "\\.")) + (num (1- (string-to-number (nth 1 keys-split)))) + (server-key (intern (nth 2 keys-split))) + (server-elt (nth num tp-server-settings)) + (value (when pair (cadr pair-split)))) + (not (equal value (alist-get server-key server-elt))))) (cl-defmethod transient-format-value ((obj mastodon-transient-field)) "Format the value of OBJ. Format should just be a string, highlighted green if it has been changed from the server value." (let* ((pair (transient-infix-value obj)) - (arg (oref obj argument)) - (value (when pair (cadr (split-string pair "=")))) - (split (split-string arg "\\.")) - (num (1- (string-to-number (nth 1 split)))) - (key (intern (substring (nth 2 split) nil -1)))) + (value (when pair (cadr (split-string pair "="))))) (if (not pair) "" - (propertize value - 'face (if (mastodon-transient-field-changed-p value key num) - 'transient-value - 'transient-inactive-value))))) + (propertize + value + 'face (if (tp-arg-changed-p obj pair) + 'transient-value + 'transient-inactive-value))))) (provide 'mastodon-transient) ;;; mastodon-transient.el ends here -- cgit v1.2.3 From dc69faaa1ba9de3c640291970f7fdf25329f5640 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 4 Oct 2024 08:13:06 +0200 Subject: lambdas for choices lists --- lisp/mastodon-transient.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 05c3d13..4929a42 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -134,12 +134,12 @@ the inner key part." ("i" "indexable" "source.indexable=" :class tp-bool)] ["Tooting options" ("p" "default privacy" "source.privacy=" :class tp-option - :choices mastodon-toot-visibility-settings-list) + :choices (lambda () mastodon-toot-visibility-settings-list)) ;; ("public" "unlisted" "private")) ;; (lambda () mastodon-toot-visibility-settings-list)) ("s" "mark sensitive" "source.sensitive=" :class tp-bool) ("g" "default language" "source.language=" :class tp-option - :choices mastodon-iso-639-regional)] + :choices (lambda () mastodon-iso-639-regional))] ["Update" ("C-c C-c" "Save settings" mastodon-user-settings-update) ("C-c C-k" :info "Revert all changes")] -- cgit v1.2.3 From d3f7046a083623d0e3788af00fc7006eee45fa3f Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 4 Oct 2024 13:47:38 +0200 Subject: transient: improve field-dot-to-array --- lisp/mastodon-transient.el | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 4929a42..481a68e 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -69,18 +69,7 @@ the inner key part." (defun mastodon-transient-field-dot-to-array (key) "Convert KEY from tp dot annotation to array[key] annotation." - (let* ((split (split-string key "\\.")) - (count (length split))) - (cond ((not key) nil) - ((= 1 count) key) - (t - (concat ;; first item - (car split) - "_attributes" - ;; but last item - "[" (car (last split (1- count))) - ;; last item: - "][" (car (last split)) "]"))))) + (tp-dot-to-array key nil "_attributes")) (defun mastodon-transient-dot-fields-to-arrays (alist) "Parse fields ALIST in dot notation to array notation." -- cgit v1.2.3 From 2bfd601b88d5fc5a53bce104ba8fda938da45382 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 7 Oct 2024 19:01:56 +0200 Subject: transient working with tp alist args --- lisp/mastodon-transient.el | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 481a68e..1c5890f 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -88,17 +88,15 @@ the inner key part." :transient 'transient--do-exit ;; interactive receives args from the prefix: (interactive (list (transient-args 'mastodon-user-settings))) - (let* ((alist (tp-transient-to-alist args)) - (only-changed (tp-only-changed-args alist)) + (let* ((only-changed (tp-only-changed-args args)) (arrays (tp-dots-to-arrays only-changed)) - (parsed-source (mastodon-transient-parse-source-keys arrays)) - (endpoint "accounts/update_credentials") - (url (mastodon-http--api endpoint)) - (resp (mastodon-http--patch url parsed-source))) ; :json))) + (strs (tp-bools-to-strs arrays)) ;; we can't PATCH json + (url (mastodon-http--api "accounts/update_credentials")) + (resp (mastodon-http--patch url strs))) ;; :json fails (mastodon-http--triage resp (lambda (_) - (message "Settings updated!\n%s" (pp-to-string parsed-source)))))) + (message "Settings updated!\n%s" (pp-to-string strs)))))) (transient-define-prefix mastodon-user-settings () "A transient for setting current user settings." @@ -111,29 +109,33 @@ the inner key part." "Note: use the empty string (\"\") to remove a value from an option.")] ;; strings ["Account info" - ("n" "display name" "display_name=" :class tp-option-str) + ("n" "display name" "display_name" :alist-key display_name :class tp-option-str) ("t" "update profile note" mastodon-update-profile-note) ("f" "update profile fields" mastodon-profile-fields)] ;; "choice" booleans (so we can PATCH :json-false explicitly): ["Account options" - ("l" "locked" "locked=" :class tp-bool) - ("b" "bot" "bot=" :class tp-bool) - ("d" "discoverable" "discoverable=" :class tp-bool) - ("c" "hide follower/following lists" "source.hide_collections=" :class tp-bool) - ("i" "indexable" "source.indexable=" :class tp-bool)] + ("l" "locked" "locked" :alist-key locked :class tp-bool) + ("b" "bot" "bot" :alist-key bot :class tp-bool) + ("d" "discoverable" "discoverable" :alist-key discoverable :class tp-bool) + ("c" "hide follower/following lists" "source.hide_collections" + :alist-key source.hide_collections :class tp-bool) + ("i" "indexable" "source.indexable" :alist-key source.indexable :class tp-bool) + ] ["Tooting options" - ("p" "default privacy" "source.privacy=" :class tp-option + ("p" "default privacy" "source.privacy" :alist-key source.privacy + :class tp-option :choices (lambda () mastodon-toot-visibility-settings-list)) - ;; ("public" "unlisted" "private")) - ;; (lambda () mastodon-toot-visibility-settings-list)) - ("s" "mark sensitive" "source.sensitive=" :class tp-bool) - ("g" "default language" "source.language=" :class tp-option - :choices (lambda () mastodon-iso-639-regional))] + ("s" "mark sensitive" "source.sensitive" :alist-key source.sensitive :class tp-bool) + ("g" "default language" "source.language" :alist-key source.language :class tp-option + :choices (lambda () mastodon-iso-639-regional)) + ] ["Update" + ("C-c g" "Show args" masto-show-args) ("C-c C-c" "Save settings" mastodon-user-settings-update) ("C-c C-k" :info "Revert all changes")] (interactive) - (if (not mastodon-active-user) + (if (or (not (boundp 'mastodon-active-user)) + (not mastodon-active-user)) (user-error "User not set") (transient-setup 'mastodon-user-settings))) -- cgit v1.2.3 From f557e030fc65b88f135987fac3ef950f8e6c52be Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 7 Oct 2024 20:27:18 +0200 Subject: start on masto fields transient --- lisp/mastodon-transient.el | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 1c5890f..060e9ad 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -171,15 +171,15 @@ the inner key part." [:description "Fields" ["Name" - ("1 n" "" "fields.1.name=" :class mastodon-transient-field) - ("2 n" "" "fields.2.name=" :class mastodon-transient-field) - ("3 n" "" "fields.3.name=" :class mastodon-transient-field) - ("4 n" "" "fields.4.name=" :class mastodon-transient-field)] + ("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)] ["Value" - ("1 v" "" "fields.1.value=" :class mastodon-transient-field) - ("2 v" "" "fields.2.value=" :class mastodon-transient-field) - ("3 v" "" "fields.3.value=" :class mastodon-transient-field) - ("4 v" "" "fields.4.value=" :class mastodon-transient-field)]] + ("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)]] ["Update" ("C-c C-c" "Save settings" mastodon-profile-fields-update) ("C-c C-k" :info "Revert all changes")] @@ -206,19 +206,5 @@ PAIR is a transient arg of the form \"fields.1.name=val\"." (value (when pair (cadr pair-split)))) (not (equal value (alist-get server-key server-elt))))) -(cl-defmethod transient-format-value ((obj mastodon-transient-field)) - "Format the value of OBJ. -Format should just be a string, highlighted green if it has been -changed from the server value." - (let* ((pair (transient-infix-value obj)) - (value (when pair (cadr (split-string pair "="))))) - (if (not pair) - "" - (propertize - value - 'face (if (tp-arg-changed-p obj pair) - 'transient-value - 'transient-inactive-value))))) - (provide 'mastodon-transient) ;;; mastodon-transient.el ends here -- cgit v1.2.3 From 2e129d90fb90fbd1ecef6d6bf2bbf1ec86a3ad9a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 8 Oct 2024 16:11:57 +0200 Subject: transient: remove testing fun --- lisp/mastodon-transient.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 060e9ad..5d1f026 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -130,7 +130,6 @@ the inner key part." :choices (lambda () mastodon-iso-639-regional)) ] ["Update" - ("C-c g" "Show args" masto-show-args) ("C-c C-c" "Save settings" mastodon-user-settings-update) ("C-c C-k" :info "Revert all changes")] (interactive) -- cgit v1.2.3 From 4bef5506c12495861def5507660397f49c89cb29 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 8 Oct 2024 17:16:30 +0200 Subject: fields transient: set tp-server-settings only --- lisp/mastodon-transient.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 5d1f026..abb845a 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -164,7 +164,7 @@ the inner key part." :value (lambda () (tp-return-data #'mastodon-transient-get-creds nil 'fields) - (setq tp-settings-as-transient + (setq tp-server-settings (mastodon-transient-fields-to-transient tp-server-settings))) [:description -- cgit v1.2.3 From 228a00c273ad9ded168ec77736d3cbdde36bd80b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 8 Oct 2024 21:17:28 +0200 Subject: transient: fix profile fields using alist args --- lisp/mastodon-transient.el | 80 +++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 30 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index abb845a..9b8d738 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -55,21 +55,22 @@ the inner key part." ;; to PATCH fields, we just need fields[x][name] and fields[x][value] (defun mastodon-transient-fields-to-transient (fields) - "Convert fields in FIELDS to transient key=val args." - (flatten-tree - (cl-loop - for f in fields - for count from 1 to 5 - collect - (cl-loop for x in f - collect - (concat "fields." (number-to-string count) - "." (symbol-name (car x)) - "=" (cdr x)))))) + "Convert fields in FIELDS to numbered conses. +The keys in the data are not numbered, so we convert the key into +the format fields.X.keyname." + (cl-loop + for f in fields + for count from 1 to 5 + collect + (cl-loop for x in f + collect + (cons (concat "fields." (number-to-string count) + "." (symbol-name (car x))) + (cdr x))))) (defun mastodon-transient-field-dot-to-array (key) "Convert KEY from tp dot annotation to array[key] annotation." - (tp-dot-to-array key nil "_attributes")) + (tp-dot-to-array (symbol-name key) nil "_attributes")) (defun mastodon-transient-dot-fields-to-arrays (alist) "Parse fields ALIST in dot notation to array notation." @@ -148,25 +149,26 @@ the inner key part." "Update current user profile fields." :transient 'transient--do-return (interactive (list (transient-args 'mastodon-profile-fields))) - (let* ((alist (tp-transient-to-alist args)) - ;; FIXME: maybe only changed also won't work with fields, as + (let* (;; FIXME: maybe only changed also won't work with fields, as ;; perhaps what is PATCHed overwrites whatever is on the server? ;; (only-changed (tp-only-changed-args alist)) - (arrays (mastodon-transient-dot-fields-to-arrays alist)) + (arrays (mastodon-transient-dot-fields-to-arrays args)) (endpoint "accounts/update_credentials") (url (mastodon-http--api endpoint)) (resp (mastodon-http--patch url arrays))) ; :json))) (mastodon-http--triage resp (lambda (_) (message "Fields updated!"))))) +(defun mastodon-transient-fetch-fields () + "Fetch profile fields (metadata)." + (tp-return-data #'mastodon-transient-get-creds nil 'fields) + (setq tp-server-settings + (mastodon-transient-fields-to-transient tp-server-settings))) + (transient-define-prefix mastodon-profile-fields () "A transient for setting profile fields." :value - (lambda () - (tp-return-data #'mastodon-transient-get-creds nil 'fields) - (setq tp-server-settings - (mastodon-transient-fields-to-transient - tp-server-settings))) + (lambda () (mastodon-transient-fetch-fields)) [:description "Fields" ["Name" @@ -194,16 +196,34 @@ the inner key part." "An infix option class for our options. We always read.") -(cl-defmethod tp-arg-changed-p ((_obj mastodon-transient-field) pair) - "T if value of OBJ is changed. -PAIR is a transient arg of the form \"fields.1.name=val\"." - (let* ((pair-split (split-string pair "=")) - (keys-split (split-string (car pair-split) "\\.")) - (num (1- (string-to-number (nth 1 keys-split)))) - (server-key (intern (nth 2 keys-split))) - (server-elt (nth num tp-server-settings)) - (value (when pair (cadr pair-split)))) - (not (equal value (alist-get server-key server-elt))))) +(cl-defmethod transient-init-value ((obj mastodon-transient-field)) + "Initialize value of OBJ." + (let* ((prefix-val (oref transient--prefix value)) + (arg (oref obj alist-key))) + (oset obj value + (tp-get-server-val obj prefix-val)))) + +(cl-defmethod tp-get-server-val ((obj mastodon-transient-field) data) + "Return the server value for OBJ from DATA. +If OBJ's key has dotted notation, drill down into the alist. Currently +only one level of nesting is supported." + ;; TODO: handle nested alist keys + (let* ((key (oref obj alist-key)) + (split (split-string (symbol-name key) "\\.")) + (num (string-to-number (cadr split)))) + (alist-get key + (nth (1- num) data) nil nil #'string=))) + +(cl-defmethod tp-arg-changed-p ((_obj mastodon-transient-field) cons) + "T if value of OBJ is changed from the server value. +CONS is a cons of the form \"(fields.1.name . val)\"." + (let* ((key-split (split-string + (symbol-to-string (car cons)) "\\.")) + (num (1- (string-to-number (nth 1 key-split)))) + (server-key (symbol-name (car cons))) + (server-elt (nth num tp-server-settings))) + (not (equal (cdr cons) + (alist-get server-key server-elt nil nil #'string=))))) (provide 'mastodon-transient) ;;; mastodon-transient.el ends here -- cgit v1.2.3 From 553b3dc5e4ebd0b83ec34fa18407fec343c1422c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 9 Oct 2024 08:29:57 +0200 Subject: user settings transient: use new tp-parse-args-for-send --- lisp/mastodon-transient.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 9b8d738..bbc8bc2 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -89,9 +89,7 @@ the format fields.X.keyname." :transient 'transient--do-exit ;; interactive receives args from the prefix: (interactive (list (transient-args 'mastodon-user-settings))) - (let* ((only-changed (tp-only-changed-args args)) - (arrays (tp-dots-to-arrays only-changed)) - (strs (tp-bools-to-strs arrays)) ;; we can't PATCH json + (let* ((strs (tp-parse-args-for-send args :strings)) (url (mastodon-http--api "accounts/update_credentials")) (resp (mastodon-http--patch url strs))) ;; :json fails (mastodon-http--triage -- cgit v1.2.3 From 1968cacb26593ca00f79637c73af1e9079cc6656 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 9 Oct 2024 09:13:46 +0200 Subject: rename a util --- lisp/mastodon-transient.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index bbc8bc2..946d28a 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -28,6 +28,9 @@ ;;; UTILS +;; some JSON fields that are returned under the "source" field need to be +;; sent back in the format source[key], while some others are sent kust as +;; key: (defun mastodon-transient-parse-source-key (key) "Parse mastodon source KEY. If KEY needs to be source[key], format like so, else just return @@ -54,7 +57,7 @@ the inner key part." ;; fields utils: ;; to PATCH fields, we just need fields[x][name] and fields[x][value] -(defun mastodon-transient-fields-to-transient (fields) +(defun mastodon-transient--fields-alist (fields) "Convert fields in FIELDS to numbered conses. The keys in the data are not numbered, so we convert the key into the format fields.X.keyname." @@ -161,7 +164,7 @@ the format fields.X.keyname." "Fetch profile fields (metadata)." (tp-return-data #'mastodon-transient-get-creds nil 'fields) (setq tp-server-settings - (mastodon-transient-fields-to-transient tp-server-settings))) + (mastodon-transient--fields-alist tp-server-settings))) (transient-define-prefix mastodon-profile-fields () "A transient for setting profile fields." -- cgit v1.2.3 From 30a3f5606b5eb9b10f48a1e358e1415b7bb016e8 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 9 Oct 2024 09:13:53 +0200 Subject: transient: fix user settings sending source keys --- lisp/mastodon-transient.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 946d28a..fe70eac 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -90,9 +90,9 @@ the format fields.X.keyname." (transient-define-suffix mastodon-user-settings-update (&optional args) "Update current user settings on the server." :transient 'transient--do-exit - ;; interactive receives args from the prefix: (interactive (list (transient-args 'mastodon-user-settings))) - (let* ((strs (tp-parse-args-for-send args :strings)) + (let* ((parsed (tp-parse-args-for-send args :strings)) + (strs (mastodon-transient-parse-source-keys parsed)) (url (mastodon-http--api "accounts/update_credentials")) (resp (mastodon-http--patch url strs))) ;; :json fails (mastodon-http--triage -- cgit v1.2.3 From ef6762986de6f4c85405dbc01ae19854cd2687fd Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 20 Oct 2024 13:39:06 +0200 Subject: change email address --- README.org | 2 +- lisp/mastodon-async.el | 2 +- lisp/mastodon-auth.el | 2 +- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 4 ++-- lisp/mastodon-http.el | 4 ++-- lisp/mastodon-inspect.el | 4 ++-- lisp/mastodon-iso.el | 2 +- lisp/mastodon-media.el | 4 ++-- lisp/mastodon-notifications.el | 4 ++-- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-search.el | 4 ++-- lisp/mastodon-tl.el | 4 ++-- lisp/mastodon-toot.el | 4 ++-- lisp/mastodon-transient.el | 2 +- lisp/mastodon-views.el | 4 ++-- lisp/mastodon.el | 4 ++-- mastodon.texi | 2 +- 18 files changed, 29 insertions(+), 29 deletions(-) (limited to 'lisp/mastodon-transient.el') diff --git a/README.org b/README.org index cf6aed5..1898366 100644 --- a/README.org +++ b/README.org @@ -487,7 +487,7 @@ If you prefer emailing patches to the process described below, feel free to send If you'd like to support continued development of =mastodon.el=, I accept donations via paypal: [[https://paypal.me/martianh][paypal.me/martianh]]. If you would prefer a different -payment method, please write to me at and I can +payment method, please write to me at and I can provide IBAN or other bank account details. I don't have a tech worker's income, so even a small tip would help out. diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 317be93..b059407 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2017 Alex J. Griffith ;; Author: Alex J. Griffith -;; Maintainer: Marty Hiatt +;; Maintainer: Marty Hiatt ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 3796b7e..01639fb 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen -;; Maintainer: Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 6e55829..c0db3d6 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen -;; Maintainer: Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 9278432..993cc27 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 5035cb4..1093de1 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index adc6d64..4981943 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-iso.el b/lisp/mastodon-iso.el index 8ea5635..6199cbe 100644 --- a/lisp/mastodon-iso.el +++ b/lisp/mastodon-iso.el @@ -1,7 +1,7 @@ ;;; mastodon-iso.el --- ISO language code lists for mastodon.el -*- lexical-binding: t -*- ;; Copyright (C) 2022 Marty Hiatt -;; Author: Marty Hiatt +;; Author: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index ccd258c..8601410 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 8d2c928..b16b5a6 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index c6a0276..40f834c 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index cead17e..25db7d8 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -1,8 +1,8 @@ ;;; mastodon-search.el --- Search functions for mastodon.el -*- lexical-binding: t -*- ;; Copyright (C) 2017-2019 Marty Hiatt -;; Author: Marty Hiatt -;; Maintainer: Marty Hiatt +;; Author: Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 437a5e3..1a4df7f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 95fccc3..fc5825a 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2024 Marty Hiatt ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index fe70eac..526dfa4 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2024 martian hiatus -;; Author: martian hiatus +;; Author: martian hiatus ;; Keywords: convenience ;; This program is free software; you can redistribute it and/or modify diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 3112c20..8d356fb 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -1,8 +1,8 @@ ;;; mastodon-views.el --- Minor views functions for mastodon.el -*- lexical-binding: t -*- ;; Copyright (C) 2020-2024 Marty Hiatt -;; Author: Marty Hiatt -;; Maintainer: Marty Hiatt +;; Author: Marty Hiatt +;; Maintainer: Marty Hiatt ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 37da99c..cb5731a 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -4,8 +4,8 @@ ;; Copyright (C) 2020-2022 Marty Hiatt ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen -;; Marty Hiatt -;; Maintainer: Marty Hiatt +;; Marty Hiatt +;; Maintainer: Marty Hiatt ;; Version: 1.1.0 ;; Package-Requires: ((emacs "28.1") (request "0.3.0") ;; (persist "0.4") (tp "0.1")) diff --git a/mastodon.texi b/mastodon.texi index dafa92d..d1c9268 100644 --- a/mastodon.texi +++ b/mastodon.texi @@ -818,7 +818,7 @@ There's no need for a blank line after the first docstring line (one is added au If you'd like to support continued development of @samp{mastodon.el}, I accept donations via paypal: @uref{https://paypal.me/martianh, paypal.me/martianh}. If you would prefer a different -payment method, please write to me at and I can +payment method, please write to me at and I can provide IBAN or other bank account details. I don't have a tech worker's income, so even a small tip would help out. -- cgit v1.2.3