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: Michael Albinus
Subject: Re: Getting TRAMP 2.0.25 working in NT Emacs 21.2.1 with Cygwin 1.3.12-1
Date: 08 Oct 2002 21:58:25 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Francis Litterio <address@hidden> writes:

> 2. Next, my .emacs file executes this horror:
> 
>       (let ((shell-file-name "c:/apps/cygwin/bin/bash.exe"))
>         (shell-command "echo /tmp/ssh-*/agent.* 2>/dev/null" " *temp*"))
>       (save-excursion
>         (set-buffer " *temp*")
>         (end-of-line)
>         (if (> (buffer-size) 5)
>             (setenv "SSH_AUTH_SOCK" (buffer-substring (point-min) (point)))
>           (ding)
>           (message "my-general.el: WARNING: ssh-agent is not running!")
>           (sit-for 3)))
> 
>    The above mess is to cope with what I think is a fairly common
>    situation -- namely, where the user launches NT Emacs using a
>    shortcut on the desktop but starts ssh-agent from a bash shell also
>    launched from the desktop.  Since Emacs is not a descendant of
>    ssh-agent, it does not inherit the SSH_AUTH_SOCK environment
>    variable (and neither does scp).

The point is that, if you want to use Cygwin environment you should
start Emacs under Cygwin control. The shortcut on your desktop might
point to something like "C:\apps\Cygwin\home\franl\emacs.bat". And
this file could start something like "C:\Cygwin\Cygwin\bin\bash
--login ~/emacs". At least that's the way I do it ...

You cannot expect that Tramp under Windows will be used together with
Cygwin only.

>    Maybe the general solution is to create a tramp-methods key named
>    tramp-pre-rcp-hook, which is run just before tramp-rcp-program
>    executes?

That sounds good to me. The canonical way with Emacs for private
configuration. 

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

Again, if you enter Emacs from a proper Cygwin environment, there
shouldn't be a problem. Setting $TMP in your login scripts might help
I guess.

Best regards, Michael.





reply via email to

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