tags:

views:

48

answers:

1

Hello, how do i maintain a compile command across emacs sessions for a given file?

so, suppose I have file1.x, and I would like to use tool XComp to compile it. To do this, I need to run the following hypothetical command:

Xcomp file1.x && extract file1.x && Xlink file1.obj

So I do M-x compile, and write that thing. Now I have it available until I close emacs. How do I make that compile command persistent across emacs sessions, maybe a

% -*-

line somewhere? Any help appreciated.

+4  A: 

The variable is "compile-command" so you could put this on the first line in your file:

// -*- compile-command: "Xcomp file1.x && extract file1.x && Xlink file1.obj" -*-

You may want to change the "//" for whatever you need to do for comments.

Damyan