I'm trying to set up a Lisp development environment inside a Docker container, but I'm facing issues with getting SLIME in Emacs to work correctly with my Lisp configuration. Here are the details of my setup:
Dockerfile:
# Use a base image with Debian Buster
FROM debian:buster
# Set environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
# Install necessary system dependencies
RUN apt-get update && \
apt-get install -y \
emacs-nox \
sbcl \
git
# Install SLIME for Emacs and Quicklisp
RUN sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit
# Create the directory for local Quicklisp projects
RUN mkdir -p /root/quicklisp/local-projects
# Clone CodeGrader repository and configure SBCL
RUN git clone https://github.com/marcus3santos/codegrader.git /root/quicklisp/local-projects/codegrader && \
echo '(ql:quickload :rutils)' >> /root/.sbclrc && \
echo '(ql:quickload :codegrader)' >> /root/.sbclrc
# Configure SLIME for Emacs
RUN echo "(setq inferior-lisp-program \"sbcl\")" >> /root/.emacs && \
echo "(require 'slime)" >> /root/.emacs && \
echo "(slime-setup '(slime-repl))" >> /root/.emacs
I've followed the following setup instructions as per my course guidelines:
Configuring SBCL:
- Using a program text editor, I opened the
~/.sbclrcfile located in my home directory within the Docker container. - I copy-pasted and saved the following code at the bottom of the existing content in
~/.sbclrc:
(ql:quickload :rutils) (ql:quickload :codegrader)- Using a program text editor, I opened the
Emacs and SLIME Configuration:
- I started Emacs by running the
emacscommand within the Docker container. - To configure SLIME, I pressed
Alt+x(orM-x), typedslime, and pressed Enter. However, I received a message stating "No match" or "No such command."
- I started Emacs by running the
Issue:
The problem I'm encountering is that SLIME doesn't seem to be available, and there's no match found when I invoke M-x slime. Additionally, SLIME does not interact correctly with my Lisp environment. Instead of displaying the expected feedback messages and scores, there's no output, and it appears that SLIME is not functioning as expected.
I tried today along and was able to generate a working example. However, I am using my personal
.emacs.dwhich is then pulled into Dockerfile. And there is a compatibility problem between Swank 2.28 and Slime 2.26.1, but if you just choose yes and go on, it will work.The Dockerfile:
And you build it in the terminal from the folder where the Dockerfile is placed by:
and run the container by:
I used
ubuntu:latestbecause this caused least amount of problems. And the comments should explain what is done.Once open, you do in emacs:
C-x C-fand create the file:test.lisp. From within it, activate slime byM-x slime- screen will be splitted and SLIME will start - when asked for the incompativility - just typey- and it slime will start.Move cursor from the left to the right buffer and back by
C-x o.