zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu
Subject: Re: PATCH: 3.1.4: flushing input properly
Date: Sat, 27 Jun 1998 13:59:51 +0200	[thread overview]
Message-ID: <9806271159.AA15867@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Fri, 26 Jun 1998 09:54:21 DFT." <980626095421.ZM8207@candle.brasslantern.com>

"Bart Schaefer" wrote:
> This looks good.  Just one question ... why does discard_input() clear
> and then set errflag, and why doesn't herrflush() need to do the same?

I was careful to put herrflush() before calls to zerr() etc., and the
history mechanism shouldn't be active with errflag already set.  If
the code as written doesn't work, I'd rather know where and why
errflag was unexpectedly being set beforehand rather than blindly
unsetting it.  (Note it only affects adding the rest of the buffer onto
the history line; the input mechanism will happily return characters
already stored with errflag set, it just won't input a new line.)  As
for setting it after, you will see that every call to herrflush() is
followed immediately by a  call to an error function, whose task it
properly is.

As for why discard_input() did it... first of all, the existing code
didn't always call the error function after rather than before, and
secondly discard_input() was a bit out of place in parse.c rather than
hist.c so its interaction with the history code was a bit murkier.  I
think it was just one those bits that never got tidied up properly
till now.  (The other complexities in discard_input() were what were
dividing up the history line in a strange way, so I think they're well
out of it.)

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


      parent reply	other threads:[~1998-06-27 12:18 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 ` zsh exits suddenly Peter Stephenson
1998-06-24 16:17   ` Bart Schaefer
1998-06-25  8:33     ` Peter Stephenson
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 [this message]

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=9806271159.AA15867@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).