help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Tramp handling of customized prompts


From: Michael Albinus
Subject: Re: Tramp handling of customized prompts
Date: Tue, 12 Jun 2007 21:55:40 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

"stewartbryson@gmail.com" <stewartbryson@gmail.com> writes:

> I upgraded to tramp 2.1.9, and invoked the following code:
>
> (require 'tramp)
>
> (defvar tramp-db-num-prompt-regexp (concat (regexp-opt '("Please enter
> your choice:") t) "\\s-*")
>   "Custom regexp for interacting with the database number prompt at DS
> Waters.")
>
> (defun tramp-action-db-num-prompt (proc vec)
>   "Enter \"0\" in order to choose a correct database."
>   (save-window-excursion
>     (with-current-buffer (tramp-get-connection-buffer vec)
>       (tramp-message vec 6 "\n%s" (buffer-string))
>       (tramp-send-string vec "0"))))
>
> (add-to-list 'tramp-actions-before-shell
>            '((tramp-db-num-prompt-regexp tramp-action-db-num-prompt)))

Cut'n'waste error in my example. You would need

(add-to-list 'tramp-actions-before-shell
             '(tramp-db-num-prompt-regexp tramp-action-db-num-prompt))

Also, you might consider to use own symbol names _not_ starting with
"tramp-". It is common practice to apply such prefixes only to all
symbols of a package. This is useful for later debugging.

> Thanks Michael.
>
> swb

Best regards, Michael.





reply via email to

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