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 31189 invoked from network); 26 Sep 2020 09:27:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2020 09:27:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601112457; b=mSmn2iNNeXJsMSsyn3X4mVAMHPaaIytsC7vAs++GhjFtL09fkIZuWbjtwF0kJTG7CbrdSeNC4o PdGkq1nWLPu3u+v8/LhxNADYFHSB7tSdCG4utRLy0W1jJ/GdkpuuZEiLKsCfUJ9HQS7H8pMYJs 5LnMkg2jXiNl8SnpYaVHFBHPnSNsUwcMfrUps36EpzAECFL5BepDN/qH905ZHVy81OE9cOgL3R jw2mL+JySwRm84mKA2naCvEWEWBeFQsNUXbKD7Jj4jhtNwEmIIlD7/QNRKdCSBW1Q83TR33x5b SvlhTCRBvkeYQjneOfdmZ4krkkcs1fj2r9E81esOoDN3Tg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 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=1601112457; bh=kcrtrKiMzEdxs7ZPH3x3uZ2R7T0BlGy8aqonyx5kRB0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=ulM5VV7VpxE5SCG9wnRExScG0qmlTSln93kRw2OoC3z6Y5s8slxlwpxA2c+ple249W9k5FACQz HiuGPsDcetQQRueAbtz+4Lf4zExmo4vb/qCE1vx4RYVLIOKYN/FC/5ggBhLYogTGMupYlfwDej 9MFu44qAbptCrb614FdfDkQq4O01wIE5FvFNTbU1Ktl1MSQIJRs0yjdoV+G4yYxVidY04vKDGH b8L7kprODHSebaUH0dbinASKCs53+JS0Gs3cnnEN/AJQGjLBKTecmQUlyPDlqHSdndeSiGq4uX zOX431ElFbRhVmPK7jnk8iCV8Flq7o3fIQPKSj7b6YHvtg==; 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-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To: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=2rqkuQCibYBYaYu4UZXrFPmZCZ6jJUAU3mjWsmbu70U=; b=zSpNlydMdTl8FyOS9zkh6TQAB5 samRhMjWAkDZmyZkckrxJg9tuB6WVPki+7+Z9igsuIe6/2DM9iHbkchdrqeZm69zhx71L02jxljvE W7j4L6jc0oJL9venWkrayZKxblApbwyuIXG1ZFunAcaxiw6apNzyVYsGtZu46zo22Uul5Y3jG1O33 NDWkZbFf+y0t4KS85Fg8MqyMz52RaWW4R4ChRwP865P60Tb61mPuL1X5JaH44fqwOMIe25TiwnAON XvlsAFZ3OK12HQ8hK68wtXlFWfAJ+WsZBKW9J57XzJ6fvUZG8b2qu2+JXwmnx56QN7vdUT7W5Pkr3 KEQkEvWg==; Received: from authenticated user by zero.zsh.org with local id 1kM6UP-0000Ul-BG; Sat, 26 Sep 2020 09:27:33 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm1 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 out2-smtp.messagingengine.com ([66.111.4.26]:44139) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kM6Tv-00007P-Qc; Sat, 26 Sep 2020 09:27:04 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3A8F95C0166; Sat, 26 Sep 2020 05:27:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 26 Sep 2020 05:27:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=2rqkuQCibYBYaYu4UZXrFPmZCZ 6jJUAU3mjWsmbu70U=; b=cw5CpKbqMbWfHrbVmYG8N7E0KRbtUqYdADqf3G3e6i uBCxU60XRnCAMw1CKEyodXJdsCWp7a4q6S9xNYnB/mjvu9rrVyMMmRcV+UG2DTK4 r0l1aHsG6+yG2VvnPQNNvLi6LEsn0b09LFKKcyX52UAYvSEwNOvJxjhPAc80Ms5y YApB58j1Rui6fY8B5TXcOprRyhUALlT2BGx12W6FJ068CM3vTPPERWKg0oHrzXa4 65MPSv2XX9CzirWL7M5LooOJSQajPCkNmVlOkc9jUFcdzF2TGm1fOZd8FcfQrTd8 mhb3pwUsA4YPwj+JHoruG76XgzN3xivd3UiW7qUG0fgw== 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=2rqkuQCibYBYaYu4UZXrFPmZCZ6jJUAU3mjWsmbu7 0U=; b=fnGuVni+fB84MgkppS8wWXbC5xafYoTT6PJiryJhYxU6UvsOHDUNpuvKL e+x7IsZbm4Y/VXUhIEulvuqKUgAee4IZCoqnMyP23JfsQRQfQNkXv4/E1SvXuuFv Ax4v5Jj6jZovNlGTzBxgCjWmrocmgZXnmBKKk+jXQnhRDcsIFq6UstL9Kry9XqWd IxZBVb2jcrlPutm4omCJ2cBEbqx7gz0SuBJSDFDGOQ3p1X26jyQ1hj3qWmgjt4k+ RmtO/8rbRetUIuQdG1Crz4vUTDwsgHFr3vYvC+cZeG9ZqFid/FEHWo3/ki7SlIVf Z5489MAwBydtNVtLgboQPie6Oj/Uw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkjghfofggtgfgsehtqhdttdertdejnecuhfhrohhmpeffrghnihgv lhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefhtdetfeehveeutdehuddtieefgeettedtjedtffehudeiieej leetteekudetheenucfkphepuddtledrieehrdefvddrudekfeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-109-65-32-183.red.bezeqint.net [109.65.32.183]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D46D328005A; Sat, 26 Sep 2020 05:27:02 -0400 (EDT) Received: from tarpaulin.shahaf.local2 (localhost [IPv6:::1]) by tarpaulin.shahaf.local2 (Postfix) with ESMTP id 4Bz3MT257yzqY; Sat, 26 Sep 2020 09:27:01 +0000 (UTC) Date: Sat, 26 Sep 2020 09:27:00 +0000 From: Daniel Shahaf To: Peter =?UTF-8?B?U2zDrcW+aWs=?= Cc: zsh-users@zsh.org Subject: Re: How to avoid infinite recursion in ZLE widgets Message-ID: <20200926092700.01784063@tarpaulin.shahaf.local2> In-Reply-To: <322971271.67362.1601044983375@mail2.virginmedia.com> References: <20200923182558.nfokboenuhdypz45@localhost> <322971271.67362.1601044983375@mail2.virginmedia.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Seq: 26086 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Peter Stephenson wrote on Fri, 25 Sep 2020 15:43 +0100: > > On 25 September 2020 at 15:19 Peter Sl=C3=AD=C5=BEik wrote: > > By the way, the documentation says that zle -R should be called after > > changing the command line from within a ZLE widget. > > > > However, when playing with LBUFFER and RBUFFER I realized that zle -R is > > not needed and the changes are visible immediately. > >=20 > > Why is it so? =20 >=20 > You only need to call zle -R either if you are passing it an argument > to show, or if you are bypassing the editor interface somehow so it > doesn't know the display has changed. If you use any of the special > variables or a zle command to update the command line then ZLE's > internals are all consistent and you don't need any special action. diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 84be010e1..885366c8c 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -502,7 +502,8 @@ ifnzman(noderef(Completion Widgets))\ ) item(tt(-R) [ tt(-c) ] [ var(display-string) ] [ var(string) ... ])( Redisplay the command line; this is to be called from within a user-defined -widget to allow changes to become visible. If a var(display-string) is +widget to allow changes made directly to the terminal (bypassing ZLE) to b= ecome +visible. If a var(display-string) is given and not empty, this is shown in the status line (immediately below the line being edited). =20