emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `file-relative-name' for compressed files


From: Emilio Lopes
Subject: Re: `file-relative-name' for compressed files
Date: Tue, 15 Jun 2004 21:22:15 +0200
User-agent: Emacs Gnus

Richard Stallman writes:

> It sounds like you're saying that my change is correct,
> but there are bugs in Tramp that need fixing as well.
> Is that correct?

No. Your change does *not* work for remote compressed files:

   (file-relative-name "/bar:/a/b/c/foo.gz" "/bar:/a/b/c/")
   => "/ssh:bar:/a/b/c/foo.gz"



Now, the Tramp thing is a *different*, but somewhat related,
matter. Sorry, I should have report this in a separate
mail.

The problem is that the code in file-relative-name expects
the regexp in file-name-handler-alist to match the "host"
part of a filename. This worked for Ange-FTP, but fails for
TRAMP's extended filename syntax.

Here is an example:

   (file-relative-name "/bar:/a/b/c/foo" "/xyz:/a/b/c/")
   => "../../../../ssh:bar:/a/b/c/foo"

A quick fix would be to change TRAMP's regexp in
file-name-handler-alist accordingly.

My opinion is that a new function which returns the remote
part of a filename, as suggested by Michael Albinus in
another mail, would be cleaner.

/ECL




reply via email to

[Prev in Thread] Current Thread [Next in Thread]