How to exit SLIME - comma or quit not working - emacs

I'm am trying to use SLIME in Emacs.
When in the SLIME REPL, inputting , (comma) ends up in the error
Comma not inside a backquote.
Inputting quit instead end up in
The variable QUIT is unbound.
Simple question then: how do I exit SLIME? What's the problem in my case?

Found the reason.
I was not using the slime-fancy metapackage, which allows you to use additional facilities from the Contributed Packages of SLIME.
I just added:
(slime-setup '(slime-fancy))
to my emacs init file.
Info on SLIME Contributed Packages at: https://www.quicklisp.org/beta/UNOFFICIAL/docs/slime/doc/Loading-Contribs.html#Loading-Contribs

Related

Emacs and Slime startup script

Every time I start work, I fire up Emacs, M-x cd to a working directory, M-x slime to start Slime, then do run (ql:quickload 'myproject) in the slime repl, (or , load-system myproject) followed by , +p myproject to switch the current package in the repl.
Lastly I run call a (start-server) in the repl to get my web server started.
I'd like for this all to be just a single Emacs keystroke or command. It's embarrassing that I have to ask this, since it's all lisp, but I can't quite figure out the interplay between Emacs and Slime here. Yet as a programmer I feel like I should automate all tedious processes - and I foresee several more steps being added to this.
I guess the tricky part is sending slime commands and then waiting for quicklisp to finish before sending the next command.
Any pointers would be appreciated!
Edit: Thanks to Svante for the C-c ~ hint, which was news to me
On the Emacs side, you can bind a key to a command than calls slime with additional arguments:
(defun my-lisp ()
(interactive)
(slime (concat "sbcl --load " <path-to-your-lisp-script>)))
And in your Lisp script, for example:
(ql:quickload :my-system)
(in-package :my-package)
(start-server)

Emacs Slime - Comma doesn't work

I have emacs 24.5.1 on windows with slime installed. I am using sbcl for lisp. When I open up slime, it works, but whenever I try to use comma to invoke a command, it just enters a comma. I can't get to the slime command menu. Is there any other way to get to the command menu besides comma?
Found the solution.
When going to the slime git website, they said you should include this in your initialization file
(setq slime-contribs '(slime-fancy))
It works after adding that to init.el (equivalent of .emacs)

Use repl for Hy in Emacs

I have successfully installed hy-mode from https://github.com/hylang/hy-mode. I now can open a .hy file in emacs and have syntax highlighting, and editing with paredit is a joy.
I however, don't know how to start a REPL. At the bottom of the github readme, it says:
When in hy-mode, you can launch a Hy REPL by launching a Lisp inferior
process
M-x lisp-inferior-process
That function, however, is not defined for me. What else do I need to install or check to be able to use the repl for Hy?
I am currently using:
GNU Emacs 24.3.1.
Have you tried to set inferior-lisp-program to "hy" and then doing M-x run-lisp?
This is the standard way (or maybe just the "way I know about") of having an inferior lisp process.
As of version 1.0.4 of hy-mode, you can start a hy repl buffer in Emacs using M-x run-hy or use the default key binding of C-c C-z.
In any Emacs mode, including hy-mode, you can use M-x describe-mode or the default key binding of C-h m to show key bindings for the current mode.

absolutely pure emacs initialization

I'd like to run emacs without any installed plugins. Emacs manual says that you may use -q option to skip init file. I've tried emacs -q and discovered that plugins from /usr/share/emacs/site-lisp (ubuntu installs plugins here) are still loaded.
I've searched google about emacs's initialization routine and found nothing usefull. I'm curios what emacs do step by step while initializing and what variables, options, evironment, etc. may change default behaviour.
Try emacs -Q
From the manpage:
-Q, --quick
Similar to "-q --no-site-file --no-splash". Also, avoid processing X resources.
If you only want to avoid loading site lisp code, you might want to run
emacs -q --no-site-file
Emacs == self-documenting.
C-hig (emacs) Emacs Invocation RET
If you really want to get into the details, you can peruse startup.el with
M-x find-library RET startup RET

Unable to evaluate form in nrepl + emacs

I have installed the nrepl, clojure-mode and starter-kit-lisp packages. I am able to start the nrepl by opening my .clj file and then M-x nrepl-jack-in.
However when I evaluate any form in my .clj file by C-x C-e, I get the following message:
inferior-lisp-proc: No Lisp subprocess; see variable `inferior-lisp-buffer'
How do I get it right?
I have had this problem a number of times. In all cases, it has been because while nrepl has started, the nrepl minor mode has not been enabled in the clj buffer. As a result, any evaluation attempts fail with this error.
There should be a "nrepl" menu item. If there isn't, this may be your problem. M-x nrepl-enable-on-existing-buffers should fix it.
I had this problem for a while, and now it appears to have gone away; you might want to try installing clojure-mode and nrepl afresh.
Are you sure M-x nrepl-jack-in worked? If it did, you should be prompted with a repl in emacs, like so:
nrepl requires leiningen 2, so make sure that you use the right version in your project and that the nrepl plugin is properly installed.
Also make sure that the major mode when editing your .clj file is clojure-mode.
You might want to post a screenshot to make it easier to spot the problem.