tramp-devel
[Top][All Lists]
Advanced

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

Re: Getting TRAMP 2.0.25 working in NT Emacs 21.2.1 with Cygwin 1.3.12-1


From: Francis Litterio
Subject: Re: Getting TRAMP 2.0.25 working in NT Emacs 21.2.1 with Cygwin 1.3.12-1
Date: Tue, 08 Oct 2002 08:29:40 -0400
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-msvc-nt5.0.2195)

I wrote:

> 4. Next, I had to make the following change to lisp/tramp.el.
>
>       *** 3024,3030 ****
>               (unless (file-exists-p filename)
>               (error "Cannot make local copy of non-existing file `%s'"
>                      filename))
>       !       (setq tmpfil (tramp-make-temp-file))
>               (cond (rcp-program
>                    ;; Use rcp-like program for file transfer.
>                    (tramp-message-for-buffer
>       --- 3024,3030 ----
>               (unless (file-exists-p filename)
>               (error "Cannot make local copy of non-existing file `%s'"
>                      filename))
>       !       (setq tmpfil (substring (tramp-make-temp-file) 2))
>               (cond (rcp-program
>                    ;; Use rcp-like program for file transfer.
>                    (tramp-message-for-buffer
>
>    This is to cope with the fact that, by default, NT Emacs has
>    temporary-file-directory set to C:/DOCUME~1/username/LOCALS~1/Temp/,
>    which is unacceptable to Cygwin's scp as the second argument, because
>    scp interprets the "c:" as a hostname!  The substring call chops off
>    the "C:", leaving tmpfil set to a value that is acceptable to both
>    Cygwin's scp and NT Emacs (and, more importantly, means the same
>    thing to both of them).

Sorry -- by itself the above change doesn't solve the problem.  The
resulting pathname (/DOCUME~1/username/LOCALW~1/Temp) does not exist for
Cygwin's scp.  In addition to the above change to tramp.el, I had to do
this in my .emacs startup file:

        (setq tramp-temp-name-prefix "/temp/tramp.")

Then I had to make a symlink in my Cygwin root directory as follows:

        $ ln -s c:/temp /temp

Doing this makes "/temp/tramp.xxx" in Emacs refer to the same file as
"/temp/tramp.xxx" on the scp command line in Cygwin.

Yes, this is a hack.  A better solution would be for TRAMP to provide a
variable that maps the Emacs temporary directory to a Cygwin temporary
directory that is used in the second argument to the scp command.  For
instance, the variable's value might be an assoc list of the form:

        (("/tmp" . "/tmp")
         ("c:/temp" . "/cygdrive/c/temp"))

The first entry in the assoc list for which (file-exists-p (car entry))
is t is the entry that provides the mapping.

I can code this and submit a patch -- if the developers think it's the
right way to solve the problem.
--
Francis Litterio
address@hidden
http://world.std.com/~franl/
GPG and PGP public keys available on keyservers.





reply via email to

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