aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-async.el
diff options
context:
space:
mode:
authorHolger Dürer <me@hdurer.net>2021-11-02 20:30:27 +0100
committerHolger Dürer <me@hdurer.net>2021-11-06 16:09:19 +0100
commit93950dbee4165c733fd8e0a4938fd7d0f462d908 (patch)
tree8a25fb5555800fc6c60159e8bbce2059b87f6ac8 /lisp/mastodon-async.el
parentb9d5d2ee57855653c32fe2fe2a495e5a3a038acf (diff)
Reformat all code.
Basically, in Emacs for each file: select all text and `indent-region`. - This also removes one redundant comment, and - fixes an error with json decoding where the `json-read-from-string` was actually not within the intended `unless` clause (which explains the warning about "result of (string-equal "" json-string) will be ignored" which I never understood.
Diffstat (limited to 'lisp/mastodon-async.el')
-rw-r--r--lisp/mastodon-async.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el
index f7bbdff..1fabee2 100644
--- a/lisp/mastodon-async.el
+++ b/lisp/mastodon-async.el
@@ -59,10 +59,10 @@
"The intermediate queue buffer name.")
(defvar-local mastodon-async--buffer "" ;;"*mastodon-async-buffer*"
- "User facing output buffer name.")
+ "User facing output buffer name.")
(defvar-local mastodon-async--http-buffer "" ;;""
- "Buffer variable bound to http output.")
+ "Buffer variable bound to http output.")
(defun mastodon-async--display-http ()
"Display the async HTTP input buffer."
@@ -177,16 +177,16 @@ is not known when `mastodon-async--setup-buffer' is called."
NAME is used to generate the display buffer and the queue."
(let ((queue-name (concat " *mastodon-async-queue-" name "-"
- mastodon-instance-url "*"))
+ mastodon-instance-url "*"))
(buffer-name (concat "*mastodon-async-display-" name "-"
- mastodon-instance-url "*")))
+ mastodon-instance-url "*")))
(mastodon-async--set-local-variables http-buffer http-buffer
buffer-name queue-name)))
(defun mastodon-async--setup-queue (http-buffer name)
"Sets up the buffer for the async queue."
(let ((queue-name (concat " *mastodon-async-queue-" name "-"
- mastodon-instance-url "*"))
+ mastodon-instance-url "*"))
(buffer-name(concat "*mastodon-async-display-" name "-"
mastodon-instance-url "*")))
(mastodon-async--set-local-variables queue-name http-buffer
@@ -203,8 +203,8 @@ ENPOINT is the endpoint for the stream and timeline."
mastodon-instance-url "*"))
(buffer-name (concat "*mastodon-async-display-" name "-"
mastodon-instance-url "*"))
- ;; if user stream, we need "timelines/home" not "timelines/user"
- ;; if notifs, we need "notifications" not "timelines/notifications"
+ ;; if user stream, we need "timelines/home" not "timelines/user"
+ ;; if notifs, we need "notifications" not "timelines/notifications"
(endpoint (if (equal name "notifications") "notifications"
(if (equal name "home") "timelines/home"
(format "timelines/%s" endpoint)))))
@@ -285,8 +285,8 @@ Filter the toots using FILTER."
;; NB notification events in streams include follow requests
(let* ((split-strings (split-string string "\n" t))
(event-type (replace-regexp-in-string
- "^event: " ""
- (car split-strings)))
+ "^event: " ""
+ (car split-strings)))
(data (replace-regexp-in-string
"^data: " "" (cadr split-strings))))
(when (equal "notification" event-type)
@@ -304,8 +304,8 @@ Filter the toots using FILTER."
(defun mastodon-async--account-local-p (json)
"Test JSON to see if account is local."
(not (string-match-p
- "@"
- (cdr (assoc 'acct (cdr (assoc 'account json)))))))
+ "@"
+ (cdr (assoc 'acct (cdr (assoc 'account json)))))))
(defun mastodon-async--output-toot (toot)
"Process TOOT and prepend it to the async user-facing buffer."