From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13359 invoked from network); 19 Sep 2004 19:12:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Sep 2004 19:12:18 -0000 Received: (qmail 81857 invoked from network); 19 Sep 2004 19:12:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Sep 2004 19:12:12 -0000 Received: (qmail 13637 invoked by alias); 19 Sep 2004 19:11:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20388 Received: (qmail 13612 invoked from network); 19 Sep 2004 19:11:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Sep 2004 19:11:43 -0000 Received: (qmail 80943 invoked from network); 19 Sep 2004 19:11:43 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 19 Sep 2004 19:11:41 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i8JJBesX020062 for ; Sun, 19 Sep 2004 12:11:40 -0700 Date: Sun, 19 Sep 2004 12:11:40 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: zsh-workers@sunsite.dk Subject: Re: PATCH: exit after 10 EOF's In-Reply-To: <20040919175211.3557D863A@pwstephenson.fsnet.co.uk> Message-ID: References: <200409131118.i8DBIM5B005245@news01.csr.com> <20040919175211.3557D863A@pwstephenson.fsnet.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sun, 19 Sep 2004, Peter Stephenson wrote: > If we could somehow make it (without too much tortuous code) that any > zle -N widget, no matter what it contains, suppresses the warning and > the EOF behaviour, I would be fairly happy. Here's the hunk for that. Line numbers are off because I haven't committed 20387 yet, so this is not directly applicable via "patch". @@ -887,10 +897,17 @@ } else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_NCOMP)) { int wflags = w->flags; - if (keybuf[0] == eofchar && !keybuf[1] && + /* + * The rule is that "zle -N" widgets suppress EOF warnings. When + * a "zle -N" widget invokes "zle another-widget" we pass through + * this code again, but with actual arguments rather than with the + * zlenoargs placeholder. + */ + if (keybuf[0] == eofchar && !keybuf[1] && args == zlenoargs && !ll && isfirstln && (zlereadflags & ZLRF_IGNOREEOF)) { showmsg((!islogin) ? "zsh: use 'exit' to exit." : "zsh: use 'logout' to logout.");