zsh-workers
 help / color / mirror / code / Atom feed
From: Marlon Richert <marlon.richert@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Does add-zle-hook-widget violate the contract of ZLE hook widgets?
Date: Sat, 26 Jun 2021 13:49:15 +0300	[thread overview]
Message-ID: <CAHLkEDtv8LP5UqOHvB_8YumcjPhNhVw4mUGB5LyMWxHFDVv5CA@mail.gmail.com> (raw)
In-Reply-To: <20210624235216.GA25615@tarpaulin.shahaf.local2>

On Fri, Jun 25, 2021 at 2:52 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> I think it's misleading to look at the "caller and callee" system.  They
> aren't coupled.  The caller is written to work with any callee that
> follows the standard return value semantics, and the callee is written
> to work with any caller that expects the standard return value
> semantics.
>
> Some callers have a list of callees; some don't.  Some callers who have
> a list of callees will call them all; some will call them until the
> first success; some will call them until the first failure.  The callee
> neither knows nor cares.  The callee simply takes care to return
> non-zero whenever it fails, and zero whenever it succeeds.  That's
> implied.
>
> What isn't implied is which semantics the caller follows.  The caller
> (e.g., add-zsh-hook, add-zle-hook-widget) should document that.
>
> My point was that drivers signal even when there's no one else on the
> road.  The analogy to that is that functions should return zero for
> success and non-zero otherwise even when they don't know what their
> caller would do with that.

It seems I misunderstood your point/metaphor. Yes, I agree with all of
the above.


> Perhaps.  The manual and NEWS/README have different purposes.

I'm reasonably sure that NEWS/README has much lower visibility than
the manual. If we actually want 3rd-party script devs to implement
things correctly, then it needs to be in the manual.


Here's a new version of the patch. I added a note about return values
under ZLE > Hook Widgets.


  reply	other threads:[~2021-06-26 10:50 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
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 [this message]
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=CAHLkEDtv8LP5UqOHvB_8YumcjPhNhVw4mUGB5LyMWxHFDVv5CA@mail.gmail.com \
    --to=marlon.richert@gmail.com \
    --cc=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).