From 63f55bb016865b88f7df295e9d50a9e64403a474 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 4 Oct 2023 16:11:51 +0200 Subject: refactor mode function, to avoid multiple addition of lambda. --- lisp/mastodon.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 2a817ff..94189cd 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -420,14 +420,17 @@ Calls `mastodon-tl--get-buffer-type', which see." buf-names))) (switch-to-buffer choice))) +(defun mastodon-mode-hook-fun () + "Function to add to `mastodon-mode-hook'." + (when (require 'emojify nil :noerror) + (emojify-mode t) + (when mastodon-toot--enable-custom-instance-emoji + (mastodon-toot--enable-custom-emoji)) + (when mastodon-tl--highlight-current-toot + (cursor-face-highlight-mode)))) ; 29.1 + ;;;###autoload -(add-hook 'mastodon-mode-hook (lambda () - (when (require 'emojify nil :noerror) - (emojify-mode t) - (when mastodon-toot--enable-custom-instance-emoji - (mastodon-toot--enable-custom-emoji)) - (when mastodon-tl--highlight-current-toot - (cursor-face-highlight-mode))))) ; 29.1 +(add-hook 'mastodon-mode-hook #'mastodon-mode-hook-fun) ;;;###autoload (add-hook 'mastodon-mode-hook #'mastodon-profile--fetch-server-account-settings) -- cgit v1.2.3