Skip to content

Commit

Permalink
Optimize ERC setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Dec 2, 2024
1 parent 5032d81 commit 4e5f244
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down Expand Up @@ -2344,23 +2337,13 @@ 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)

;; 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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4e5f244

Please sign in to comment.