all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: substitute-in-file-name is not distributive
Date: Tue, 30 Oct 2012 14:34:46 -0700	[thread overview]
Message-ID: <509047F6.2010805@dancol.org> (raw)
In-Reply-To: <jwvip9rk6pz.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]

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.
> 
> 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.
> 
> 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. In the above example, as far as Emacs is
concerned, I'm editing a monolithic file with backslashes. For example,
find-file on "/etc\\passwd" successfully opens the passwd file (because Cygwin
does the translation internally), but the Emacs buffer name is "etc\\passwd" 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 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.

>>> 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.

>> Every instance of the word "cygdrive" in Emacs is a bug.
> 
> 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.
> 
> 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 right way
in 24.3, I'm happy leaving the situation the way it is, hacking around the
problem locally, and fixing it in 24.4.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  reply	other threads:[~2012-10-30 21:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10  5:36 substitute-in-file-name is not distributive Daniel Colascione
2012-10-10  6:39 ` Andreas Schwab
2012-10-10 15:31 ` Eli Zaretskii
2012-10-10 16:48   ` Daniel Colascione
2012-10-10 17:18     ` Eli Zaretskii
2012-10-10 17:40       ` Daniel Colascione
2012-10-11  3:25   ` Stephen Leake
2012-10-25  3:20 ` Stefan Monnier
2012-10-25  3:28   ` Daniel Colascione
2012-10-27 16:08     ` Stefan Monnier
2012-10-28 19:09     ` Stefan Monnier
2012-10-30  4:10       ` Daniel Colascione
2012-10-30 13:15         ` Stefan Monnier
2012-10-30 15:01           ` Daniel Colascione
2012-10-30 18:58             ` Stefan Monnier
2012-10-30 20:12               ` Daniel Colascione
2012-10-30 21:24                 ` Stefan Monnier
2012-10-30 21:34                   ` Daniel Colascione [this message]
2012-10-31  3:41                     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=509047F6.2010805@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.