Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: add-zle-hook-widget and multiple hooks
- X-seq: zsh-workers 46136
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: add-zle-hook-widget and multiple hooks
- Date: Sat, 27 Jun 2020 02:54:08 +0000
- In-reply-to: <20200618114219.7973f8c7@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20200606084054.GA31628@tarpaulin.shahaf.local2> <CAHYJk3Rtfj=cfhRpnBhzBUjbF2_9R5W9vG4a68qT84pH9xVRGA@mail.gmail.com> <20200608061425.034f9d90@tarpaulin.shahaf.local2> <CAHYJk3Q+hiUAGdhwkP9GcZTYXJzEe0kjX3axZQ4to4-fY7oRxA@mail.gmail.com> <20200610133452.025cfc54@tarpaulin.shahaf.local2> <20200618114219.7973f8c7@tarpaulin.shahaf.local2>
- Sender: zsh-workers@xxxxxxx
Daniel Shahaf wrote on Thu, 18 Jun 2020 11:42 +0000:
> Daniel Shahaf wrote on Wed, 10 Jun 2020 13:34 +0000:
> > Over here the jury's still out.
>
> In the absence of further feedback I've gone ahead completed the C patch
> using the originally posted syntax. Any comments, reservations, etc.,
> speak up.
I missed some boilerplate in the argument parsing in C; interdiff:
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index 63bd45c8d..cd3f2c356 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -737,12 +737,14 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
switch (**args) {
case 'f':
flag = args[0][1] ? args[0]+1 : args[1];
- if (strcmp(flag, "nolast")) {
+ if (flag == NULL || strcmp(flag, "nolast")) {
zwarnnam(name, "%s", "'nolast' expected after -f");
if (remetafy)
metafy_line();
return 1;
}
+ if (!args[0][1])
+ *++args = skip_this_arg;
/* If you add magic strings here, be consistent with bin_zle_flags() */
setlbindk = 1;
break;
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author