2

I'm a happy user of Emacs and SLIME.

It looks like SLIME is aware of only files with the extension ".lisp" and not others such as ".cl" or ".asd"

How can I make SLIME aware of and work with different file extensions? Thanks.

2
  • What do you mean by "aware of"?
    – nanny
    Dec 23, 2015 at 20:33
  • When I start out with an *.asd file on SLIME, the C-c C-c just doesn't work though *.asd is a proper lisp file. So I had to change the extension to .lisp and I think that's redundant work.
    – Terry
    Dec 23, 2015 at 22:27

1 Answer 1

3

Try adding:

(add-to-list 'auto-mode-alist '("\\.cl\\'" . slime-mode))
(add-to-list 'auto-mode-alist '("\\.asd\\'" . slime-mode))

to your init/config file. Then files with those extensions will use slime-mode by default. This pattern of (add-to-list 'auto-mode-alist '("\\.EXTENSION\\'" . MODE)) is a good way to have files with the extension EXTENSION open in the mode MODE. Just be careful that you have the "\\.EXTENSION\\'" part, which is a regular expression, formatted correctly (with slashes and quotes in the right places), or you will will not get the results you want.

3
  • It was looking likely to work but it didn't. I added those lines to my CMUCL init script at ~/.cmucl-init.lisp and then it said : Error in KERNEL:%COERCE-TO-FUNCTION: the function ADD-TO-LIST is undefined. I deleted them from cmucl-init and added to ~/.emacs, but this time it made no difference, .cl files are still not evaluated.
    – Terry
    Dec 23, 2015 at 22:40
  • It definitely needs to be added to your .emacs and not the other init script you mention. Also, it probably should be added after slime is loaded
    – elethan
    Dec 23, 2015 at 22:49
  • @Ömer You'll want to use lisp-mode instead of slime-mode.
    – nanny
    Dec 29, 2015 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.