October 2nd, 2006, 10:43 AM
Emacs Lisp - buffer name as part of compile-command
I'm trying to setup GNU emacs to do some SIMPLE java work for me.
I'm working in a given folder, and want to just edit and compile programs in this one folder.
In my .emacs, I have:
(setq compile-command (concat "javac " (buffer-name)))
I cd to the folder, and run emacs sample.java
I edit the file, and then in emacs, I M-x compile.
The problem, is that in the minibuffer, it shows:
Compile command: javac *scratch*
instead of javac sample.java
Why is this? The buffer *scratch* is (by default) open, but is NOT in the one visible window - sample.java is.
How to I get this to use the correct buffer name for the active buffer?
October 2nd, 2006, 08:34 PM
An answer to this question was posted on LinuxQuestions.org thanks to user "ntubski".
His post was as follows: