[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default compile directory
From: |
Sumit Narayan |
Subject: |
Re: Default compile directory |
Date: |
Tue, 18 Aug 2009 15:59:14 -0400 |
Thanks.
This is what I did:
Added
((nil . ((setq compile-command "cd <project root directory>; make"))))
in <project root directory>/.dir-locals.el.
When I open any file inside this folder, I am asked for permission to
apply the local variables
setq : (compile-command "cd <project root directory>; make")
For some reason, my response as 'y' or '!' does not make a difference.
When I give M-x compile, I still end up with "make -k".
Any idea why?
Thanks,
Sumit.
On Tue, Aug 18, 2009 at 1:38 AM, Ivan
Kanis<expire-by-2009-08-23@kanis.fr> wrote:
>
>> Is there any way to set default compile directory?
>>
>> The problem: I have a many sub-folders in my project and when I edit a
>> file deep inside subfolders and do M-x compile, I end up running make
>> in that subfolder, instead of the root folder. Is there any way for
>> Emacs to always run compile in the default folder?
>>
>> One thing I figured was to change default compile command to be: cd
>> <project's root folder>; make. Is that the only/best way?
>
> Hi Sumit,
>
> You can use .dir-locals.el in your root folder and put something like:
>
> (setq compile-command "cd <root folder>; make")
>
> It will be evaluated every time you open a file in the folder. I think
> it's a new feature of emacs 23.
>
> Kind regards,
> --
> Ivan
> Kanis http://kanis.fr
>
> We know what we are, but know not what we may be.
> -- William Shakespeare
>
> Sumit Narayan <sumnaray@gmail.com> wrote:
>
Re: Default compile directory, Nikolaj Schumacher, 2009/08/18