all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "stewartbryson\@gmail.com" <stewartbryson@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Tramp handling of customized prompts
Date: Tue, 12 Jun 2007 21:55:40 +0200	[thread overview]
Message-ID: <87ir9teymb.fsf@gmx.de> (raw)
In-Reply-To: <1181665175.226046.171570@g37g2000prf.googlegroups.com> (stewartbryson@gmail.com's message of "Tue, 12 Jun 2007 16:19:35 -0000")

"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	other threads:[~2007-06-12 19:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 13:28 Tramp handling of customized prompts stewartbryson
     [not found] ` <nqwsyi8orz.fsf@alcatel-lucent.de>
2007-06-05 16:08   ` stewartbryson
2007-06-07 21:08     ` Michael Albinus
     [not found]     ` <mailman.1752.1181250520.32220.help-gnu-emacs@gnu.org>
2007-06-12 16:19       ` stewartbryson
2007-06-12 19:55         ` Michael Albinus [this message]
     [not found]         ` <mailman.2049.1181678147.32220.help-gnu-emacs@gnu.org>
2007-06-12 20:22           ` stewartbryson
2007-06-13  4:53             ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ir9teymb.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stewartbryson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.