unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
Cc: jidanni@ms46.hinet.net, emacs-devel@gnu.org
Subject: Re: comint-interrupt-subjob also kills pending input
Date: 23 Jun 2002 09:12:30 +0900	[thread overview]
Message-ID: <87ofe297kh.fsf@tc-1-100.kawasaki.gol.ne.jp> (raw)
In-Reply-To: <200206222252.g5MMq2P23123@aztec.santafe.edu>

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2002-06-23  0:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2sn3qnaa2.fsf@jidanni.org>
2002-06-14 15:47 ` comint-interrupt-subjob also kills pending input Richard Stallman
2002-06-17  2:21   ` Miles Bader
2002-06-18  8:10     ` Richard Stallman
2002-06-18 14:55       ` Stefan Monnier
2002-06-19  1:32       ` Miles Bader
2002-06-20 14:34         ` Richard Stallman
2002-06-20 20:02           ` Miles Bader
2002-06-22 22:52             ` Richard Stallman
2002-06-23  0:12               ` Miles Bader [this message]
2002-06-24  9:33                 ` Richard Stallman

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=87ofe297kh.fsf@tc-1-100.kawasaki.gol.ne.jp \
    --to=miles@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jidanni@ms46.hinet.net \
    /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 public inbox

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

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).