From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Q on using shell mode remotely Date: Tue, 01 Aug 2006 17:52:03 -0600 Organization: IHS Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1154476418 18224 80.91.229.2 (1 Aug 2006 23:53:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 1 Aug 2006 23:53:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 02 01:53:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G843L-0008Rh-LN for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Aug 2006 01:53:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G843L-0007sB-3S for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Aug 2006 19:53:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G8437-0007qd-Bw for help-gnu-emacs@gnu.org; Tue, 01 Aug 2006 19:53:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G8436-0007pi-98 for help-gnu-emacs@gnu.org; Tue, 01 Aug 2006 19:53:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8436-0007pa-5O for help-gnu-emacs@gnu.org; Tue, 01 Aug 2006 19:53:20 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G8465-0003AZ-4X for help-gnu-emacs@gnu.org; Tue, 01 Aug 2006 19:56:25 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1G842o-0008Mg-9a for help-gnu-emacs@gnu.org; Wed, 02 Aug 2006 01:53:02 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Aug 2006 01:53:02 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Aug 2006 01:53:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 56 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: 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:36408 Archived-At: Drew Adams wrote: > Kevin Rodgers wrote: > Why can't you just add a time pattern to telnet-prompt-pattern, which is > used to set the buffer-local value of comint-prompt-pattern: > > (eval-after-load "telnet" > '(setq telnet-prompt-pattern > (concat telnet-prompt-pattern > "\\([12]?[0-9]:[0-5][0-9][ap]m\\)?"))) > > Thanks again. I didn't know about `telnet-prompt-pattern'. I used `C-h m' > and searched for "prompt", but the only occurences there are > `comint-next-prompt' and `comint-previous-prompt'. I found nothing in the > manual either. (I should have just used completion or apropos to look for a > "telnet-" prompt variable.) > > I'll use `telnet-prompt-pattern', myself, to hack this problem, Please let us know if it works. Looking at telnet.el: 1. M-x telnet runs telnet-program via make-comint, with telnet-initial-filter as the process filter, then calls telnet-mode. 2. telnet-mode sets the buffer-local value of comint-prompt-regexp to telnet-prompt-pattern. 3. telnet-initial-filter calls invokes telnet-check-software-type-initialize, then resets the process filter to telnet-filter. a. If telnet-check-software-type-initialize sees "unix" in its STRING argument, it resets telnet-prompt-pattern to comint-prompt-regexp; then regardless of STRING, it resets comint-prompt-regexp to telnet-prompt-pattern. So it seems that (3) could prevent (2) from accomplishing its intended effect, if (3) ran before (2). Then, comint.el ignores comint-prompt-regexp anyway unless comint-use-prompt-regexp is non-nil -- but it is nil by default, and telnet doesn't set it. So comint is assigning `field' text properties to distinguish program (csh) output such as prompts from user input. > but it would > be good if there were a variable that dealt with $rprompt somehow. I don't see how it could. The remote csh presumably displays $rprompt on the right side of the screen via terminal escape codes or simple ASCII control characters; but the telnet subprocess is discarding that data, either explicitly via telnet-filter or implicitly via process- connection-type. So you end up with $rprompt displayed immediately adjacent to $prompt in your *telnet-HOST* buffer, and you've got to account for that via telnet-prompt-regexp. -- Kevin