aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-04 16:11:51 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-04 16:23:42 +0200
commit63f55bb016865b88f7df295e9d50a9e64403a474 (patch)
treeb99fa263fdf56d77232bb0d3ead503a8618a1a22 /lisp
parent3cd233610acf4cfebc5c25aa62d243dac3605ff5 (diff)
refactor mode function, to avoid multiple addition of lambda.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon.el17
1 files changed, 10 insertions, 7 deletions
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)