From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastian Beischer Newsgroups: gmane.emacs.help Subject: Re: Emacs and parent directory Makefile Date: Sat, 10 Jul 2010 12:58:17 +0200 Message-ID: References: <83wrt3akbl.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001485f1d770985752048b0665d9 X-Trace: dough.gmane.org 1278759538 18796 80.91.229.12 (10 Jul 2010 10:58:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Jul 2010 10:58:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 10 12:58:57 2010 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.69) (envelope-from ) id 1OXXlk-0008Rn-TD for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Jul 2010 12:58:53 +0200 Original-Received: from localhost ([127.0.0.1]:36152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXXlj-00023J-Ox for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Jul 2010 06:58:51 -0400 Original-Received: from [140.186.70.92] (port=46177 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXXlF-00021I-38 for help-gnu-emacs@gnu.org; Sat, 10 Jul 2010 06:58:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXXlD-0000KY-Nv for help-gnu-emacs@gnu.org; Sat, 10 Jul 2010 06:58:20 -0400 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:53026) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXXlD-0000KQ-EJ; Sat, 10 Jul 2010 06:58:19 -0400 Original-Received: by fxm20 with SMTP id 20so1743623fxm.0 for ; Sat, 10 Jul 2010 03:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=bOLo0Kk4BEi5QgdgfAMlkLl9+F62ohQrHZuelEk1Rzw=; b=MM/g1h+DvsfRdtrrQLM2q5iEwC4WX0V+EggAcCxFEsXwV+X/lGesE2/iR6Lix0oYEV hUYdJThgbvXxOnvPKWrn40BcIasin7td79by28TrDxdLJ5lWL5y4+L7gkhB/exIJMUvK Z1mrkITMlU+UPrgYmwTzNiXLS7DQy1eHFE60U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=OuNKqrNpIl/HJxjeHjO2qyxyeAksnm+b3PD0fuhNJXGn/t2Liklw3WzfUfRW+Sn1AY +hUQmpvXWMbUCSPhzxkVLSpGq1iPBCP2kBGkhFIBitOUfVFdIB6yZM8o+1Kyl6jbyOLn Ugf+UeTZgDEHS4S6DRyckRf4mP/zaMR3vlX60= Original-Received: by 10.239.166.137 with SMTP id b9mr977668hbe.199.1278759497389; Sat, 10 Jul 2010 03:58:17 -0700 (PDT) Original-Received: by 10.239.163.19 with HTTP; Sat, 10 Jul 2010 03:58:17 -0700 (PDT) In-Reply-To: <83wrt3akbl.fsf@gnu.org> X-Google-Sender-Auth: jNbuqVRS-_8DG_7aYKQPPdY6N2U X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:74165 Archived-At: --001485f1d770985752048b0665d9 Content-Type: text/plain; charset=ISO-8859-1 I have this in my .emacs: (defun my-compile () "This command is meant to step out of the include/src directories on compilation. Useful for compiling projects without cd-ing to the correct Makefile path." (interactive) (let ((last-directory default-directory)) (if (string-match "\\(\/src\/\\|\/include\/\\)$" default-directory) (cd (replace-regexp-in-string "\\(\/src\/\\|\/include\/\\)$" "/" default-directory))) (call-interactively 'compile) (cd last-directory))) (define-key c++-mode-map (kbd "") 'my-compile) Far from perfect, but it's a start and works very well for me. Cheers Bastian On Sat, Jul 10, 2010 at 9:05 AM, Eli Zaretskii wrote: > > Date: Fri, 9 Jul 2010 11:51:19 -0500 > > From: =?ISO-8859-1?Q?St=E9phane_Maniaci?= > > > > My project uses non-recursive Makefile, thus there is only (at the > moment) a > > single Makefile in my project root tree, that compiles (with Autotools) > all > > my sources files, located in the src/ directory. > > > > Now the problem is : when I'm editing my code and tries to compile it > (M-x > > compile), I have to use 'make -k -C ../', which works fine, but Emacs > > doesn't know anymore which files contains error. When trying to move to > last > > error, it outputs this : > > > > Find this error in (default src/ease-about-dialog.vala): > ~/build/ease/src/ > > > > Does anyone have a workaround for this ? > > Switch to the buffer that visits your top-level Makefile, before > typing "M-x compile". > > -- Bastian Beischer I. Physikalisches Institut B (RWTH Aachen) Sommerfeldstr. 14 52074 Aachen GERMANY Office: 28-C-203 Phone: +49 241 - 8027205 --001485f1d770985752048b0665d9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have this in my .emacs:

(defun my-compile ()
=A0=A0"This command is meant to step out of the include/src dire= ctories on compilation. Useful for compiling projects without cd-ing to the= correct Makefile path."
=A0=A0(interactive)
=A0=A0(let ((last-directory default-dire= ctory))
=A0=A0 =A0(if (string-match "\\(\/src\/\\|\/include\= /\\)$" default-directory)
=A0=A0 =A0 =A0 =A0(cd (replace-reg= exp-in-string "\\(\/src\/\\|\/include\/\\)$" "/" defaul= t-directory)))
=A0=A0 =A0(call-interactively 'compile)
=A0=A0 =A0(cd la= st-directory)))

(define-key c++-mode-map (kbd &quo= t;<f9>") 'my-compile)

Far from perf= ect, but it's a start and works very well for me.

Cheers
Bastian


On Sat, Jul 10, 2010 at 9:05 AM, Eli Zaretskii <eliz@gnu.org> = wrote:
> Date: Fri, 9 Jul 2010 11:51:19 -0500 > From: =3D?ISO-8859-1?Q?St=3DE9phane_Maniaci?=3D <stephane.maniaci@gmail.com>
>
> My project uses non-recursive Makefile, thus there is only (at the mom= ent) a
> single Makefile in my project root tree, that compiles (with Autotools= ) all
> my sources files, located in the src/ directory.
>
> Now the problem is : when I'm editing my code and tries to compile= it (M-x
> compile), I have to use 'make -k -C ../', which works fine, bu= t Emacs
> doesn't know anymore which files contains error. When trying to mo= ve to last
> error, it outputs this :
>
> Find this error in (default src/ease-about-dialog.vala): ~/build/ease/= src/
>
> Does anyone have a workaround for this ?

Switch to the buffer that visits your top-level Makefile, befor= e
typing "M-x compile".




--
Bastian Beischer
I. Physikalisches Institut B (RWTH Aachen)
Sommerfeldstr. 14
52074 = Aachen
GERMANY

Office: 28-C-203
Phone: +49 241 - 8027205

--001485f1d770985752048b0665d9--