From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: Does add-zle-hook-widget violate the contract of ZLE hook widgets?
Date: Thu, 24 Jun 2021 00:09:31 +0000 [thread overview]
Message-ID: <6fb18ce2-d4f0-4bf4-a450-25255178683c@www.fastmail.com> (raw)
In-Reply-To: <574e66f5-0e51-4326-9cea-7335eae49741@www.fastmail.com>
Lawrence Velázquez wrote on Wed, 23 Jun 2021 23:33 +00:00:
> On Wed, Jun 23, 2021, at 5:57 PM, Daniel Shahaf wrote:
> > Marlon Richert wrote on Wed, 23 Jun 2021 20:30 +00:00:
> > > foo implements a perfectly fine zle-line-init widget. It obeys the
> > > contract laid out at
> > > https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Special-Widgets,
> > > which says nothing about return values.
> >
> > That has two possible interpretations:
> >
> > - Hook functions may set $? however they want
> >
> > - Hook functions should set $? to zero on success and to non-zero
> > otherwise
> >
> > In favour of the first interpretation is that the manual's language
> > doesn't explicitly rule it out
>
> It's worth noting that the "Hook Functions" section, while not
> saying anything about ZLE hook functions in particular, does say:
>
> A function found by this mechanism is referred to elsewhere
> as a 'hook function'. An error in any function causes
> subsequent functions not to be run.
>
By code inspection, the last sentence applies to add-zle-hook-widget and
«add-zsh-hook zsh_directory_name», but not to other «add-zsh-hook foo».
> https://zsh.sourceforge.io/Doc/Release/Functions.html#Hook-Functions
next prev parent reply other threads:[~2021-06-24 0:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 20:30 Marlon Richert
2021-06-23 21:57 ` Daniel Shahaf
2021-06-23 23:33 ` Lawrence Velázquez
2021-06-24 0:09 ` Daniel Shahaf [this message]
2021-06-24 10:34 ` Marlon Richert
2021-06-24 10:45 ` Roman Perepelitsa
2021-06-24 18:54 ` Daniel Shahaf
2021-06-24 19:51 ` Roman Perepelitsa
2021-06-24 18:30 ` Daniel Shahaf
2021-06-24 21:48 ` Marlon Richert
2021-06-24 22:29 ` Lawrence Velázquez
2021-06-26 10:12 ` Marlon Richert
2021-06-26 14:51 ` Bart Schaefer
2021-06-24 23:52 ` Daniel Shahaf
2021-06-26 10:49 ` Marlon Richert
2021-06-25 17:34 ` Bart Schaefer
2021-06-27 8:19 Marlon Richert
2021-06-29 2:06 ` Bart Schaefer
2021-06-29 14:50 ` Marlon Richert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6fb18ce2-d4f0-4bf4-a450-25255178683c@www.fastmail.com \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).