I have the following line in my emacs init file.
(setq auto-mode-alist (cons `("\*nrepl\*" . paredit-mode) auto-mode-alist))
I check that this works by creating a new buffer called *nrepl* Ctrl-x-f *nrepl*
. Yes, the *nrepl* buffer has Paredit active, paredit-mode was enabled.
I close the *nrepl* buffer without saving it.
I start up a nrepl session by typing M-x nrepl-jack-in
. The nrepl server starts up and I am presented with the nrepl repl. The nrepl repl is also called *nrepl*, however Paredit is not enabled.
What am I doing wrong?
You're confusing buffers and files: auto-mode-alist
matches file names against regexps to decide which mode to use when editing those files. But *nrepl* is a buffer that does not contain a file, so auto-mode-alist
has no effect for it.
Instead, you probably want to figure out which major-mode *nrepl* uses and then use (add-hook '<the-major-mode>-hook 'paredit-mode)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With