diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-09-20 09:27:46 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-09-20 09:27:46 +0000 |
commit | 8856dc878e51fa8d9710674168ccd95c263e66a3 (patch) | |
tree | 3e60076eec95b6cc9462b16d621f3f55c4a433e6 /Src/Zle/zle_utils.c | |
parent | 9530331b4f04015eb65341c97940f68774ab210b (diff) | |
download | zsh-8856dc878e51fa8d9710674168ccd95c263e66a3.tar.gz zsh-8856dc878e51fa8d9710674168ccd95c263e66a3.tar.xz zsh-8856dc878e51fa8d9710674168ccd95c263e66a3.zip |
28282: new function zlecallhook()
fix arguments to zle-keymap-select
Diffstat (limited to 'Src/Zle/zle_utils.c')
-rw-r--r-- | Src/Zle/zle_utils.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index cc84eb8bb..291bdd3cb 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -1237,3 +1237,35 @@ viundochange(char **args) } else return undo(args); } + +/* + * Call a ZLE hook: a user-defined widget called at a specific point + * within the line editor. + * + * A single argument arg is passed to the function (in addition to the + * function name). It may be NULL. + */ + +/**/ +void +zlecallhook(char *name, char *arg) +{ + Thingy thingy = rthingy_nocreate(name); + int saverrflag, savretflag; + char *args[3]; + + if (!thingy) + return; + + saverrflag = errflag; + savretflag = retflag; + + args[0] = thingy->nam; + args[1] = arg; + args[2] = NULL; + execzlefunc(thingy, args, 1); + unrefthingy(thingy); + + errflag = saverrflag; + retflag = savretflag; +} |