From 8e3b3ebb07a485f4f5e04ebaf49417bbdf0e6685 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 28 May 2024 19:02:02 +0200 Subject: get-source-pref > get-source-value --- lisp/mastodon-toot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 864d767..3eadf91 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1881,7 +1881,7 @@ EDIT means we are editing an existing toot, not composing a new one." (setq mastodon-toot--visibility (or (plist-get mastodon-profile-account-settings 'privacy) ;; use toot visibility setting from the server: - (mastodon-profile--get-source-pref 'privacy) + (mastodon-profile--get-source-value 'privacy) "public")) ; fallback (if mastodon-toot-display-orig-in-reply-buffer (progn -- cgit v1.2.3 From 0bebd58588720537b5b9d949035d4f25db0b1dbc Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 28 May 2024 19:02:38 +0200 Subject: set default language in compose buffer from is set from mastodon-profile-acccount-preferences-data --- lisp/mastodon-toot.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 3eadf91..f17cc85 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1878,11 +1878,20 @@ EDIT means we are editing an existing toot, not composing a new one." (switch-to-buffer-other-window buffer) (text-mode) (mastodon-toot-mode t) + ;; set visibility: (setq mastodon-toot--visibility (or (plist-get mastodon-profile-account-settings 'privacy) ;; use toot visibility setting from the server: (mastodon-profile--get-source-value 'privacy) "public")) ; fallback + ;; default language: + ;; NB: this is not necessarily set in + ;; `mastodon-profile-credential-account' nor in + ;; `mastodon-profile-account-settings'! + (setq mastodon-toot--language + (alist-get 'posting:default:language + mastodon-profile-acccount-preferences-data)) + ;; display original toot: (if mastodon-toot-display-orig-in-reply-buffer (progn (mastodon-toot--display-docs-and-status-fields reply-text) -- cgit v1.2.3 From c194bfd5af1ac1ef77caf17022ae9555033b3e90 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 28 May 2024 20:19:36 +0200 Subject: autoloads --- lisp/mastodon-toot.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index f17cc85..89b1eec 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -50,6 +50,7 @@ (defvar mastodon-tl--buffer-spec) (defvar mastodon-tl--enable-proportional-fonts) (defvar mastodon-profile-account-settings) +(defvar mastodon-profile-acccount-preferences-data) (autoload 'iso8601-parse "iso8601") (autoload 'mastodon-auth--user-acct "mastodon-auth") @@ -92,6 +93,8 @@ (autoload 'mastodon-views--view-scheduled-toots "mastodon-views") (autoload 'org-read-date "org") (autoload 'mastodon-tl--toot-or-base "mastodon-tl") +(autoload 'mastodon-profile--get-source-value "mastodon-toot") +(autoload 'mastodon-tl--get-buffer-type "mastodon-tl") ;; for mastodon-toot--translate-toot-text (autoload 'mastodon-tl--content "mastodon-tl") -- cgit v1.2.3 From c688fd0b6eaa02b9fe0232fed860dd4d846bebdb Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 28 May 2024 20:38:19 +0200 Subject: fix setting lang un toot compose buffer --- lisp/mastodon-profile.el | 2 +- lisp/mastodon-toot.el | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 98ac9de..712d447 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -501,7 +501,7 @@ Returns the results as an alist." "Limit string X to 255 chars max." (if (> (length x) 255) (substring x 0 255) x)) -;; used in tl.el +;; used in tl.el and toot.el: (defun mastodon-profile--get-preferences-pref (pref) "Fetch PREF from the endpoint \"/preferences\". If `mastodon-profile-acccount-preferences-data' is set, fetch diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 89b1eec..654918c 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1892,8 +1892,7 @@ EDIT means we are editing an existing toot, not composing a new one." ;; `mastodon-profile-credential-account' nor in ;; `mastodon-profile-account-settings'! (setq mastodon-toot--language - (alist-get 'posting:default:language - mastodon-profile-acccount-preferences-data)) + (mastodon-profile--get-preferences-pref 'posting:default:language)) ;; display original toot: (if mastodon-toot-display-orig-in-reply-buffer (progn -- cgit v1.2.3