From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "stewartbryson@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: Tramp handling of customized prompts Date: Tue, 12 Jun 2007 16:19:35 -0000 Organization: http://groups.google.com Message-ID: <1181665175.226046.171570@g37g2000prf.googlegroups.com> References: <1181050091.976357.240580@q75g2000hsh.googlegroups.com> <1181059707.081933.315290@h2g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1181666517 17085 80.91.229.12 (12 Jun 2007 16:41:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2007 16:41:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 12 18:41:45 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hy9RB-0005Rp-Eh for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jun 2007 18:41:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hy9RA-0007Bx-Ut for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jun 2007 12:41:45 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g37g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: 12.44.84.194 Original-X-Trace: posting.google.com 1181665175 31013 127.0.0.1 (12 Jun 2007 16:19:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 12 Jun 2007 16:19:35 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g37g2000prf.googlegroups.com; posting-host=12.44.84.194; posting-account=9_8k5w0AAACEdxlKdc1yk4pE1k7wpL_l Original-Xref: shelby.stanford.edu gnu.emacs.help:149366 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44953 Archived-At: On Jun 7, 5:08 pm, Michael Albinus wrote: > "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