I'm trying to load a Lisp file using the (load "myprogram.lisp") command within a Docker container, but I'm encountering the following error:
error in process filter: Wrong number of arguments: (output &optional target), 3
Here's the content of "myprogram.lisp":
(defun hello-lisp ()
(format t "Hello, Lisp!~%"))
(hello-lisp)
Location: /home/user/src/myprogram.lisp
I'm running this code inside a Docker container with the following Dockerfile contents:
FROM ubuntu:latest
# Set non-interactive mode for apt-get
ENV DEBIAN_FRONTEND=noninteractive
# Create a non-root user named "user"
RUN useradd -ms /bin/bash user
# Update the package list
RUN apt-get update
# Install necessary packages, including bzip2 and make
RUN apt-get install -y \
git \
curl \
bzip2 \
sudo \
make \
zlib1g-dev \
emacs
# grant sudo rights to `user`
RUN echo "user:user" | chpasswd && adduser user sudo
# Clean up after package installation
RUN rm -rf /var/lib/apt/lists/*
# Allow the "user" to run sudo without a password and disable TTY requirement
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user-nopasswd
RUN echo "Defaults !requiretty" >> /etc/sudoers
# Clone your .emacs.d configuration from your GitHub repository as the "user"
USER user
WORKDIR /home/user
RUN git clone https://github.com/gwangjinkim/.emacs.d.git /home/user/.emacs.d
# Download Roswell
RUN curl -sOL $(curl -s https://api.github.com/repos/roswell/roswell/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep 'roswell_' | grep 'amd64.deb')
# Install Roswell
RUN sudo dpkg -i roswell*.deb
RUN rm roswell*.deb
# Update Roswell
RUN ros update
# Set up Roswell's environment variables
ENV PATH=$PATH:/home/user/.roswell/bin
# Install SLIME using Roswell
RUN ros install slime
# Expose the port for SLIME if needed
# EXPOSE 4005
# Start Emacs as the "user"
CMD emacs
I'm not sure why this error is occurring within the Docker container. The file "myprogram.lisp" contains valid Lisp code, and I'm using a standard Lisp environment within the container. I've checked the file path, and it's correct. I'm using SBCL as my Lisp interpreter.
The problem comes from the version of swank installed by roswell (swank is the common lisp code installed in sbcl, used by slime on the emacs side to get info from the current sbcl image) which is not corresponding to the slime version installed by 'use-package' in your
~/.emacs.d/myinit.elWhen I create the image with your Dockerfile, I then run emacs, then I call
M-x slimewhich gives me the following error message :And then I've got the same error message you've mentioned in your question.
When you call slime in emacs, it tries to install the swank part automatically. So you don't have to use roswell to install swank : let slime install the correct version of swank.
To correct the error and make your container/emacs/slime/sbcl work together and have your myprogram.lisp loading correctly, do the following:
Remove the following lines from your Dockerfile :
Comment out line 275 of your ~/.emacs.d/myinit.el file:
Then rebuild your image with your Dockerfile
Then run a container with your image, (which starts emacs) :
In emacs, type
M-x slime RETthen typeC-c C-lto load your myprogram.lisp file. It should work now.