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: address@hidden
Subject: Re: Tramp handling of customized prompts
Date: Tue, 12 Jun 2007 20:22:46 -0000
User-agent: G2/1.0

On Jun 12, 3:55 pm, Michael Albinus <address@hidden> wrote:
> "address@hidden" <address@hidden> 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 numberpromptat 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))
>

This worked! Thanks very much.

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

I took your suggestion with this as well. Any recommendations on how
to signify that these custom functions are specific for using with
Tramp, or am I looking for overkill here?


> > Thanks Michael.
>
> > swb
>
> Best regards, Michael.- Hide quoted text -
>
> - Show quoted text -

Thanks again Michael.




reply via email to

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