From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: substitute-in-file-name is not distributive Date: Tue, 30 Oct 2012 23:41:30 -0400 Message-ID: References: <50750955.4020802@dancol.org> <5088B1F4.90302@dancol.org> <508F5319.4090604@dancol.org> <508FEBD8.8090505@dancol.org> <509034B4.7020301@dancol.org> <509047F6.2010805@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351654901 28532 80.91.229.3 (31 Oct 2012 03:41:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2012 03:41:41 +0000 (UTC) Cc: Emacs development discussions To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 31 04:41:50 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 1TTPBZ-000618-Mk for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2012 04:41:45 +0100 Original-Received: from localhost ([::1]:52814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTPBR-0008W0-E1 for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2012 23:41:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTPBP-0008Tk-8G for emacs-devel@gnu.org; Tue, 30 Oct 2012 23:41:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTPBO-0007uu-2L for emacs-devel@gnu.org; Tue, 30 Oct 2012 23:41:35 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:47826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTPBN-0007ui-VS for emacs-devel@gnu.org; Tue, 30 Oct 2012 23:41:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+LET/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLDiYSFBgNEAETiBwFugmLHIUoA6MzgViDBYE7 X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="203201055" Original-Received: from 206-248-177-19.dsl.teksavvy.com (HELO pastel.home) ([206.248.177.19]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 30 Oct 2012 23:41:32 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D960759419; Tue, 30 Oct 2012 23:41:30 -0400 (EDT) In-Reply-To: <509047F6.2010805@dancol.org> (Daniel Colascione's message of "Tue, 30 Oct 2012 14:34:46 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:154596 Archived-At: >> 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 for relative names you'd just convert \ to / ? >>>> 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. >> >> 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 wondering >> why you need s-i-f-n. > Cygwin handles them, but Emacs doesn't. Currently, that's true, and while under w32 we just treat \ and / as equivalent, it sounds like this is not an option for Cygwin, right? I mean that Emacs-w32 is happy to treat \ as a separator but it will not itself add a \, so it often silently turns \ into /. We could do the same under Cygwin, but from you say it sounds like it might not do the right thing. Of course, that depends on details: is /usr\bin treated by Cygwin as identical to /usr/bin? What about \bin compared to /bin? >> 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. Right, because the Cygwin build uses the "Unix" code which presumes POSIX-like semantics. > You're right: the problem isn't GUI-specific. I just came across the > problem 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. OK, makes sense. >>>> If you limit yourself to: >>>> - rewrite "\\`[a-zA-Z]:" to "/cygdrive/c" (regardless if it is followed >>> Not all Cygwin installations use "cygdrive". >> I kind of know. > Sorry for being repetitive. That's not what I meant: I meant that I have a vague knowledge that this is the case, but I don't know what it really entails (e.g. can this name be changed, or can it even not exist at all?). Stefan