aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-11 14:40:22 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-11 14:40:22 +0200
commitb607c4e800235312350b56f7e845a56fe6b29248 (patch)
treee8180ec9d9957aa76d1d729e4524cf81b9a088b6
parentb2b33d85ef21b82059ecf97518795cd94221c576 (diff)
docstrings autoloads local funs
-rw-r--r--lisp/mastodon-toot.el23
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 2f58bfb..f1d4343 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -50,6 +50,8 @@
(defvar mastodon-instance-url)
(defvar mastodon-tl--buffer-spec)
(defvar mastodon-tl--enable-proportional-fonts)
+(defvar mastodon-profile-account-settings)
+
(autoload 'mastodon-auth--user-acct "mastodon-auth")
(autoload 'mastodon-http--api "mastodon-http")
(autoload 'mastodon-http--delete "mastodon-http")
@@ -196,13 +198,17 @@ send.")
nil t)))
(mastodon-profile--update-preference "privacy" vis :source)))
-(defun mastodon-toot--get-max-toot-chars (&optional no-toot)
- "Fetch max_toot_chars from `mastodon-instance-url' asynchronously."
+(defun mastodon-toot--get-max-toot-chars (&optional _no-toot)
+ "Fetch max_toot_chars from `mastodon-instance-url' asynchronously.
+NO-TOOT means we are not calling from a toot buffer."
(mastodon-http--get-json-async
- (mastodon-http--api "instance") 'mastodon-toot--get-max-toot-chars-callback 'no-toot))
+ (mastodon-http--api "instance")
+ 'mastodon-toot--get-max-toot-chars-callback 'no-toot))
-(defun mastodon-toot--get-max-toot-chars-callback (json-response &optional no-toot)
- "Set max_toot_chars returned in JSON-RESPONSE and display in new toot buffer."
+(defun mastodon-toot--get-max-toot-chars-callback (json-response
+ &optional no-toot)
+ "Set max_toot_chars returned in JSON-RESPONSE and display in new toot buffer.
+NO-TOOT means we are not calling from a toot buffer."
(let ((max-chars
(or
(alist-get 'max_toot_chars json-response)
@@ -1066,16 +1072,15 @@ REPLY-JSON is the full JSON of the toot being replied to."
(list 'invisible (not mastodon-toot--content-warning)
'face 'mastodon-cw-face)))))
-(defun mastodon-toot-save-toot-text (&rest _args)
+(defun mastodon-toot--save-toot-text (&rest _args)
"Save the current toot text in `mastodon-toot-current-toot-text'.
Added to `after-change-functions' in new toot buffers."
- (interactive)
(let ((text (mastodon-toot--remove-docs)))
(unless (string-empty-p text)
(setq mastodon-toot-current-toot-text text))))
(defun mastodon-toot-open-draft-toot ()
- "Prompt for a draft toot and open a new compose buffer containing the draft."
+ "Prompt for a draft and compose a toot with it."
(interactive)
(if mastodon-toot-draft-toots-list
(let ((text (completing-read "Select draft toot: "
@@ -1165,7 +1170,7 @@ a draft into the buffer."
(mastodon-toot--update-status-fields)
;; draft toot text saving:
(setq mastodon-toot-current-toot-text nil)
- (push #'mastodon-toot-save-toot-text after-change-functions)
+ (push #'mastodon-toot--save-toot-text after-change-functions)
(when initial-text
(insert initial-text))))