From 9bada1a9e3fe2e6a8691e17c697ac56d96eca359 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 6 May 2023 15:59:11 +0200 Subject: restore old macro form --- lisp/mastodon-tl.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp') 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))) -- cgit v1.2.3