From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24446 invoked from network); 16 Jan 2009 23:54:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Jan 2009 23:54:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 25759 invoked from network); 16 Jan 2009 23:54:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Jan 2009 23:54:14 -0000 Received: (qmail 14644 invoked by alias); 16 Jan 2009 23:54:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26329 Received: (qmail 14625 invoked from network); 16 Jan 2009 23:54:09 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Jan 2009 23:54:09 -0000 Received: from QMTA02.westchester.pa.mail.comcast.net (qmta02.westchester.pa.mail.comcast.net [76.96.62.24]) by bifrost.dotsrc.org (Postfix) with ESMTP id E280780271F0 for ; Sat, 17 Jan 2009 00:54:05 +0100 (CET) Received: from OMTA05.westchester.pa.mail.comcast.net ([76.96.62.43]) by QMTA02.westchester.pa.mail.comcast.net with comcast id 4Av41b0090vyq2s52Pu5ty; Fri, 16 Jan 2009 23:54:05 +0000 Received: from smtp.klanderman.net ([98.217.254.247]) by OMTA05.westchester.pa.mail.comcast.net with comcast id 4Ptl1b0015M2Np63RPtlub; Fri, 16 Jan 2009 23:53:45 +0000 Received: from lwm.klanderman.net (unknown [192.168.100.50]) by smtp.klanderman.net (Postfix) with ESMTP id E4693B30144 for ; Fri, 16 Jan 2009 18:54:03 -0500 (EST) Received: by lwm.klanderman.net (Postfix, from userid 500) id C7C209FC5E5; Fri, 16 Jan 2009 18:54:03 -0500 (EST) From: Greg Klanderman To: zsh-workers@sunsite.dk Subject: PATCH: add zle-line-finish special widget Reply-To: gak@klanderman.net Date: Fri, 16 Jan 2009 18:54:03 -0500 In-Reply-To: (Greg Klanderman's message of "Sun, 11 Jan 2009 23:00:10 -0500") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (linux) References: <18789.30656.261463.382208@gargle.gargle.HOWL> <20090110095231.GA61601@redoubt.spodhuis.org> <20090111025418.GA7272@redoubt.spodhuis.org> <090111110748.ZM12349@torch.brasslantern.com> <090111193317.ZM12655@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.92.1/8872/Fri Jan 16 17:55:46 2009 on bifrost X-Virus-Status: Clean Hi, I'm re-submitting my previous patch having addressed some of Bart's concerns. In particular, I have renamed the special widget to "zle-line-finish" (was zle-line-finished) and have added code to save/restore errflag and retflag so that the values from the end of zlecore() are preserved. Bart also made the following comments on my original patch which I have not addressed: > it's possible that the zle-line-finish widget should not run when > errflag != 0. > I don't know all the ramifications of the values of various globals > at the end of zlecore(). PWS? Peter, could you comment? cheers, Greg Index: Doc/Zsh/zle.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v retrieving revision 1.75 diff -u -r1.75 zle.yo --- Doc/Zsh/zle.yo 9 Dec 2008 17:37:01 -0000 1.75 +++ Doc/Zsh/zle.yo 16 Jan 2009 23:36:37 -0000 @@ -870,6 +870,11 @@ (The command inside the function sets the keymap directly; it is equivalent to tt(zle vi-cmd-mode).) ) +tindex(zle-line-finish) +item(tt(zle-line-finish))( +This is similar to tt(zle-line-init) but is executed every time the +line editor has finished reading a line of input. +) tindex(zle-keymap-select) item(tt(zle-keymap-select))( Executed every time the keymap changes, i.e. the special parameter Index: Src/Zle/zle_main.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v retrieving revision 1.121 diff -u -r1.121 zle_main.c --- Src/Zle/zle_main.c 9 Dec 2008 17:37:01 -0000 1.121 +++ Src/Zle/zle_main.c 16 Jan 2009 23:36:37 -0000 @@ -1212,6 +1212,18 @@ zlecore(); + if ((initthingy = rthingy_nocreate("zle-line-finish"))) { + int saverrflag = errflag; + int savretflag = retflag; + char *args[2]; + args[0] = initthingy->nam; + args[1] = NULL; + execzlefunc(initthingy, args, 1); + unrefthingy(initthingy); + errflag = saverrflag; + retflag = savretflag; + } + statusline = NULL; invalidatelist(); trashzle();