From: "stewartbryson@gmail.com" <stewartbryson@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Tramp handling of customized prompts
Date: Tue, 12 Jun 2007 16:19:35 -0000 [thread overview]
Message-ID: <1181665175.226046.171570@g37g2000prf.googlegroups.com> (raw)
In-Reply-To: <mailman.1752.1181250520.32220.help-gnu-emacs@gnu.org>
On Jun 7, 5:08 pm, Michael Albinus <michael.albi...@gmx.de> wrote:
> "stewartbry...@gmail.com" <stewartbry...@gmail.com> writes:
> > Any other advice with this in mind?
>
> Which Tramp version do you use? Tramp 2.0 is fussy indeed for being in
> the right buffer. Tramp 2.1 shall be more docile. I would try the
> following code (untested):
>
> (defvar my-tramp-prompt-regexp
> (concat (regexp-opt '("Please enter a digit:") t) "\\s-*")
> "Regular expression matching my database chooser prompt.")
>
> (defun my-tramp-action (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
> '((my-tramp-prompt-regexp my-tramp-action)))
>
> > Thanks very much.
>
> > Stewart
>
> Best regards, Michael.
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)))
When I tried using tramp, I got the following error:
Wrong type argument: symbolp, (tramp-db-num-prompt-regexp tramp-action-
db-num-prompt)
Thanks Michael.
swb
next prev parent reply other threads:[~2007-06-12 16:19 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 [this message]
2007-06-12 19:55 ` Michael Albinus
[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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1181665175.226046.171570@g37g2000prf.googlegroups.com \
--to=stewartbryson@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).