From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: substitute-in-file-name is not distributive Date: Tue, 30 Oct 2012 14:34:46 -0700 Message-ID: <509047F6.2010805@dancol.org> References: <50750955.4020802@dancol.org> <5088B1F4.90302@dancol.org> <508F5319.4090604@dancol.org> <508FEBD8.8090505@dancol.org> <509034B4.7020301@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9AF807913F0052CE71F418D8" X-Trace: ger.gmane.org 1351632908 28723 80.91.229.3 (30 Oct 2012 21:35:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2012 21:35:08 +0000 (UTC) Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 22:35:17 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TTJSo-0007I9-3Y for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2012 22:35:10 +0100 Original-Received: from localhost ([::1]:55349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTJSf-0004fY-K6 for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2012 17:35:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTJSY-0004ei-9w for emacs-devel@gnu.org; Tue, 30 Oct 2012 17:35:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTJSW-0006o5-LD for emacs-devel@gnu.org; Tue, 30 Oct 2012 17:34:54 -0400 Original-Received: from dancol.org ([96.126.100.184]:45049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTJSW-0006nm-Ey for emacs-devel@gnu.org; Tue, 30 Oct 2012 17:34:52 -0400 Original-Received: from c-76-22-66-162.hsd1.wa.comcast.net ([76.22.66.162] helo=[0.0.0.0]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TTJSU-0007G9-Rm; Tue, 30 Oct 2012 14:34:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: X-Enigmail-Version: 1.4.5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.126.100.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154594 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9AF807913F0052CE71F418D8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/30/2012 2:24 PM, Stefan Monnier wrote: >> Relative file names come up during builds. Say I'm editing foo.c and >> the build system outputs "objchk\x86\foo.o" in some message: I want to= >> be able to append this relative path and get back a full Cygwin path. >=20 > What do you append it to? If the mapping is arbitrary, you first need > to convert the Cywin name to Windows, the concat, then convert > back, right? Sure. In practice, concatenating short relative paths works pretty well, = and I'd like to translate /foo/bar/qux\bar/spam.txt to /foo/bar/qux/bar/spam.txt.= That work can be done inside the s-i-f-n handler. >>> So Cygin itself treats "\\bin" and "/bin" as equivalent >> No --- Cygwin treats "\\bin" just as Windows would: it's >> a drive-letter-relative Windows path. "/bin" is a perfectly normal >> POSIX path. >=20 > Now I'm lost. So you're saying that Cygwin accepts backslash delimited= > file names and assumes they're Window file names? IOW Cygwin already > accepts just as happily Windows file names? In this case, I'm wonderin= g > why you need s-i-f-n. Cygwin handles them, but Emacs doesn't. In the above example, as far as E= macs is concerned, I'm editing a monolithic file with backslashes. For example, find-file on "/etc\\passwd" successfully opens the passwd file (because C= ygwin does the translation internally), but the Emacs buffer name is "etc\\pass= wd" and default-directory is "/". > Is it because Cygwin needs backslashes to recognize Windows file names > whereas Emacs wants to turn all backslashes into slashes? I see Emacs treating backslashes as just another filename constituent. > Side related question: this seems to be related to your cygw32, yet at > the same tine it seems to be more GUI-independent. How much of this > affects Cygwin-X11 builds? Why has it not been a problem until now? You're right: the problem isn't GUI-specific. I just came across the prob= lem while doing general improvements to Cygwin Emacs. Maybe I'm the first one= to be really bothered by the problem. I do a lot of mixed Cygwin and Windows development work. >>> If you limit yourself to: >>> - rewrite "\\`[a-zA-Z]:" to "/cygdrive/c" (regardless if it is follow= ed >> Not all Cygwin installations use "cygdrive". >=20 > I kind of know. Sorry for being repetitive. >> Every instance of the word "cygdrive" in Emacs is a bug. >=20 > Feel free to fix them. After feature freeze. >> "/cygdrive/c/bin/ls.exe" and "/bin/ls.exe" refer to the same file, but= >> because the paths differ, Emacs will consider these as two distinct >> files. Also, access semantics differ between drive-prefix-prefixed >> paths and native Cygwin paths. >=20 > That doesn't sound too terrible as a stop-gap until we can fix the > underlying problem. The aliasing issue breaks my workflow. If we can't fix the problem the ri= ght way in 24.3, I'm happy leaving the situation the way it is, hacking around th= e problem locally, and fixing it in 24.4. --------------enig9AF807913F0052CE71F418D8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Cygwin) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCQR/kACgkQ17c2LVA10Vuf/gCfajTQ+4laWsRxSEw2uOkUvZRx JFYAn2mCFaWrdD4UdzWJ7Vrg5Wl3+i8R =ksG8 -----END PGP SIGNATURE----- --------------enig9AF807913F0052CE71F418D8--