aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/mastodon-async.el13
-rw-r--r--lisp/mastodon-search.el19
2 files changed, 13 insertions, 19 deletions
diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el
index 8a08416..58e7b93 100644
--- a/lisp/mastodon-async.el
+++ b/lisp/mastodon-async.el
@@ -229,14 +229,11 @@ ENDPOINT is the endpoint for the stream and timeline."
(mastodon-tl--timeline (mastodon-http--get-json
(mastodon-http--api endpoint))))
(mastodon-mode)
- (setq mastodon-tl--buffer-spec
- `(buffer-name
- ,buffer-name
- endpoint ,endpoint
- update-function
- ,(if (equal name "notifications")
- 'mastodon-notifications--timeline
- 'mastodon-tl--timeline)))
+ (mastodon-tl--set-buffer-spec buffer-name
+ endpoint
+ ,(if (equal name "notifications")
+ 'mastodon-notifications--timeline
+ 'mastodon-tl--timeline))
(setq-local mastodon-tl--enable-relative-timestamps nil)
(setq-local mastodon-tl--display-media-p t)
(current-buffer))))
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 65c5aba..4aa5721 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -40,12 +40,13 @@
(autoload 'mastodon-auth--access-token "mastodon-auth")
(autoload 'mastodon-http--get-search-json "mastodon-http")
(autoload 'mastodon-http--api "mastodon-http")
+(autoload 'mastodon-tl--set-buffer-spec "mastodon-tl")
+
(defvar mastodon-toot--completion-style-for-mentions)
(defvar mastodon-instance-url)
(defvar mastodon-tl--link-keymap)
(defvar mastodon-http--timeout)
(defvar mastodon-toot--enable-completion-for-mentions)
-(defvar mastodon-tl--buffer-spec)
;; functions for completion of mentions in mastodon-toot
@@ -101,11 +102,9 @@ QUERY is the string to search."
(mastodon-mode)
(let ((inhibit-read-only t))
(erase-buffer)
- (setq mastodon-tl--buffer-spec
- `(buffer-name ,buffer
- endpoint ,(format "api/v1/trends")
- update-function
- (lambda (toot) (message "Trends."))))
+ (mastodon-tl--set-buffer-spec buffer
+ "api/v1/trends"
+ nil)
;; hashtag results:
(insert (mastodon-tl--set-face
(concat "\n ------------\n"
@@ -141,11 +140,9 @@ QUERY is the string to search."
(mastodon-mode)
(let ((inhibit-read-only t))
(erase-buffer)
- (setq mastodon-tl--buffer-spec
- `(buffer-name ,buffer
- endpoint ,(format "api/v2/search")
- update-function
- (lambda (toot) (message "Searched."))))
+ (mastodon-tl--set-buffer-spec buffer
+ "api/v2/search"
+ nil)
;; user results:
(insert (mastodon-tl--set-face
(concat "\n ------------\n"