Any surefire method to have SLIME and SBCL work within Doom Emacs? I'm not super well versed in how to avoid issues if I upgrade my Doom Emacs install or where exactly to set it up in my own install using MELPA.
Doom has a :lang common-lisp module. Enable it by uncommenting common-lisp in ~/.doom.d/init.el, then run ~/.emacs.d/bin/doom refresh on the command line to ensure everything is installed and set up.
It uses sly, rather than slime, however (a better fork of slime).
I'm not super well versed in how to avoid issues if I upgrade my Doom Emacs install
I'm not sure how this relates to slime/sly, but you can upgrade doom and its packages by running ~/.emacs.d/bin/doom upgrade. As long as you don't modify ~/.emacs.d directly and relegate your private configuration to ~/.doom.d, doom upgrade will go smoothly (it will refuse to do anything otherwise).
set it up in my own install using MELPA.
Set up your install of SLIME? Since the :lang common-lisp module handles it for you, you don't have to worry about it, but for future reference: package management in Doom is declarative. To install your own packages, add package! declarations to ~/.doom.d/packages.el, for example:
(package! slime)
Then configure the package in ~/.doom.d/config.el, like so:
(def-package! slime
:defer t ; don't load the package immediately
:init ; runs this immediately
(setq inferior-lisp-program "sbcl")
:config ; runs this when slime loads
(set-repl-handler! 'lisp-mode #'sly-mrepl)
(set-eval-handler! 'lisp-mode #'sly-eval-region)
(set-lookup-handlers! 'lisp-mode
:definition #'sly-edit-definition
:documentation #'sly-describe-symbol)
(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode))
Remember to run doom refresh after modifying your modules or packages. It will ensure all requested packages are installed, all unneeded packages are removed, and all the needed metadata has been generated. You need to restart Emacs for your changes to take effect OR run M-x doom/reload-autoloads.
You can look up documentation in Doom with the SPC h f key (look up package! and def-package!).
Hope that helps!
Thanks! This works perfectly.
No, this is not working for me. It is showing error in def-package!
The error is: error in process sentinel: Error in private config: "config.el", (void-function def-package!)
@sree-kumar note the obsolete tag. This advice is approx a year out of date. Rename def-package! to use-package! and it should work for you. Though not sure what reason there is to use slime instead of sly.
Yes, sorry about that. I knew it was closed, but I was desperate. I have a slime configuration already for running c-lisp within emacs which I have been using for quite some time. I never came across sly. Even after changing def-package! to use-package!, I am getting this warning.
Warning (emacs): To restore SLIME in this session, customize ‘lisp-mode-hook’
and replace ‘sly-editing-mode’ with ‘slime-lisp-mode-hook’.
I don't know where to replace this. Kindly help me because I want to stick to doom emacs.
@sree-kumar Disable :lang common-lisp.
Thanks. I reverted back. But, I would like to use sly instead of slime in doom emacs. How to tell doom emacs to avoid slime and continue with sly. Even after disabling, I am getting a warning:
File mode specification error: (file-missing Cannot open load file No such file or directory sly)
Thanks again and sorry to trouble you. I am just a newbie.
@hlissner Can I have two configurations for emacs-snapshot (version 27.0), one for my previous emacs and one for new doom-emacs. If so, please let me know. Because, after migrating to doom emacs, most of my earlier configurations are not working. It takes time to adjust with doom-emcas.
Most helpful comment
Doom has a
:lang common-lispmodule. Enable it by uncommentingcommon-lispin~/.doom.d/init.el, then run~/.emacs.d/bin/doom refreshon the command line to ensure everything is installed and set up.It uses sly, rather than slime, however (a better fork of slime).
I'm not sure how this relates to slime/sly, but you can upgrade doom and its packages by running
~/.emacs.d/bin/doom upgrade. As long as you don't modify~/.emacs.ddirectly and relegate your private configuration to~/.doom.d,doom upgradewill go smoothly (it will refuse to do anything otherwise).Set up your install of SLIME? Since the
:lang common-lispmodule handles it for you, you don't have to worry about it, but for future reference: package management in Doom is declarative. To install your own packages, addpackage!declarations to~/.doom.d/packages.el, for example:Then configure the package in
~/.doom.d/config.el, like so:Remember to run
doom refreshafter modifying your modules or packages. It will ensure all requested packages are installed, all unneeded packages are removed, and all the needed metadata has been generated. You need to restart Emacs for your changes to take effect OR runM-x doom/reload-autoloads.You can look up documentation in Doom with the
SPC h fkey (look uppackage!anddef-package!).Hope that helps!