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-toot.el | |
parent | 51f8b782ac6721939e20eca459fe88eb4304857c (diff) |
updates to with-mastodon-buffer macro
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 9d44bfd..de6a5d4 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -902,30 +902,27 @@ instance to edit a toot." (interactive) (let ((id (mastodon-tl--property 'base-toot-id)) (history (mastodon-tl--property 'edit-history))) - (with-current-buffer (get-buffer-create "*mastodon-toot-edits*") - (let ((inhibit-read-only t)) - (special-mode) - (erase-buffer) - (let ((count 1)) - (mapc (lambda (x) - (insert (propertize (if (= count 1) - (format "%s [original]:\n" count) - (format "%s:\n" count)) - 'face font-lock-comment-face) - (mastodon-toot--insert-toot-iter x) - "\n") - (cl-incf count)) - history)) - (switch-to-buffer-other-window (current-buffer)) - (setq-local header-line-format - (propertize - (format "Edits to toot by %s:" - (alist-get 'username - (alist-get 'account (car history)))) - 'face font-lock-comment-face)) - (mastodon-tl--set-buffer-spec (buffer-name (current-buffer)) - (format "statuses/%s/history" id) - nil))))) + (with-mastodon-buffer + "*mastodon-toot-edits*" #'special-mode :other-window + (let ((count 1)) + (mapc (lambda (x) + (insert (propertize (if (= count 1) + (format "%s [original]:\n" count) + (format "%s:\n" count)) + 'face font-lock-comment-face) + (mastodon-toot--insert-toot-iter x) + "\n") + (cl-incf count)) + history)) + (setq-local header-line-format + (propertize + (format "Edits to toot by %s:" + (alist-get 'username + (alist-get 'account (car history)))) + 'face font-lock-comment-face)) + (mastodon-tl--set-buffer-spec (buffer-name (current-buffer)) + (format "statuses/%s/history" id) + nil)))) (defun mastodon-toot--insert-toot-iter (it) "Insert iteration IT of toot." |