From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gareth Rees Newsgroups: gmane.emacs.bugs Subject: next-error fails to find file on Cygwin with recursive make Date: Fri, 25 Apr 2008 13:52:10 +0100 Message-ID: <4811D3FA.9000802@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209129511 11776 80.91.229.12 (25 Apr 2008 13:18:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Apr 2008 13:18:31 +0000 (UTC) Cc: Gareth Rees To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 25 15:19:07 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-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 1JpNpS-0006j1-Cx for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Apr 2008 15:19:06 +0200 Original-Received: from localhost ([127.0.0.1]:47874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpNol-0002O5-SA for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Apr 2008 09:18:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpNog-0002M1-Nu for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:18:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpNob-0002DX-51 for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:18:17 -0400 Original-Received: from [199.232.76.173] (port=35753 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpNoa-0002DM-Tw for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:18:12 -0400 Original-Received: from [193.164.110.10] (helo=kiki.zoonami.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JpNoa-0001N6-Dj for bug-gnu-emacs@gnu.org; Fri, 25 Apr 2008 09:18:12 -0400 Original-Received: from [192.168.15.252] ([192.168.15.252]) by kiki.zoonami.com (8.13.8/8.13.8) with ESMTP id m3PCnI8O022318; Fri, 25 Apr 2008 13:49:18 +0100 (BST) (envelope-from gareth.rees@pobox.com) User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-Greylist: delayed 1445 seconds by postgrey-1.27 at monty-python; Fri, 25 Apr 2008 09:17:57 EDT X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17877 Archived-At: I am using GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include' I have `shell-file-name' set to "bash" and I type M-x compile RET make RET. Cygwin's "make" produces the following output in the *compilation* buffer: ---------------------------------------------------------------------------- -*- mode: compilation; default-directory: "c:/tmp/test/" -*- Compilation started at Fri Apr 25 13:13:20 make make -f src/Makefile make[1]: Entering directory `/cygdrive/c/tmp/test' gcc -Wall -g -o build/test.o -c src/test.c src/test.c:1:2: #error Error make[1]: *** [build/test.o] Error 1 make[1]: Leaving directory `/cygdrive/c/tmp/test' make: *** [all] Error 2 Compilation exited abnormally with code 2 at Fri Apr 25 13:13:21 ---------------------------------------------------------------------------- Now I type M-x next-error RET. I expect Emacs to go to the location of the first error, but instead it asks me thiis question: Find this error in (default src/test.c): c:/cygdrive/c/tmp/test The reason it can't find the file is that `compilation-directory-matcher' has matched the recursive make's "Entering directory" line, which contains an absolute path name in Cygwin syntax; and then `compilation-find-file' has called `expand-file-name', which has converted `/cygdrive/c/tmp/test' into the incorrect `c:/cygdrive/c/tmp/test' instead of the correct `c:/tmp/test'. I am aware that I can work around this problem by advising `expand-file-name' to recognize Cygwin path names and convert them to path names that Emacs recognizes, for example like this: (defadvice expand-file-name (before cygpath-convert-to-emacs-path activate) (let ((name (ad-get-arg 0))) (when (string-match "^/cygdrive/\\([a-z]\\)\\(/.*\\)" name) (ad-set-arg 0 (concat (match-string 1 name) ":" (match-string 2 name)))))) However, it would be nice if recursive make in Cygwin worked in Emacs out of the box. -- Gareth Rees