unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ivan Kanis <expire-by-2009-08-23@kanis.fr>
To: Sumit Narayan <sumnaray@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Default compile directory
Date: Tue, 18 Aug 2009 07:38:25 +0200	[thread overview]
Message-ID: <87my5xlm0e.fsf@kanis.fr> (raw)
In-Reply-To: <a18f491d0908171412o1ceb5943nbcd2941b5ef6907f@mail.gmail.com> (Sumit Narayan's message of "Mon, 17 Aug 2009 17:12:49 -0400")


> 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:




  reply	other threads:[~2009-08-18  5:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 21:12 Default compile directory Sumit Narayan
2009-08-18  5:38 ` Ivan Kanis [this message]
2009-08-18 19:59   ` Sumit Narayan
     [not found]   ` <mailman.5018.1250860038.2239.help-gnu-emacs@gnu.org>
2009-08-21 14:32     ` A.Politz
2009-08-21 15:23       ` Sumit Narayan
2009-08-25 15:35         ` Sumit Narayan
2009-08-18  8:15 ` Peter Dyballa
2009-08-18 20:08   ` Sumit Narayan
2009-08-18 21:51 ` Nikolaj Schumacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87my5xlm0e.fsf@kanis.fr \
    --to=expire-by-2009-08-23@kanis.fr \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sumnaray@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).