Swank server startup failure - emacs

Emacs SLIME can't connect to swank, because apparently swank cannot initialize correctly.
It says some back end function not implemented. However, my swamp backend is SBCL, which is supported. I am using windows xp os.
A similar issue was found posted at the following link, but no solution.Link to similar issue
Am I missing any configuration file for Swank? Or perhaps emacs and SBCL versions I am using have compatibility issues? In that case, where can I get the correct compatibility matrix for windows?

I'm mostly using Linux, but it's very easy to run into conflicts if you have multiple versions of slime/swank code installed.
The best method is to use quicklisp and make sbcl/emacs not use any other code (at least in your first attempt):
sbcl --no-userinit --no-sysinit --load ~/quicklisp/setup.lisp
(asdf:initialize-source-registry '(:source-registry :ignore-inherited-configuration))
(ql:quickload "quicklisp-slime-helper")
(swank:create-server :port 4545 :dont-close t :coding-system "utf-8-unix")
Then start emacs as:
emacs -q -name SLIME -eval '(progn (load (expand-file-name "~/quicklisp/slime-helper.el")) (slime-connect "localhost" 4545))'

http://www.pchristensen.com/blog/articles/installing-sbcl-emacs-and-slime-on-windows-xp
Use this or any other manual, which describes how to install Emacs, sbcl and slime separately. But using the latest releases. Then it will be easier to find the problem than it is now.

This is not exactly an answer to the problem, more of an alternative.
I think some interfaces/ method definitions that Swank expects, need to be implemented by SBCL. I shifted the lisp implementation to CLisp from SBCL, and after some setup tweaking, got it to work. So, I think Swank is fine but SBCL is not.
Just for information, CLisp cannot work with short windows path, the ones that look like "Progra~1", while SBCL expects short paths. CLisp also gave some problem with the temp folder in Windows, for which a variable had to be added to the .emacs file, but after that was setup quickly.
There seem to be lots of differences between the various Lisp implementations' ports to Windows, which would not be a problem had better documentation been present. All this had to be gleaned from different blogs and mailing list.
As soon as a better answer to the original problem comes along, I'll accept that.

Related

Common Lisp auto completion in emacs

Update
Apparently, the auto-complete package is not the culprit.
Emacs fails to download melpa archive.
A quick google search indicates that this is a reappearing problem both on windows and unix machines.
As there are already threads concerning failed to download 'melpa' archive (none of which helped unfortunately) this thread may or may not be closed.
Inital Question
I'm trying to set up emacs for Common Lisp.
I installed sbcl and the slime package.
Some time ago I used to have auto completion for Common Lisp keywords in emacs such that - while typing - it suggested a word via a greyed out completion (TAB for acceptance) or via drop down or both. (I can't remember exactly.)
I'm struggling to get this working again.
At https://github.com/purcell/ac-slime it is suggested to first install auto-complete but when I type package-list-packages there is no such package. (But there are plenty named auto-complete-*).
(I set up Melpa with:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/")))
The provided link http://cx4a.org/software/auto-complete/ is dead as well.M-x install-package [RET] auto-complete [RET] also fails. Emacs says: [No match]
So my question is:
If there is no auto-complete package anymore, what is a good way to set up Common Lisp auto completion in emacs in the way mentioned above (greyed out word or dropdown)?
The current home-page for auto-complete is https://github.com/auto-complete/auto-complete
Installing it should be enough to allow you to use ac-slime (there is also a completion version using company).
Here is how I got it to work.
Download the .ZIP archive with repository here.
Unzip
Run M-x package-install-file
On the prompt, specify the path to the downloaded repository and the file named auto-complete.el.
Make sure that installation returns something along the lines of "Successful"
Add this line to your Emacs initialization file (.emacs):
(ac-config-default)
To auto-complete in SLIME, follow similar step to install ac-slime (requires SLIME and Auto-complete)
P.S. There is another package called company (stands for Complete Anything), which is quite good as an alternative. I am trying it out now. Getting it to work was very simple.

Spawning child processes returns invalid argument

I have a class this semester that requires a lisp dialect so I'm trying to get started with Clojure but I'm running into a lot of problems setting up my environment.
I'm on a Windows machine and am following the tutorial at http://www.braveclojure.com/basic-emacs/ to set up emacs which from my research seems like the best IDE for working with lisp. I had Cygwin installed before starting which supposedly has a lot of support for emacs but I'm not sure if I need to do more than just have it installed.
My problems is when I try to start a REPL in emacs with M-x cider-jack-in I get the response Spawning child process: invalid argument. If I do the M-x load-path command I get a list of every subfolder in my .emacs.d folder but not the .d folder itself but the folder where my cider package is installed is clearly listed.
I installed lein before I decided to try setting up emacs and I could open a REPL just fine with it but emacs seems like a much better way of working than just using the terminal.
Any advice is greatly appreciated but if there is a better/easier way to get started with Clojure on Windows than what I'm currently doing I'd love to hear about it.
Thanks in advance for any replies.
Yes, emacs is great, but if you haven't worked with it before then you will have a very steep learning curve, exacerbated by the fact you are running Windows. I myself use emacs with CIDER a lot, and I also use emacs on Windows quite a bit, but I don't mix it - I use emacs/CIDER only on Linux. It doesn't mean at all that it can't be made to work on Windows, it's just it has a lot of complexity of its own, which you might not have time or inclination to deal with right now. (By the way, I wouldn't recommend using emacs under Cygwin [1] , use a good native build instead. And if you still decide to go with emacs, by all means try Prelude - it comes from the author of CIDER by the way.)
If you want an option that is definitely smoother under the circumstances, download IntelliJ IDEA Community Edition and install Cursive. That will have its own learning curve for sure, but give it a try and see what you prefer. I use both, nothing beats IntelliJ/Cursive in Java interop projects.
Both emacs/CIDER and IntelliJ/Cursive are terrific and will repay for deeper learning.
[1] I am not even sure a combination of emacs on Cygwin and lein/clojure on Win32 can work, but I have no environment to test.
unset the SHELL env variable - taken from: http://tb-nguyen.blogspot.com/2010/05/how-to-fix-emacs-windows-error-spawning.html
It worked for me

Racket and Geiser on Windows, strange path error

When I try (run-racket) or (run-geiser) on my Windows 8.1 machine running GNU Emacs 24.3 and Racket v6.1 I get the following output:
Welcome to Racket v6.1.
default-load-handler: cannot open input file
path: f:/c/Users/James/AppData/Roaming/.emacs.d/el-get/geiser/scheme/racket/geiser/startup.rkt
system error: The system cannot find the path specified.; errno=3
>
Which is decidedly odd, but after browsing the backtrace I still don't have a good idea what's going on.
Indeed, since Racket starts up fine it seems to be some strangeness in the way paths are passed from Geiser to Racket. The only other time I see this kind of path strangeness is when MinGW bash is involved, and that /c/ makes me think that it probably is. In fact, that path would be perfectly valid if not for the leading f:.
I'm at a bit of a loss as to how to approach this problem, as I don't know how Geiser communicates with Racket (I just started trying to use it today), but I would really like to get it to work, as I'm quite invested in Emacs as my editor.
So my question is thus: What possible problem points should I investigate, given the above as clues?
After some digging through the Geiser source I found in geiser/elisp/geiser-load.el the line:
(setq geiser-scheme-dir "/c/Users/James/AppData/Roaming/.emacs.d/el-get/geiser/scheme")
Which was probably generated incorrectly by MinGW make.
I changed it to:
(setq geiser-scheme-dir "c:/Users/James/AppData/Roaming/.emacs.d/el-get/geiser/scheme")
After which everything works perfectly.
The problem was that Emacs' expand-file-name assumed that the /c/... path was a relative path due to the initial forward slash, and guessed that it should prepend the letter of the current drive to make it a proper Windows Emacs path.

Why clojure starts with 'M-x slime' for my Aquamacs without any setup?

I have Aquamacs running on my Mac.
I installed the ESK for Aquamacs and it installs ELPA at ~/.emacs.d/elpa. With ELPA, I installed clojure-mode/clojure-est-mode/slime/slime-repl/swank-clojure.
The thing is that when I run 'M-x slime', clojure is run. Why is this? I'm curious as I don't have any setup for slime in my .emacs and even in /Users/smcho/Library/Preferences/Aquamacs Emacs/{Preferences.el, customizations.el}. I mean, I don't have (setq inferior-lisp-program "clojure") or something.
Or, does it have to do with my 'swank-clojure' installation? I see something like this at the inferior-lisp buffer.
(require 'swank.swank)
(swank.swank/ignore-protocol-version nil)
...
#ServerSocket ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=51847]
That's because of swank-clojure.el, a deprecated elisp program. Don't use it, as per my post here, on your next question. It may have bugs and thus isn't suitable to use. Use M-x slime-connect instead, after starting swank up with lein swank.
As Isaac said, swank-clojure.el sets 'slime-lisp-implementations' for clojure (in short, a way to start java with swank-clojure in classpath so that swank can be started). Then slime connects to this port and you get the repl.
The problem with this approach is that, you will need to setup classpath upfront. This gets tedious for each and every project you want to work on. So, best way is to use M-x swank-clojure-project or lein swank and then M-x slime-connect. I prefer swank-clojure-project.

Emacs on Windows for C++ development configuration?

Has anyone set up cygwin and some emacs to work well under a 64-bit Windows 7?
I tried downloading cygwin recently, and by default not even dired works reliably, there are odd shell prompt characters, I get a lot of warnings, in one case C-c was read as C-g and caused various errors. (Neither xemacs nor emacs worked for me, where by "work" I mean that dired and shell work, and without warnings).
I just want the usual emacs development tools: gdb-mode, shell-mode, compiling, tag-search to work as normal.
I was hoping someone who has done this recently with cygwin could share whatever relevant shell files, emacs files, environment variables, and so on to make this all work. Should all these things just work out of the box?
You should check out ntemacs, with this code in your .emacs everything is working great with cygwin:
;; -- sets up cygwin
(let* ((cygwin-root "c:/cygwin")
(cygwin-bin (concat cygwin-root "/bin")))
(when (and (eq 'windows-nt system-type)
(file-readable-p cygwin-root))
(setq exec-path (cons cygwin-bin exec-path))
(setenv "PATH" (concat cygwin-bin ";" (getenv "PATH")))
(setq shell-file-name "bash")
(setenv "SHELL" shell-file-name)
(setq explicit-shell-file-name shell-file-name)
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)))
I use a hideous Frankenstein mix of "native" Win32 emacs (http://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-23.1.97-bin-i386.zip is the latest, but I'm using an older version) and Cygwin -- for bash, find, etc. It's taken me years to tweak things to my liking, and it's still a pretty bumpy experience.
Anyway it's worth trying.
I use a straight clean install of Emacs, gcc, gdb, make, etc from Cygwin (currently 1.7.15, but I've been doing this for years) and my standard dotfiles (.emacs, .bashrc/.bash_profile) that have been tweaked (but not really heavily) to be portable across Linux and Cygwin, and everything works fine for me. Occasionally I run into problems (like with processing2-mode where Processing doesn't have a Cygwin package yet, so it wants native Windows paths, but that's easily enough fixed and out of the ordinary. It almost sounds to me like something is fundamentally broken on your setup; could you give more details? Otherwise all I can recommend is wipe and do a clean reinstall.