zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: zsh exits suddenly.
Date: Thu, 25 Jun 1998 10:33:12 +0200	[thread overview]
Message-ID: <9806250833.AA27200@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Wed, 24 Jun 1998 09:17:12 DFT." <980624091713.ZM4823@candle.brasslantern.com>

"Bart Schaefer" wrote:
> On Jun 24, 10:51am, Peter Stephenson wrote:
> } Subject: Re: zsh exits suddenly.
> }
> } I can't be absolutely sure if all that lastc stuff is really needed.
> } It means, of course, that if there is more than one line in the
> } buffer, only the current one is flushed.  Is this the right behaviour?
> 
> This isn't changed by your patch, right?  It was the behavior all along?

Yes, this was exactly all it did before during an interactive read:
discard everything up to the next newline.

> The guideline should probably be, what does ZLE
> do to a multiline buffer when send-break is executed?  The SIGINT handler
> ought to do the same thing.  (In fact, why doesn't it call sendbreak()
> when ZLE is active?)

Actually, at the zle stage there shouldn't be any line input to flush
yet, so this doesn't really matter (i.e., after my last fix
inerrflush() always becomes a no-op here, regardless of the lastc
behaviour), but for what it's worth the complete multi-line buffer is
discarded in both cases.

The proper use of inerrflush() is when lexing the line just input.
I've found the difference: it's in a case like this:

% print !!:s/foo/bar/<ESC><RET>
print haha

The current code gives an error message for the substitution (assuming
of course there was no `foo' in the previous line), but prints `haha'
anyway.  Without the lastc stuff, the `print haha' is discarded along
with the rest of the previous line.

Oddly, the code for "event not found" and for "Ambiguous history
reference" performs the effect of inerrflush() itself, i.e. reading up
to a newline: this may well be just an oversight from before
inerrflush() was written.

So the question boils down to:  after a history subsitution failure,
should the rest of the input be discarded, or just the rest of the
line as at present?  (Note parsing failures don't flush the input in
any case, i.e.:

% if [[<ESC><RET>
then echo<ESC><RET>
fi<ESC><RET>
print haha

will always print `haha' after some error messages.  It also has an
extremely funny effect on the history lines stored.)

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


  reply	other threads:[~1998-06-25  8:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <980623112518.ZM375@candle.brasslantern.com>
1998-06-24  8:51 ` Peter Stephenson
1998-06-24 16:17   ` Bart Schaefer
1998-06-25  8:33     ` Peter Stephenson [this message]
1998-06-25 16:57       ` Bart Schaefer
1998-06-26 10:17         ` PATCH: 3.1.4: flushing input properly Peter Stephenson
1998-06-26 16:54           ` Bart Schaefer
1998-06-26 18:17             ` Zefram
1998-06-27 11:59             ` Peter Stephenson

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9806250833.AA27200@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@math.gatech.edu \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).