reddit / emacs

[Doom Emacs] How to customize package?

Shirugentoo · 2022-05-26 14:02
Still new to Emacs and Doom so i am reading a ton of information. But i still ignore how to make changes (customize) some already installed packages. For instance, I would like to get authenticated and join some channel automatically using erc-tls. To achieve this, I tried the lots of things like: ^((use-package! erc)) or ^((package! erc)) etc. Then i paste this: ^((setq erc-prompt (lambda () (concat "\[" (buffer-name) "\]")) erc-server "irc.libera.chat" erc-nick "NICK" erc-user-full-name "FULLNAME" erc-track-shorten-start 24 erc-autojoin-channels-alist '(("irc.libera.chat" "#gentoo"")) erc-kill-buffer-on-part t erc-fill-column 100 erc-fill-function 'erc-fill-static erc-fill-static-center 20 ;; erc-auto-query 'bury )) I put everything in the config.el file but nothing works. I am using Emacs 28.1 with Doom 3.0, under Gentoo Linux. I tried some very simple changes but nothing changed. Can someone explain me how things work here? Thanks in advance, Shiru EDIT: I can log in to ERC without giving my credentials thanks to this: [https://libera.chat/guides/emacs-erc](https://libera.chat/guides/emacs-erc) (The second part of the code because I already have the first part by using Doom). The only issue is I still cannot get the channel autojoin option... EDIT2: Succeed: I can autojoin channels. The very last issue is that ERC connect automatically when i launch Doom Emacs. Is there a way to avoid this?
johan_widen · 2022-05-27 06:56
Your config.el is executed before Doom configures modules selected in init.el, and also some other doom-specific files. To ensure that your changes in config.el take effect, use the (after!) macro. Here is an example where I configure a variable for recentf, that is also changed by the Doom start up: (after! recentf (setq recentf-max-saved-items 1000))
Shirugentoo · 2022-05-27 13:31
Thanks for your explanations. That's what I've read in the documentation but it does not work when trying to customize erc. I tried to copy/paste a different code form someone else but did not work either. But if i try to modify the neotree package with the after! command, it works. So is is an erc only issue? I am confused about it. EDIT: I can log in to ERC without giving my credentials thanks to this: [https://libera.chat/guides/emacs-erc](https://libera.chat/guides/emacs-erc) (The second part of the code because I already have the first part by using Doom). The only issue is I still cannot get the channel autojoin option... EDIT2: Succeed: I can autojoin channels. The very last issue is that ERC connect automatically when i launch Doom Emacs. Is there a way to avoid this?