From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12124 invoked from network); 26 Jun 2021 10:50:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Jun 2021 10:50:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624704609; b=C74e4/jcEtC/2oWlXu9XIpfYODhzHK19Hw+47unnN0vSCT2zpytHpYtamBgwL0a7oLsGRYxsEG pPtDQBHM27wowk4DtRI5Vlf7Yle8Nrf+9ELjhyM8dpgNwHQVg1krMpDKSGuUGMff/6ygRzvmUX wdTIpKkSl4VEwAoRXHYTcuIOJ8i6OAHqFDki3IKaJWvYeE45W0DduH5RGh+0Ayus/Z44RI2gVY 76uHw3ddh515V4mrNVuy48tK55FpRjseOo+ntvUGdGF7s/BLTI9WFbohsCH7O+K3l8ShiFOMT0 B8r6+RQI7JkviVQ3K47qAgnDIzjjWls57KYkZeci+tsa6g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f49.google.com) smtp.remote-ip=209.85.167.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1624704609; bh=k+KcrD157bANecNLd3SW9Spu1cEmcjQzUf9eXCZ8uf4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=MipStemHWuZ+Afun70IBm5ofy9FgoBBAcoMni8qFj2o6smjbh5aZCP4x3ODO/ejyd2FVtQbmjP 28Uvi36oXExLgI3/NHu2DEIOqWISm7kr6AUzEHnv/KIM7skmF3mrUYuAKLkRB/hAwscOnh4T9d YjidofrE10iD0MluBmXDTvRgDlunm8htXIz8lf1+LnwhFrpBz5iPUSSdQdh3FPmgTUvQIzWdqZ bBEgvSz1K+zbOBufT32rK7n1Ml1WOkweQJ1So4ddDBk7UwiPQmlmlLZpigte9vVPV0Yl/txTmd ab9JmtBQ6m+7hReGGAFw6XPkmI8qQTEa+KKnwcOQPUhoZg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=KPQuuQuBgKiKFUBB2u2exO9Qgsx88aTVBqCUHihMwlM=; b=V+s0pA7twNSdSwjMMt/WoHv87M PlWx6UpdM4AD0+bSDJmTcxxlMkK1YIiQ3Hci52lLSnmxZ74zT23JDHZAhAJxUXopnOplfG/m/YtNn 3S159vVTdibXmC0R1/IQWKHeFxoXYhswp5A2RhCC42CJfy3kJY9Qz9833g2qvaRqBaNjtfcKWgJMU o4OysuR+LQuzFs/DF0Xe9kuBpjlEa/ZSid2drh1fsUwmG+GbDfTE0wcjci76f6izOxomEicFBISAO ENwIEWX/TyDjgwMNJgSSnVC+w7sDhsSkjxRf7f6jXdNyzLWtvPpeevejbxRPwgMUfla3YOeFgvQ5o 3rQal98g==; Received: from authenticated user by zero.zsh.org with local id 1lx5t2-0003QM-Fy; Sat, 26 Jun 2021 10:50:08 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f49.google.com) smtp.remote-ip=209.85.167.49; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f49.google.com ([209.85.167.49]:35684) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lx5sn-00039q-4V; Sat, 26 Jun 2021 10:49:53 +0000 Received: by mail-lf1-f49.google.com with SMTP id u13so21108489lfk.2 for ; Sat, 26 Jun 2021 03:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KPQuuQuBgKiKFUBB2u2exO9Qgsx88aTVBqCUHihMwlM=; b=NeETeS73Rwu5cmq6GZjCp4MixbHjIWWWo8tPhiJquTqf5Yt+Lj6+bzfJrv0BOMyEqM Gru6+HmkyFQiSOi7m6zrmDECgnzpKqQKAuDNeA50zZw3C9hdr6sE557r+VD5DRIrm/2z MA9NU+JtbKFEcQsqlXTjxuD0ttQMNUaBVgGEJobJb3wLTJFSwV7V+2j3j8Y7QqWduNQt z+DuUflGp+grxfP1h+YcLTVCD2DkgL83ilj0QgxOSrmzW7XsUpT5wz2qVnmmkF8fpmQN unT8+fthsVIDwx+wSBsiX7BbbtHJoy4XMbnTWBr06SMrGwdotxSokbd5aLbM2Cx/3CeU eh6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KPQuuQuBgKiKFUBB2u2exO9Qgsx88aTVBqCUHihMwlM=; b=ZyHzQzDbq/IUIjvLeTkx7VQ04FK0PYNLqLkHEMchPjFQG8qhjfGMgAxcxvbbM+AJmB mZoxVCXIIRh8P8d5U7NUxeb9KRbNwzAa4B+fMemQxuBcYvlhpjaFNuQ902Gtc/Mzhjpq eo9i62YFVrM2TW1rHEBPvltH0/BzAfsNJY4auxgqYX2c3KNXtz0AmMd6YCnjy0wjDj9n 8Dx6IQaz2hcg4eCkg1Z3vQhXUxMzoOOQit7IG87ETfYkVQoLN833/0t7FUBtTlVbYIRO VFAw6Nfs4YLDxbk0otXcb9UFduggj0bLmurbqCngmDwHzY2Np9YgjX+FbvQ0/NCYO02Q Ymag== X-Gm-Message-State: AOAM531PmTxHoY4U0niVIVrbBHBPjPdFTliByMKiDECP/6Z3V/yzOswC UITiGgDeRsl4F50Ic7YfskFvU8lPSD1AASmh8pagko3TnLZdCA== X-Google-Smtp-Source: ABdhPJxuCZa0iKZXCs06TMLgGDk2I9cjMYDth0S8BO01Y3spao4Szpjbii8FpK6c2zRgYsaWRObap5uk4cGwJ5M+GLQ= X-Received: by 2002:a05:6512:1512:: with SMTP id bq18mr11807317lfb.102.1624704592375; Sat, 26 Jun 2021 03:49:52 -0700 (PDT) MIME-Version: 1.0 References: <9c56f50a-d061-4175-958a-6f89f6bae822@www.fastmail.com> <20210624183006.GA16386@tarpaulin.shahaf.local2> <20210624235216.GA25615@tarpaulin.shahaf.local2> In-Reply-To: <20210624235216.GA25615@tarpaulin.shahaf.local2> From: Marlon Richert Date: Sat, 26 Jun 2021 13:49:15 +0300 Message-ID: Subject: Re: Does add-zle-hook-widget violate the contract of ZLE hook widgets? To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49126 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Fri, Jun 25, 2021 at 2:52 AM Daniel Shahaf 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.