From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: comint-interrupt-subjob also kills pending input Date: 23 Jun 2002 09:12:30 +0900 Sender: emacs-devel-admin@gnu.org Message-ID: <87ofe297kh.fsf@tc-1-100.kawasaki.gol.ne.jp> References: <200206141547.g5EFlZf08916@aztec.santafe.edu> <200206180810.g5I8ALJ14851@aztec.santafe.edu> <200206201434.g5KEYC318619@aztec.santafe.edu> <87adpp7m6l.fsf@tc-1-100.kawasaki.gol.ne.jp> <200206222252.g5MMq2P23123@aztec.santafe.edu> Reply-To: Miles Bader NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024791344 24911 127.0.0.1 (23 Jun 2002 00:15:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 23 Jun 2002 00:15:44 +0000 (UTC) Cc: jidanni@ms46.hinet.net, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Lv2d-0006Tg-00 for ; Sun, 23 Jun 2002 02:15:43 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Lv33-0001yX-00 for ; Sun, 23 Jun 2002 02:16:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Lv2D-0001CL-00; Sat, 22 Jun 2002 20:15:17 -0400 Original-Received: from smtp01.fields.gol.com ([203.216.5.131]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17Lv10-00018O-00; Sat, 22 Jun 2002 20:14:02 -0400 Original-Received: from tc-2-170.kawasaki.gol.ne.jp ([203.216.25.170] helo=tc-1-100.kawasaki.gol.ne.jp) by smtp01.fields.gol.com with esmtp (Magnetic Fields) id 17Lv0x-0007EL-00; Sun, 23 Jun 2002 09:14:00 +0900 Original-Received: by tc-1-100.kawasaki.gol.ne.jp (Postfix, from userid 1000) id 0023D30A4; Sun, 23 Jun 2002 09:12:30 +0900 (JST) Original-To: rms@gnu.org System-Type: i686-pc-linux-gnu In-Reply-To: <200206222252.g5MMq2P23123@aztec.santafe.edu> Original-Lines: 46 X-Abuse-Complaints: abuse@gol.com Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5111 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5111 Richard Stallman writes: > That would make sense, but I'm not sure how possible it is to do a good > job -- the code doesn't ever know when you're seeing a real prompt or > not, just that there's some non-newline-terminated output. > > Comint has ways of recognizing prompts. It has to have them. The underlying process does not communicate which things are really prompts, so it's impossible for comint to actually know for sure. Comint currently has ways of _guessing_ which things are prompts, that often do a `good enough job' for the tasks where they are used. One way is the old `regexp' method, which is not used for most purposes anymore. It really sucks, because it guesses wrong insanely often; the actual textual content of prompt is simply too varied and dynamic to recognize this way. Another way, used currently to highlight prompts, is to consider any non-newline-terminated line at the end of the buffer a prompt, but to update it dynamically so that any wrong guess (e.g. caused by partial output) is quickly corrected. Since one property of real prompts is that the output pauses for input, this means that anything `noticeable' as being highlighted as a prompt usually is one (when the user presses RET, it `snapshots' the current prompt, guessing that the users' input has validated that particular guess). You can see that the latter will guess wrong in several situations, (1) when output is split into several chunks, some of which don't end in a newline, and (2) if the process outputs something that really doesn't end in a newline, and then stops (but isn't actually waiting for input, e.g. `Waiting for connection...' or something). Case (1) is not a problem for prompt highlighting because it's fleeting and not noticable. Case (2) could be a considered ugly, but since it's corrected as soon as the process finally outputs a newline, and while waiting, the actual text of the output usually makes it clear whether it's really a prompt or not, this isn't much of a problem in practice (it's fairly rare for unix processes to do this sort of thing anyway). So, for the `C-c C-c' case, the question is whether any of these wrong guesses could cause problems. I guess that in practice it would normally not be a problem. -Miles -- Freedom's just another word, for nothing left to lose --Janis Joplin