On 12 September 2014 10:37, MM <[email protected]> wrote:
> On 12 September 2014 10:06, Michael Albinus <[email protected]> wrote:
>> MM <[email protected]> writes:
>>
>>> A copy paste from the .emacs buffer, in case a missing char somewhere:
>>> (this email is in Plain text mode)
>>>
>>> (require 'tramp)
>>> (require 'tramp-sh)
>>> (defconst my-tramp-prompt-regexp
>>> (concat (regexp-quote "Host:") "\\s-*")
>>> "Regular expression matching my login prompt question.")
>>>
>>> (defun my-tramp-action (proc vec)
>>> "Enter the host name in order to give a correct answer."
>>> (save-window-excursion
>>> (with-current-buffer (tramp-get-connection-buffer vec)
>>> (tramp-message vec 6 "\n%s" (buffer-string))
>>> (tramp-send-string vec "hostname"))))
>>>
>>> (eval-after-load "tramp-sh"
>>> (add-to-list 'tramp-actions-before-shell
>>> '(my-tramp-prompt-regexp my-tramp-action)))
>>
>> Try this one:
>>
>> (eval-after-load "tramp-sh"
>> '(add-to-list 'tramp-actions-before-shell
>> '(my-tramp-prompt-regexp my-tramp-action)))
>
> Yes that fixes it.
> I have just tried:
> "C-x C-f /plink:user1@gateway|user2@host:/path/to/file"
>
> It asks me for password for "host", not for "gateway", which I type,
> then Enter, then it shows:
> "Opening FTP connection to host...." and launches a windows ftp.exe
> subprocess -i -n -g -v
I forgot to say, it just hangs then
>
> Note the following is commented out at the moment:
>
> ;;(add-to-list 'tramp-methods
> ;; '("myplink"
> ;; (tramp-login-program "plink")
> ;; (tramp-login-args (("-l" "%u") ("-pw" "mypasswd")
> ("-ssh") ("%h")))
> ;; (tramp-remote-shell "/bin/bash")
> ;; (tramp-remote-shell-args ("-c"))
> ;; ))
>
> ;;(setq tramp-default-method "myplink")
> ;; (setq tramp-password-end-of-line "\r\n")
> ;;(add-to-list 'tramp-default-proxies-alist
> ;; '("host" nil "/myplink:user@gateway:"))
>
> because I don't know how to combine it with the bits of:
> eval-after-load "tramp-sh"
>
> MM
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel