diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-04 09:12:23 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-04 09:18:16 +0200 |
commit | 59e5e3ece54bcac36d9debad392bff25a31438b5 (patch) | |
tree | 8db6eb8de522a0d56c75b1bcb1f482a1fa4b93cb /lisp/mastodon-views.el | |
parent | 51f8b782ac6721939e20eca459fe88eb4304857c (diff) |
updates to with-mastodon-buffer macro
Diffstat (limited to 'lisp/mastodon-views.el')
-rw-r--r-- | lisp/mastodon-views.el | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 7481fc3..8585bb0 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -799,30 +799,27 @@ INSTANCE is the instance were are working with." (let* ((domain (url-file-nondirectory instance)) (buf (get-buffer-create (format "*mastodon-instance-%s*" domain)))) - (with-current-buffer buf - (switch-to-buffer-other-window buf) - (let ((inhibit-read-only t)) - (erase-buffer) - (special-mode) - (when brief - (setq response - (list (assoc 'uri response) - (assoc 'title response) - (assoc 'short_description response) - (assoc 'email response) - (cons 'contact_account - (list - (assoc 'username - (assoc 'contact_account response)))) - (assoc 'rules response) - (assoc 'stats response)))) - (mastodon-views--print-json-keys response) - ;; (mastodon-mode) ; breaks our 'q' binding that avoids leaving - ;; split window - (mastodon-tl--set-buffer-spec (buffer-name buf) - "instance" - nil) - (goto-char (point-min))))))) + (with-mastodon-buffer + buf #'special-mode :other-window + (when brief + (setq response + (list (assoc 'uri response) + (assoc 'title response) + (assoc 'short_description response) + (assoc 'email response) + (cons 'contact_account + (list + (assoc 'username + (assoc 'contact_account response)))) + (assoc 'rules response) + (assoc 'stats response)))) + (mastodon-views--print-json-keys response) + ;; (mastodon-mode) ; breaks our 'q' binding that avoids leaving + ;; split window + (mastodon-tl--set-buffer-spec (buffer-name buf) + "instance" + nil) + (goto-char (point-min)))))) (defun mastodon-views--format-key (el pad) "Format a key of element EL, a cons, with PAD padding." |