I've started using SmartCompile to compile Java programs and run them from within emacs. The following line of code is supposed to both compile and run Java programs after they've been compiled successfully.
(add-to-list 'smart-compile-alist '("\\.java$" . "javac %f" && "java %n"))
However, if I try the following command in Windows and OS X:
(add-to-list 'smart-compile-alist '("\\.java$" . "javac %f" && "java %n"))
It does not run the program after compiling.
And every time I start up Emacs, I get the invalid read syntax: . in wrong context
error. I am really not sure what's going on.
I'm using Emacs 24, not sure that's relevant or not.
As you can probably see I'm a noob at Emacs so I'd really appreciate if anyone could tell me step by step on how to fix this error or point me in the direction where I can find the solution.
Fixed it after messing around with the code. It was my own stupidity really. Don't know much Elisp. Maybe I should learn it if I'm going to want to use Emacs's awesome features more often.
Here's what the code should look like:
(add-to-list 'smart-compile-alist '("\\.java$" . "javac %f && java %n"))
This works on both Windows and OS X.