Fork me on GitHub
#emacs
<
2024-04-26
>
Hasan Ahmed22:04:54

Hello again, I am trying to configure emacs to enable paredit-mode for clj files using below in config.el (add-to-list 'auto-mode-alist '("\\.clj\\'" . paredit-mode)) What happens now is after i open/create a new clojure file, the other modes are such as cider-mode, clojure-mode are not enabled. Don't think it makes a difference but I am using doom.

Patrix01:04:17

Doesn’t paredit come out of the box in doom if you enable the clojure module?

Patrix01:04:58

Also afaik paredit should be a minor mode, but your config makes it the main mode. Which would then override Cider etc

Patrix06:04:49

Here's how I did it:

(after! lisp-mode
  (add-hook! 'lisp-mode-hook #'paredit-mode)
  (add-hook! 'sly-mode #'paredit-mode))

(after! clojure-mode
  (add-hook! 'clojure-mode-hook #'paredit-mode)
  (add-hook! 'cider-repl-mode #'paredit-mode))

🙌 1
Patrix06:04:20

the after! macros are doom emacs specific, see their docs for details

Hasan Ahmed13:04:13

if i remember correctly, i had to package-install paredit

Hasan Ahmed13:04:53

yay this works, thanks brother

andrea.crotti15:04:29

In general you should use hooks, not change auto-mode-alist

Patrix21:04:36

To install it properly, use the package! macro otherwise doom will uninstall it next time you use the sync script.