diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-23 21:48:12 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-23 21:48:12 +0200 |
commit | 1adae0361a479003946ab804567d835627314197 (patch) | |
tree | a9d38c35905aa560ec47b4e5fd592e33d21a6064 /lisp | |
parent | ebbeaa745a107b0ebba25858553b6a52532f672d (diff) |
macros together in tl.el
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-tl.el | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index fa2bca6..1b7c954 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -257,7 +257,7 @@ types of mastodon links and not just shr.el-generated ones.") It is active where point is placed by `mastodon-tl--goto-next-toot.'") -;;; BUFFER MACRO +;;; MACROS (defmacro with-mastodon-buffer (buffer mode-fun other-window &rest body) "Evaluate BODY in a new or existing buffer called BUFFER. @@ -275,6 +275,21 @@ than `switch-to-buffer'." (switch-to-buffer ,buffer)) ,@body))) +(defmacro mastodon-tl--do-if-toot (&rest body) + "Execute BODY if we have a toot or user at point." + (declare (debug t)) + `(if (and (not (mastodon-tl--profile-buffer-p)) + (not (mastodon-tl--property 'toot-json))) ; includes user listings + (message "Looks like there's no toot or user at point?") + ,@body)) + +(defmacro mastodon-tl--do-if-toot-strict (&rest body) + "Execute BODY if we have a toot, and only a toot, at point." + (declare (debug t)) + `(if (not (mastodon-tl--property 'toot-id :no-move)) + (message "Looks like there's no toot at point?") + ,@body)) + ;;; NAV @@ -1798,21 +1813,6 @@ ID is that of the post the context is currently displayed for." ;;; FOLLOW/BLOCK/MUTE, ETC -(defmacro mastodon-tl--do-if-toot (&rest body) - "Execute BODY if we have a toot or user at point." - (declare (debug t)) - `(if (and (not (mastodon-tl--profile-buffer-p)) - (not (mastodon-tl--property 'toot-json))) ; includes user listings - (message "Looks like there's no toot or user at point?") - ,@body)) - -(defmacro mastodon-tl--do-if-toot-strict (&rest body) - "Execute BODY if we have a toot, and only a toot, at point." - (declare (debug t)) - `(if (not (mastodon-tl--property 'toot-id :no-move)) - (message "Looks like there's no toot at point?") - ,@body)) - (defun mastodon-tl--follow-user (user-handle &optional notify langs) "Query for USER-HANDLE from current status and follow that user. If NOTIFY is \"true\", enable notifications when that user posts. |