From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sumit Narayan Newsgroups: gmane.emacs.help Subject: Re: Default compile directory Date: Tue, 18 Aug 2009 15:59:14 -0400 Message-ID: References: <87my5xlm0e.fsf@kanis.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250860421 22534 80.91.229.12 (21 Aug 2009 13:13:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2009 13:13:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Ivan Kanis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 21 15:13:34 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MeTvw-0000Dg-19 for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Aug 2009 15:13:32 +0200 Original-Received: from localhost ([127.0.0.1]:37453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeTvv-0004bb-CI for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Aug 2009 09:13:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdUq0-0004B8-Pm for help-gnu-emacs@gnu.org; Tue, 18 Aug 2009 15:59:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdUpw-00049Y-CG for help-gnu-emacs@gnu.org; Tue, 18 Aug 2009 15:59:20 -0400 Original-Received: from [199.232.76.173] (port=37509 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdUpv-00049R-Tj for help-gnu-emacs@gnu.org; Tue, 18 Aug 2009 15:59:16 -0400 Original-Received: from mail-ew0-f211.google.com ([209.85.219.211]:50015) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdUpv-0001xJ-HM for help-gnu-emacs@gnu.org; Tue, 18 Aug 2009 15:59:15 -0400 Original-Received: by ewy7 with SMTP id 7so832657ewy.31 for ; Tue, 18 Aug 2009 12:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hQGmKd24QK0tKTOUMRIH/TF9/9pk45CXePV7r7p+hiU=; b=Htd1dLdpJrOm3unCME1iQdidNK+mypWxFjPrefaFoc+U0sQ4LrcpDJWkgWJZOVWx2d sU9/C/t5+g6LLBONd4seq5LaGZ8ThCNr1FQHDf1LhUMZ6bIcFbHVAPWRo4XuE3doYO5P Jzvhtldc8Un5ssxhfD7TIRA7Sj6hHNynA4EVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=HT3b8Lp82lLPIlUYXVxrBWiV66af1N6a+XHlB3WBQy3MMygTsB6KTBqGB4FNllbpOI 5oDnOoTM6t1zXMBsWYgq+ozSBqquElmT1r4LwZKO6W1Vq8Jta8Bdl7ciOHqDwlyNdVFk d04srQJCp38In3EPJ1ZhevbyhQbrqXS6lb1T8= Original-Received: by 10.211.166.13 with SMTP id t13mr3159778ebo.98.1250625554535; Tue, 18 Aug 2009 12:59:14 -0700 (PDT) In-Reply-To: <87my5xlm0e.fsf@kanis.fr> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 21 Aug 2009 09:07:17 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67333 Archived-At: Thanks. This is what I did: Added ((nil . ((setq compile-command "cd ; make")))) in /.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 ; 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 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 >> ; 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 ; 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. > =C2=A0 =C2=A0-- William Shakespeare > > Sumit Narayan wrote: >