aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-06 15:59:11 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-06 15:59:11 +0200
commit9bada1a9e3fe2e6a8691e17c697ac56d96eca359 (patch)
treea0073ae1b04cd3c5b1282b6cf5c49769859871db
parentacde8c11694298a734da97be490856c025a96db8 (diff)
restore old macro form
-rw-r--r--lisp/mastodon-tl.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 31c73a2..f62413f 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -258,17 +258,20 @@ It is active where point is placed by `mastodon-tl--goto-next-toot.'")
;;; MACRO
-(defmacro with-mastodon-buffer (buffer &rest body)
+(defmacro with-mastodon-buffer (buffer mode-fun other-window &rest body)
"Evaluate BODY in a new or existing buffer called BUFFER.
MODE-FUN is called to set the major mode.
OTHER-WINDOW means call `switch-to-buffer-other-window' rather
than `switch-to-buffer'."
(declare (debug t)
- (indent defun))
+ (indent 3))
`(with-current-buffer (get-buffer-create ,buffer)
(let ((inhibit-read-only t))
(erase-buffer)
- (switch-to-buffer ,buffer)
+ (funcall ,mode-fun)
+ (if ,other-window
+ (switch-to-buffer-other-window ,buffer)
+ (switch-to-buffer ,buffer))
,@body)))