On 10 September 2014 15:10, MM <[email protected]> wrote: > On 16 July 2014 08:30, Michael Albinus <[email protected]> wrote: > >> MM <[email protected]> writes: >> >> > The update here is that I've found a sort of gateway machine to which >> > I can ssh, but this box runs some sort of forwarder where it >> > 1. prints the string "Host:" >> > 2. waits for user input for the hostname to forward to >> > 3. connects and runs a login shell on the entered hostname >> > >> > Is there a way to make Tramp work with this? >> >> Yes. See the Tramp manual for this >> >> (info "(tramp) Remote shell setup") >> >> You could adapt the example like this: >> >> --8<---------------cut here---------------start------------->8--- >> (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")))) ;; Use the real host name >> ;; instead of "hostname". >> >> (eval-after-load "tramp-sh" >> (add-to-list 'tramp-actions-before-shell >> '(my-tramp-prompt-regexp my-tramp-action))) >> --8<---------------cut here---------------end--------------->8--- >> >> I get this error: > Symbol's value as variable is void: tramp-actions-before-shell > > Reminder: I have emacs 24.3.1 (i386-mingw) 2013-03-17, with tramp builin > (so whatever version is that). >
I now have both (require 'tramp) (require 'tramp-sh) The previous error is gone, but now the errror is: Invalid function: (my-tramp-prompt-regexp my-tramp-action) MM
_______________________________________________ Tramp-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/tramp-devel
