Clojure, emacs, ritz-swank: `M-x slime-connect` gives error message - debugging

I spent the afternoon trying to get the ritz-swank package to work with emacs and Clojure. (Googling the error message and much more gave no useful leads.) I hope somebody can give me some pointers that'll get me up and running.
The error is Symbol's value as variable is void: slime-ritz.
According to http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_142.html:
"If you have never given a symbol any value as a global variable, we say that that symbol's global value is void. In other words, the symbol's value cell does not have any Lisp object in it. If you try to evaluate the symbol, you get a void-variable error rather than a value.... A void variable does not have any value."
I tried to find the value of slime-ritz, using Emacs 'describe-variable' (C-h v), but it didn't return anything. Doing an appropos search on "ritz" turned up nothing, but searching for "slime" returned bunches of functions (so I assume that the slime package is present).
My installation procedure
I followed the instructions in the Install section of https://github.com/pallet/ritz/tree/develop/swank (the pallet/ritz project page), starting from scratch twice to make sure I was doing things right. Here is the sequence of my last attempt:
Began with a system containing neither Emacs nor a ~/.emacs.d directory.
Installed Emacs 24.2, the latest available Mac OS X version (from http://emacsformacosx.com/)
Installed Emacs Prelude through a curl command (see http://batsov.com/prelude/)
Downloaded (as the project page said to) specific versions of slime and slime-ritz
Installed both of them manually using M-x package-install-file
Exited and relaunched emacs, just in case....
Installed lein-ritz as per the page's instructions and successfully got:
Greggs-Mac-Pro:combolock gr$ lein ritz
user=> Swank server listening on local port 51521
M-x slime-connect (which is supposed to make the connection from Emacs to the Swank server) returned the error Symbol's value as variable is void: slime-ritz in the Emacs minibuffer.
Diagnostic data
Running M-x package-activated-list produced the following list of loaded packages:
(ace-jump-mode ack-and-a-half elisp-slime-nav exec-path-from-shell expand-region flycheck gist gh guru-mode helm-projectile helm logito magithub magit melpa paredit pcache projectile dash rainbow-delimiters rainbow-mode s slime slime-ritz solarized-theme undo-tree volatile-highlights yasnippet zenburn-theme)
Running M-x package-list-packages listed the following packages as installed:
ace-jump-mode 20121104....
ack-and-a-half 20130204....
dash 20130223....
elisp-slime-nav 20130127....
exec-path-from-... 20121108.945
expand-region 20130223....
flycheck 20130223....
gh 20121231.208
gist 20121231.212
guru-mode 20121016....
helm 20130223....
helm-projectile 20130131....
logito 20120225....
magit 20130222....
magithub 20121130....
melpa 20120202....
paredit 20110508....
pcache 20120408....
projectile 20130220....
rainbow-delimiters 20120428.45
rainbow-mode 0.6
s 20130216....
slime 20101113.1 <-- manually installed, from sources
slime-ritz 0.6.0 <-- specified by pallet/ritz page
solarized-theme 20130215....
undo-tree 20130119.926
volatile-highli... 20120215.9
yasnippet 20130218....
zenburn-theme 20130215....
I noticed that clojure-mode wasn't present, so I added that, but step 8, above, gave the same error message.
Some shot-in-the-dark questions
1) Do I need to install pallet?
2) Do I need to install any other package from the ritz family (https://github.com/pallet/ritz)?
I'm really looking forward to using ritz-swank--it looks really powerful! (Thanks to Hugo Duncan for all the hard work!)

Emacs Predule ships nrepl.el instead of swank-clojure. You need to install nrepl-ritz instead of swank-ritz. Swank-clojure is a dead project, that's no longer supported in clojure-mode 2.0.0 (the one that comes with Predule).

Related

When installing quicklisp on Windows 10, where should I put ~/.config/common-lisp/source-registry.conf.d/projects.conf for ASDF to find?

I am trying to get Common Lisp running on my Windows 10 machine and I have run into a problem with getting ASDF/(ql:quickload "...") to load a project. I generated the given project with the following command (after creating a C:\Users\ig88t\src\lisp folder):
(ql:quickload "quickproject")
(quickproject:make-project "~/src/lisp/swatchblade/" :depends-on '(vecto hunchentoot))
Which correctly generates the project and I can view the source at ~/src/lisp/swatchblade.
But I am unable to load it via
(ql:quickload "swatchblade")
Instead of loading, I get an error saying
System "swatchblade" not found [Condition of type
QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]
I am going by two manuals, one that Xach wrote and another tailored for Windows. Xach recommends ~/.config/common-lisp/source-registry.conf.d/projects.conf whereas the second recommends ~/.config/common-lisp/source-registry.conf.d/asdf.conf. I am currently using the version Xach wrote as it has worked for me on Linux.
Going by the manual for ASDF it seems that ~/AppData/Local/ is where I should store .config/common-lisp/source-registry.conf.d/projects.conf. I have tried storing it at ~/AppData/Local/config/... as well as ~/AppData/Local/.config/... to no avail. I noticed that Clozure CL installs some quicklisp data in ~/AppData/Local/common-lisp, so I tried putting the source-registry.conf.d folder there as in ~/AppData/Local/common-lisp/source-registry.conf.d/projects.conf as well but it didn't work.
I have tried a lot of different variations of placing the folder in different places but I have not managed to figure out the right one. I would really appreciate any help/suggestions by anyone using Common Lisp and Quicklisp on Windows.
I am using Clozure CL, 1.11.5, and the wx86cl64 binary which comes with ASDF version 3.1.5 in case that matters.
--- edit ---
After talking with Xach about this issue, I tried:
(quickproject:make-project "~/quicklisp/local-projects/swatch"
:depends-on '(vecto hunchentoot))
and then ran:
(ql:register-local-projects)
but upon running:
(ql:quickload "swatch")
it failed yet again with:
System "swatch" not found [Condition of type
QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]
He said it might be related to this PR for quickproject.
--- edit #2 ---
I recently tried using SBCL and things seemed to be working. I could create projects using quickproject and load them. Note that I am unable to load projects created with quickproject under CCL. However, when I restart slime/emacs, I am unable to load any projects previously created under SBCL.
; SLIME 2.20
CL-USER> (ql:quickload "quickproject")
To load "quickproject":
Load 1 ASDF system:
quickproject
; Loading "quickproject"
("quickproject")
CL-USER> (quickproject:make-project "~/quicklisp/local-projects/test/"
:depends-on '(vecto))
"test"
CL-USER> (ql:quickload "test")
To load "test":
Load 1 ASDF system:
test
; Loading "test"
[package test]
("test")
CL-USER>
--- intermission... restarting slime ---
; SLIME 2.20
CL-USER> (ql:quickload "test")
; Evaluation aborted on #<QUICKLISP-CLIENT:SYSTEM-NOT-FOUND {10034555B3}>.
CL-USER>
So I have no clue what could be causing the issue or how to resolve it, but it appears that creating/loading projects never works under Clozure CL and to works only within the current session in SBCL.
--- edit #3 ---
It seems I was wrong about SBCL. It seems that when I run
(quickproject:make-project "~/quicklisp/local-projects/test/"
:depends-on '(vecto))
It creates a folder in C:\Users\ig88t\AppData\Roaming\quicklisp\local-projects and not in C:\Users\ig88t\quicklisp\local-projects. It can load projects created within the current session as I said earlier, but is unable to find them in a new session.
(asdf::user-source-registry :direction :output)

Severe problems on getting to work jedi vim (windows)

i have already read a lot of threads with similar topics and the tag jedi-vim here on stackoverflow and also other pages.
But this problem still keeps me from doing my actual work :-/.
Up to now I have already tried several steps back and forth, but basically I did the following:
1. Install latest Python3.4 (32bit)
2. Got this precompiled VIM: (https:// bitbucket.org/Haroogan/vim-for-windows/downloads/vim-7.4.417-python-2.7-python-3.4-ruby-2.0.0-lua-5.2-perl-5.18-windows-x86.zip) (32Bit)
3. Installed Pathogen
4. Installed Flake8 successfully
5. Installed Jedi (systemwide?) with pip
6. Got Jedi-vim from github.com/davidhalter/jedi-vim and unpacked the dir jedi-vim-master to:
6.1. $HOME/vimfiles/bundle/ only
6.2. $VIM/vimfiles/bundle/ only
6.3. BOTH
python and python3 both work (before I ONLY had python3).
So
":python3 import sys; print(sys.version)" and
":python2 import sys; print(sys.version)" give an output.
In my vimrc I force jedi-vim to use python3:
"let g:jedi#force_py_version = 3"
And now the actual error is the following:
When I type e.g. "self." in a *.py-file he searches for half a sec and says:
E117: unknown function: pythoncomplete#Complete
-- Omni completion (^O^N^P) Pattern not found
When I want to call a function and want type the parameters, something pops up / gets faded in, but it's some unclear signs and not the actual parameters.
see here
Other info:
:scriptnames :
D:\tools\v\plugin\getscriptPlugin.vim
D:\tools\v\plugin\gzip.vim
D:\tools\v\plugin\matchparen.vim
D:\tools\v\plugin\netrwPlugin.vim
D:\tools\v\plugin\rrhelper.vim
D:\tools\v\plugin\spellfile.vim
D:\tools\v\plugin\tarPlugin.vim
D:\tools\v\plugin\tohtml.vim
D:\tools\v\plugin\vimballPlugin.vim
D:\tools\v\plugin\zipPlugin.vim
D:\tools\v\menu.vim
D:\tools\v\lang\menu_de.latin1.vim
D:\tools\v\lang\menu_de_de.latin1.vim
D:\tools\v\autoload\paste.vim
D:\tools\v_gvimrc
D:\tools\v\syntax\syntax.vim
D:\tools\v\syntax\synload.vim
D:\tools\v\syntax\syncolor.vim
D:\tools\v\filetype.vim
H:\vimfiles\autoload\pathogen.vim
D:\tools\v\ftoff.vim
D:\tools\v\syntax\nosyntax.vim
D:\tools\v\ftplugin.vim
D:\tools\v\indent.vim
D:\tools\v\syntax\python.vim
D:\tools\v\ftplugin\python.vim
D:\tools\v\bundle\jedi-vim-master\ftplugin\python\jedi.vim
D:\tools\v\bundle\jedi-vim-master\autoload\jedi.vim
D:\tools\v\bundle\vim-flake8-master\ftplugin\python_flake8.vim
H:\vimfiles\bundle\vim-flake8-master\ftplugin\python_flake8.vim
D:\tools\v\indent\python.vim
My vimrc:
https://drive.google.com/file/d/0Bwb4EPY-atMdOWhnOGJiNmxYbGM/view?usp=sharing
Your problem is that the jedi-vim completion function is never called.
The error message is about pythoncomplete#Complete, which is VIM's default, but it should be set to :set omnifunc=jedi#completions.
I feel like the last line in scriptnames (D:\tools\v\indent\python.vim) overwrites omnifunc. Don't know why and how it happens, but that's my gut feeling.

Cryptic Clojure error: java.lang.UnsupportedOperationException: nth not supported on this type: Symbol

I am trying to make leiningen work. I am using Windows 7. When I run in the command window
C:\lein new app my-app
I get the following error. Does anyone know what this means and where the error is occuring?
There is an explanation of the error message here but I did not understand if there is a fix or what causes the error.
C:\Users\a\work>lein new app my-app
java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
at clojure.lang.RT.nthFrom(RT.java:857)
at clojure.lang.RT.nth(RT.java:807)
at leiningen.core.project$dep_key.invoke(project.clj:175)
at leiningen.core.project$reduce_dep_step.invoke(project.clj:183)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
at clojure.core.protocols$fn__6024.invoke(protocols.clj:60)
at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
at clojure.core$reduce.invoke(core.clj:6177)
at leiningen.core.project$meta_merge.invoke(project.clj:391)
at clojure.core$merge_with$merge_entry__4279.invoke(core.clj:2698)
at clojure.core$reduce1.invoke(core.clj:896)
at clojure.core$merge_with$merge2__4281.invoke(core.clj:2701)
at clojure.core$reduce1.invoke(core.clj:896)
at clojure.core$reduce1.invoke(core.clj:887)
at clojure.core$merge_with.doInvoke(core.clj:2702)
at clojure.lang.RestFn.invoke(RestFn.java:439)
at leiningen.core.project$meta_merge.invoke(project.clj:395)
at leiningen.core.project$apply_profiles$fn__1009.invoke(project.clj:417
)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
at clojure.core.protocols$fn__6026.invoke(protocols.clj:54)
at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
at clojure.core$reduce.invoke(core.clj:6177)
at leiningen.core.project$apply_profiles.invoke(project.clj:415)
at leiningen.core.project$init_profiles.doInvoke(project.clj:603)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.core.main$_main$fn__1332.invoke(main.clj:257)
at leiningen.core.main$_main.doInvoke(main.clj:252)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:617)
at clojure.main$main_opt.invoke(main.clj:335)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at clojure.lang.Var.invoke(Var.java:431)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
C:\Users\a\work
As requested, here's my comment transferred into an answer. I suggested reinstalling Leiningen because apparently a broken Leiningen installation was the source of the problem.
As a little background explanation, I'm using Leiningen on both Linux and Windows, and I've made the experience myself that the primary method for installing Leiningen recommended on its homepage, the lein resp. lein.bat script, just works, whereas the alternative
installation methods (Linux package managers, Windows installer) often produce broken installations.
I think it's highly unlikely that this is essentially a leiningen error, since I can reproduce it without leiningen being involved in any way:
user=> (let [[foo bar] :froboz] (list foo bar))
UnsupportedOperationException nth not supported on this type: Keyword clojure.lang.RT.nthFrom (RT.java:857)

Resurrecting old PLT-Scheme project (pre-1999)

I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L option, which is referenced in the sherman.bat script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block actually is defined - see: collects/sherman/BLOCK.SS line 48. So, what is wrong?
To run the code, I perform the following steps:
Download PLT-Scheme v. 103p1 (from the old versions download page - first closing the "PLT Scheme is now Racket" banner) - for Windows, use: mz-103p1-bin-i386-win32.zip.
Unzip (e.g. to directory c:\PLT).
Copy c:\sherman\collects\sherman directory with contents to: c:\PLT\collects\sherman (where c:\sherman contains the contents of the github repository).
Run cmd.exe, then cd c:\sherman.
set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
this command is in fact, from what I understand, equivalent to:
(require-library "runtime.ss" "sherman")
(parameterize ((current-namespace sherman-namespace)) (load "trivial.s"))
(current-namespace sherman-namespace)
After that, I get the error as described above (MzScheme version would be reported as 103p1 or whatever).
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block is undefined.
Make sure that the code in block.ss is run, by
inserting (display "block.ss is loaded!") in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository,
but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library worked. It lists functios.ss
and synrule.ss as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library worked:
When require-library is used to load a file, the library name and the
resulting value(s) are recored in a table associated with the current
namespace. If require-library is evaluated for a library that is
already registered in the current namespace's load table, then the
library is not loaded again; the result(s) recorded in the load table
is returned, instead.
So when the code in block.ss is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss is evaluated, it would explain you error message of list->block being undefined.

What is the 'risky' in Emacs?

I'd like to start Emacs on Mac OS X.
When I run 'emacs' comamnd in terminal, I got the error;
signal(error ("Unknown keyword :risky"))
error("Unknown keyword %s" :risky)
custom-handle-keyword(package-load-list :risky t custom-variable)
...
..
What is the 'risky'?
I just install 'Starter Kit'.
How I solve this problem?
===== UPDATE
This error only occure in Built-in Emacs on Mac OSX Terminal.
In GUI Emacs(GNU), It works.
Here is full trace of error.
Debugger entered--Lisp error: (error "Cannot return from the debugger in an error")
signal(error ("Unknown keyword :risky"))
error("Unknown keyword %s" :risky)
custom-handle-keyword(package-load-list :risky t custom-variable)
custom-declare-variable(package-load-list (quote (all)) "List of packages for `package-initialize' to load.\nEach el$
(defcustom package-load-list (quote (all)) "List of packages for `package-initialize' to load.\nEach element in this$
eval-buffer(#> nil "/Users/rushcut/.emacs.d/package.el" nil t) ; Reading at buffer position 9123
load-with-code-conversion("/Users/rushcut/.emacs.d/package.el" "/Users/rushcut/.emacs.d/package.el" nil t)
require(package)
eval-buffer(# nil "/Users/rushcut/.emacs.d/init.el" nil t) ; Reading at buffer position 1099
load-with-code-conversion("/Users/rushcut/.emacs.d/init.el" "/Users/rushcut/.emacs.d/init.el" t t)
load("/Users/rushcut/.emacs.d/init" t t)
#[nil "^H\205\276^# \306=\203^Q^#\307^H\310Q\202A^# \311=\2033^#\312\307\313\314#\203#^#\315\202A^#\312\307\313\31$
command-line()
normal-top-level()
===== FINALLY
Install emacs 23.2.
Everything works fine.
Remove the starter kit, start fresh.
As harpo commented, to debug your actual problem, try starting Emacs with --debug-init, which should provide a stack trace showing what line caused the problem.
But really, get rid of the starter kit.
If you want to start using Emacs, check out all the other questions folks have asked about beginning Emacs and try some of the tips for beginners folks have already given. Of particular interest is a question about starting with Ergo Emacs, which is essentially the same thing as starting off with the Starter Kit.
UPDATE
From your stack trace, it looks as though the version of custom that the starter kit expects is newer than the version shipped with the Emacs you're using on the Mac. The risky is a keyword for defcustom, which was added in Emacs 23.1 (see NEWS.23.1). So, either upgrade your Mac's Emacs, download a newer version of custom (may not be possible at this point), or remove the starter kit by commenting out (require 'package) in your .init.el.

Resources