From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jose A. Ortega Ruiz" Newsgroups: gmane.emacs.help Subject: Re: Emacs and parent directory Makefile Date: Sun, 11 Jul 2010 01:08:53 +0200 Message-ID: <87wrt3djei.fsf@newton.homeunix.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1278806921 18443 80.91.229.12 (11 Jul 2010 00:08:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Jul 2010 00:08:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 11 02:08:39 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 1OXk62-0001ym-T9 for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Jul 2010 02:08:39 +0200 Original-Received: from localhost ([127.0.0.1]:36964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXk62-0003LQ-74 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Jul 2010 20:08:38 -0400 Original-Received: from [140.186.70.92] (port=46695 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXk5d-0003LL-I7 for help-gnu-emacs@gnu.org; Sat, 10 Jul 2010 20:08:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXk5c-0000hT-7S for help-gnu-emacs@gnu.org; Sat, 10 Jul 2010 20:08:13 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:60277) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXk5c-0000hG-0v for help-gnu-emacs@gnu.org; Sat, 10 Jul 2010 20:08:12 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OXk5Z-0001ts-KV for help-gnu-emacs@gnu.org; Sun, 11 Jul 2010 02:08:09 +0200 Original-Received: from 83.43.34.249 ([83.43.34.249]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jul 2010 02:08:09 +0200 Original-Received: from jao by 83.43.34.249 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Jul 2010 02:08:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.43.34.249 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Attribution: jao X-URL: Cancel-Lock: sha1:Set9a588xwqf26xzHueCZQTMdVc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:74167 Archived-At: On Fri, Jul 09 2010, Stéphane Maniaci wrote: > Hi, > > 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 : I use the elisp code at When one calls jao-compile on a source buffer, it looks upwards the directory tree until it encounters a Makefile, or some other file indicating that the top dir of the source has been found. Then it puts itself in the right directory (where, in my case, 'right' means the corresponding compilation directory, i.e., 'build' because i compile off-tree). Perhaps you could adapt the code above (its 'finding the right directory' logic) to your needs. HTH, jao -- Lisp has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts. —Edsger Dijkstra