diff --git a/init.el b/init.el index 455a16e..8707331 100644 --- a/init.el +++ b/init.el @@ -2285,13 +2285,6 @@ related to your current project." (setopt erc-fill-function 'erc-fill-static) (setopt erc-fill-static-center 22) -(defun my|setup-erc-modules () - "Set up additional modules for ERC." - (add-to-list 'erc-modules 'log) - (erc-update-modules)) - -(add-hook 'erc-mode-hook #'my|setup-erc-modules) - ;; Set up logging for ERC (defconst my-erc-base-log-directory (concat (expand-file-name "~") "/logs/erc/") @@ -2344,7 +2337,6 @@ This results in a filename of the form #channel@server.txt, for example: (setopt erc-log-write-after-send t) ;;;;; ERC Services Configuration -(require 'erc-services) ;; Skip the redundant password prompt—use stored credentials instead. (setopt erc-prompt-for-nickserv-password nil) @@ -2352,15 +2344,6 @@ This results in a filename of the form #channel@server.txt, for example: ;; Let auth-source handle your NickServ credentials with discretion. (setopt erc-use-auth-source-for-nickserv-password t) -;; Enable services to handle NickServ and other IRC services. -(erc-services-mode 1) - -;;;;; ERC Spelling Configuration -(require 'erc-spelling) - -;; Ensure your messages are typo-free, because every word counts. -(erc-spelling-mode 1) - ;;;;; ERC Track Configuration (require 'erc-track) @@ -2427,6 +2410,23 @@ This function serves multiple purposes: (define-key my-keyboard-map (kbd "i") #'my/erc-start-or-switch) +;;;;; ERC hooks and modules + +(defun my|setup-erc-modules () + "Set up additional modules for ERC." + (add-to-list 'erc-modules 'log) + (erc-update-modules)) + +(with-eval-after-load 'erc + ;; Enable services to handle NickServ and other IRC services. + (add-hook 'erc-mode-hook #'erc-services-mode) + + ;; Set up additional modules for ERC. + (add-hook 'erc-mode-hook #'erc-spelling-mode) + + ;; Ensure your messages are typo-free, because every word counts. + (add-hook 'erc-mode-hook #'my|setup-erc-modules)) + ;;;; Shells ;; Setting up the switch used to have the shell execute its command line