aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el51
1 files changed, 25 insertions, 26 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 5f9e6eb..825831d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -44,13 +44,15 @@
(require 'facemenu)
(require 'text-property-search)
+(eval-when-compile
+ (require 'mastodon-tl))
+
(defvar mastodon-instance-url)
(defvar mastodon-tl--buffer-spec)
(defvar mastodon-tl--enable-proportional-fonts)
(defvar mastodon-profile-account-settings)
(autoload 'iso8601-parse "iso8601")
-(autoload 'with-mastodon-buffer "mastodon")
(autoload 'mastodon-auth--user-acct "mastodon-auth")
(autoload 'mastodon-http--api "mastodon-http")
(autoload 'mastodon-http--build-array-params-alist "mastodon-http")
@@ -901,31 +903,28 @@ instance to edit a toot."
"View editing history of the toot at point in a popup buffer."
(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)))))
+ (history (mastodon-tl--property 'edit-history))
+ (buf "*mastodon-toot-edits*"))
+ (with-mastodon-buffer buf #'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."