Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: add zle-line-finish special widget
- X-seq: zsh-workers 26329
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: add zle-line-finish special widget
- Date: Fri, 16 Jan 2009 18:54:03 -0500
- In-reply-to: <m3k5916unp.fsf@xxxxxxxxxxxxxx> (Greg Klanderman's message of "Sun, 11 Jan 2009 23:00:10 -0500")
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <18789.30656.261463.382208@xxxxxxxxxxxxxxxxxx> <20090110095231.GA61601@xxxxxxxxxxxxxxxxxxxx> <m33afq97gg.fsf@xxxxxxxxxxxxxx> <20090111025418.GA7272@xxxxxxxxxxxxxxxxxxxx> <m3tz857mkm.fsf@xxxxxxxxxxxxxx> <090111110748.ZM12349@xxxxxxxxxxxxxxxxxxxxxx> <m3r63975pd.fsf@xxxxxxxxxxxxxx> <m3ocyd70aj.fsf@xxxxxxxxxxxxxx> <090111193317.ZM12655@xxxxxxxxxxxxxxxxxxxxxx> <m3k5916unp.fsf@xxxxxxxxxxxxxx>
- Reply-to: gak@xxxxxxxxxxxxxx
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();
Messages sorted by:
Reverse Date,
Date,
Thread,
Author