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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31323 invoked from network); 23 Jun 2021 21:58:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2021 21:58:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624485497; b=xVklAjnhzfBDqGLyqyObso2q6z5nkR0otJcdMbxh1tZMc4c4Ds3GgYz+GK6DNPk5q+uB/1ktb9 i0ZSBS/bl8m2tpKaGxy74nPVL5CJz2WvFKVEDD6IcHM3a5H/wQhE9sz2mRYpvdl9F2SEhskmRI x274y5y78UVp8ncJcJxFfk6v9kg/3uRf320+xTBc8su/hpie+lH1meL7h0F4IrOxTfWtVO+p5K b5sj36xkTmOctnRqSAorf9c6pLQHsc4yYYSQwEDpoGvUEFsJg7Ci1/Tf0FXXvoQhhOkx/8/Rnv TXF//l3+IT96trPNuqqdfeyAQ+roNQp5F2JrWNURQvkeyw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1624485497; bh=04eZEJ5R/NFmBq0mL+8UpZog+iGDUMA7Rucq4ZQHboQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Subject:To:From:Date:References:In-Reply-To: Message-ID:MIME-Version:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=zoX8PHoD4yL+lLy4i0/2AfG9Qxm9A8liJJKtGP2LUyOLW5B4ajo7MPUtwvfIMouuEA0Xext4pO gTVY8AqGWzsFmzOSwbj0PSfDbZEtJk2SSdnBOvpX/sPanOq1n8Mz7LMi8JMBpexzR74T4kQcLQ huVBkQtb7KZjZWZodraAe7PCcfeITcnnwzpBThApBVHjYD33EPgKh6S70kdoKB4cztioneS93Y 6nFwyV0L0nw8KVUoVnbJuYwWKZDYucL5WL1YT6WNKXFRHJhGdup+sV8MQOUWhBXcorQfIBTrdM HKE4/1/ZyHKLkoMIakUzWCEzQBiAvTNgNStHRMFCARU7lA==; 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:Subject:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=j9fXERJnXHaehNtM0FGvL9/t48Ua/vfSa2jQXDWKjc4=; b=Rz1M0EVzrUULYFlTypL0BLIG0I cQzEVLJBi4Zoyd8FnUTx5CoKbYIaK7Rqbyi7zRUNFf4e73y4xe4WjwRVUgkh8vXCOFFANi5EwOJTu IsIHF/6nKXwVStbNogUz8TTTtkkQD/FzXyfBCL3SNRf23PdLfk0lxpPF4Hl0vtfn1y/uaKe9KP9JY YB/glD0TvzPTCohMrtzsEM1Rg/b+2eZs7tQOpyN9My6K32fZ+mBswvUSLfMSN7ylhpDS28YHeN2/h giwUPHwjJxgUyXAJTtw3BSBGL9dCI/fbBdJh9l7vFT/YqsmLmvKktyNQMvFgJPMq11gfZsC/O/ow9 pENs8GZg==; Received: from authenticated user by zero.zsh.org with local id 1lwAsz-000NEK-A1; Wed, 23 Jun 2021 21:58:17 +0000 Authentication-Results: zsh.org; iprev=pass (wout1-smtp.messagingengine.com) smtp.remote-ip=64.147.123.24; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:47293) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lwAsf-000Mvm-Gj; Wed, 23 Jun 2021 21:57:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1267721C0 for ; Wed, 23 Jun 2021 17:57:54 -0400 (EDT) Received: from imap37 ([10.202.2.87]) by compute4.internal (MEProxy); Wed, 23 Jun 2021 17:57:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type; s=fm3; bh=j9fXERJ nXHaehNtM0FGvL9/t48Ua/vfSa2jQXDWKjc4=; b=tU8ohHTqB71N8OUP6Qihsky rEww8yIhfKlc6sW81ZAgPQiaSGtF8dQMcWOxjty8wgDwh59iMungr3nhrCWRXHNw HC2yKtijLAU4nbTUlmGEZUffUz06B6AzzNnrVqYyrs5Hb1d00vpj/jz0Jv+Q7NqS F0Xg2q6yygzHLY2CnAMYsU4a5W+HT8s6iMs7YeIgV2Z6BvWj/bfkDk0ZiTSEsyiP sKgxrX2f9s10L+6y1/mJwJ5tZiwk/gr+bSH4Sp9Mjp2xj5GQHQyXqZ1I/WD3OOMk QL1y3RHwGh5+RWY1qmF3vwcNPk7s+vU7jiRArjTvKUtYRAz4qSzuS8o4oFGUDPw= = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=j9fXER JnXHaehNtM0FGvL9/t48Ua/vfSa2jQXDWKjc4=; b=mlHpPoA0sL0stzsaFpY3+I 7ojkSpP5hhYkz7+E+u5ShGbjqkrSO/lYOFjuxc49uxUZROlsQ/GnNVnd8pH4hjHb fpUV0k68Zr0Z/3h3vd/lALc/ApyXJ+AfyQ9xKKW4Gcr0HyKhH2t5OBXJljHRUMJz YdWGwENKiU6qzs17B86YV8r8vr1IDGlEk8G/uneli8b3jbsHVK0vGFSO64lonS2U z2r7h+LOslW7uZ/MUAMtm8Lq0AEKw/3jzXO+7ycmrDynV/nPIrTH9qnnlUCLTJQI oQFl22cWsRQFiYJvnsxVa0v81npttO6EU43ViimI+xR6yvWs0qkbJsFlfhlVcxyQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeggedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderreejnecuhfhrohhmpedfffgrnhhivghlucfuhhgrhhgrfhdfuceougdrshesuggr nhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeetheeiudfgve efffejfeehudeivdeiuddtteelgeevgeduueeijeejgfeljefhleenucffohhmrghinhep shhouhhrtggvfhhorhhgvgdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 595086B4006A; Wed, 23 Jun 2021 17:57:54 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578 Mime-Version: 1.0 Message-Id: <9c56f50a-d061-4175-958a-6f89f6bae822@www.fastmail.com> In-Reply-To: References: Date: Wed, 23 Jun 2021 21:57:33 +0000 From: "Daniel Shahaf" To: zsh-workers@zsh.org Subject: =?UTF-8?Q?Re:_Does_add-zle-hook-widget_violate_the_contract_of_ZLE_hook_?= =?UTF-8?Q?widgets=3F?= Content-Type: text/plain X-Seq: 49105 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: 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 and compatibility with hook functions that predate add-zle-hook-widget and don't set $? as add-zle-hook-widget expects. In favour of the second interpretation is that those semantics are the default, ubiquitous, baked into the language's syntax, and extensible (same thing as "This bit must be zero" in wire protocol specifications). I'm voting for the second interpretation. I suppose we could've added something to NEWS/README when add-zle-hook-widget was introduced, if only because this is an interoperability issue (foo and bar may be have separate maintainers). > Isn't add-zle-hook-widget here violating the contract between foo and > zle -N zle-line-init? No. The contract with foo is that it'll be called, and it does get called. > Should that `|| return` be removed? No, because that would break the case of _deliberately_ returning non-zero from one a-z-h-w hook to prevent further a-z-h-w hooks from running. Granted, that's not a documented promise, but there's no reason to break it, either. Hope that answers your question.