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 8114 invoked from network); 24 Jun 2021 18:54:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Jun 2021 18:54:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624560887; b=FNHJTyB3JkEzVUlS45wPL117t2mYT2p2TDCIHiVqYjxkkXDxw128PoFWNWhJWCHdC7eKenXCx9 HHXhBgLoBDzoWqyUZRpJz9EJHTUtOY14N43I3EyMBNAUjZ75LtPnQQZ7DOe71o/OMsxEC+d7qE aJKn09DhqwXm4z6ixECMB9iErki6Bd775S8UxlPi8f8oJbYZCaF53Z9BDBMH/WLS/93AdkP6/L ySHs7KGpTiRaGomHpnrTvimJDXHd9NdbVwnR6GhcsBd3WHpd10A7rM0v/EnKldWQrHpuG1Fy8J l5o6fZ9Ta3R/xja6ybt5KO7CYKRgY86Rp30PfVGlZVTo6w==; 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=1624560887; bh=xx6tu+kmQuACqO8NBvhspkKRAnvVE9HI/o0DAQK4dkA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=OQTzARa54tWvOgtGNd23V6VKCV0KPh3XcQhmAy5m/CgOqSx2w3XvR/0mYxmM25AybqAP/ugP5R 7CgWTaEraVUk8lE3nmr3CsgVr7t0FvPv+RBGKOnhza7Eo6s9mLH0H4UoqwJ/TvT1flUqU+XP3D fwpR6dh7bztbg0feIJXHnarmK68ANHMv0CqhZyAdW9Qnq9itx0GAiRGmObgE4zJX65eazWknuq oRvyO3ErfyNHssQrE71EqSBMf/J8n/xizhFzKdBrliscsyO6sZoMOvbCu65CIhKSXiens6/u7E r9wKghH4IkVbug3S0i/j6Kx3CKfLDQ+YU5D8BIoiVL42uQ==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=5H6lvANRVY9czSEclH5O4ZcEjsaXEytqqMCLMZ94dac=; b=yEJWS/E4IFnCniSD8WR1iySNal UmpSbbuY1eXA4dqDLNa2MPDkt34+S0PMVJOFBH48ntwwHdYLIKVBtvdyjoYCOMW8kKE9uj0iBkgAJ 8PjlpOqWrVa/4KCaRM1ftzR28SgtG5BzO1cIW+UUvObQdtExYoD+AYndV5EozFI/ENDtc5b2elQFH d8oYQ4/3V9PU4nR8TT860vMxTynXnhLDmqcCCx1np200jsNBThWzb/NPPFP4Gwe8SbNTpE2VUqA8y x94JF6RBAIsFNSkpouDDbPM3K91DlF/tWi5nHbn6A0ieFuE0JH6J5ZkWraxaR4kmg4PgDwCxWi6Zu SrJE6Bag==; Received: from authenticated user by zero.zsh.org with local id 1lwUUx-0001hX-6y; Thu, 24 Jun 2021 18:54:47 +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]:52473) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lwUUa-0001PJ-JU; Thu, 24 Jun 2021 18:54:25 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 151223200684; Thu, 24 Jun 2021 14:54:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 24 Jun 2021 14:54:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm3; bh=5H6lvANRVY9czSEclH5O4ZcEjsaXEytqqMCLMZ94 dac=; b=wfW868UODHjiyhsTA7gz9YKyBjKHx2svRE/Le5GDSOKg2DcLxIRyRUDF bg61SEdVOCURjlD/lv2WXiONIx8wrxox8QXQmhj5twC/hiazO47CVOzsa0R2niEG y3E9MiXL8h/3xqCcQx4KGfQO6Bs5eJLO5Ua8CniLP6tL4zchkSBz2Ip1mLhtV4u6 5zoA9/0SBmRrIaaf59a4ta+SQtQenI4/qtuhslX+OY6VFmDg2WZdC4rf03nLY1ME D+fUyfcW6Nrk+5Qac77St1QnJq9+PcPsxOwBaTqMJU8LvDDuz+Lr/NM8BnmChMbD oDUsvKhx9MZnFvEgfzCdhp6C+pHEHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=5H6lvANRVY9czSEclH5O4ZcEjsaXEytqqMCLMZ94d ac=; b=IjoKqOjqMMfHD6WtwSbYvMyMmJaGlRh0R8EzkgWR2edE+ztl6oqKZkHsM rHFyjooS4KpfWcSdVjLipoEPR06zcqZ+SghWVm51Nq3OFsXvQrO8bMKWUQDyS8zE q6JsPPgrvq3gHkwawqSYNktmDU8YtP92JxkkGO8X7wUX7Ev5oTTfOtzgovgtgark Q9q99hbqvb0cHzNNpsh4y1HJqQFVqVIkROvP7+MYCppjdDETIG0uaVeo1QIBxCDo KLz8IzEZihUm9aOS6S82G8zybcV/Vzpx68M1/pb4ibS1dT3lVgCRJTephcmCVd1D ino1u178OVLT5/OqwaIOaMAiJKhEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeghedgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggugfgjfgesthektddttderjeenucfhrhhomhepffgr nhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg eqnecuggftrfgrthhtvghrnhepieeuudeuteefueegudfghffhjeehgeffieeuuedvueeg tdevjeetgefhheejudeknecuffhomhgrihhnpehsohhurhgtvghfohhrghgvrdhiohenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegu rghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Jun 2021 14:54:22 -0400 (EDT) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4G9q6z3qtVz4fb; Thu, 24 Jun 2021 18:54:19 +0000 (UTC) Date: Thu, 24 Jun 2021 18:54:19 +0000 From: Daniel Shahaf To: Roman Perepelitsa Cc: Marlon Richert , Zsh hackers list Subject: Re: Does add-zle-hook-widget violate the contract of ZLE hook widgets? Message-ID: <20210624185419.GB16386@tarpaulin.shahaf.local2> References: <9c56f50a-d061-4175-958a-6f89f6bae822@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49114 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: Roman Perepelitsa wrote on Thu, Jun 24, 2021 at 12:45:53 +0200: > On Thu, Jun 24, 2021 at 12:34 PM Marlon Richert > wrote: > > > > [...] the documentation in > > https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Special-Widgets > > could be updated to guide the user towards azhw. > > > > [...] 3rd-party developers should be strongly > > encouraged to use azhw and not zle -N zle-X. > > [*] This thread, workers/49084 and workers/49085. Let's break this down. This thread is about the fact that a-z-h-w has an «if (( $? )); then break; fi» in its "loop over all registered hooks and call each in turn" code. It has had that check since its first release, and whatever semantics we desire are easy to implement. It's not a big deal. workers/49084 is an edge case involving pre-azhw code trying to wrap azhw. It's a teething problem, and shouldn't be too hard to fix. I haven't fully digested workers/49085, but its author does say there that a fix is "not too difficult". > Given the current state of add-zle-hook-widget [*] I would be wary of > giving this advice. I personally never use it and cannot recommend > anyone to use it. If your goal is to write a robust plugin that is > unlikely to break in the presence of other plugins, > add-zle-hook-widget is a poor choice. > It's not clear to me why you're raising the alarm bells against uses of a-z-h-w, for two reasons: One, the specific bugs you cite seem to be easy to fix and uncommon to run into (they haven't been run into in the 4+ years since a-z-h-w's first release). Two, you don't discuss alternatives. The conclusion "Don't use a-z-h-w" does not follow from the premise "a-z-h-w has bugs". It might follow from a proposition of the form "a-z-h-w is worse than the alternative", but that was not argued — and, _prima facie_, it's easier to write bugs without a-z-h-w than with it. > Roman. >