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 4602 invoked from network); 26 Sep 2020 10:24:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2020 10:24:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601115893; b=f32W140ZvY4N5aTbtn5KOEHfLYfs4URcpzFriAlyhDttzfJZsgdCgY2Vfp3afYgqJ/cZXFoaXx s1eRYEq1pKblgF8RyTWA4YrSrO2/eCzZyKWKHMYMUwfSDVA//7cf9iquTfGzeVjHxvxf1CBw0d Q3b6bKp8HRJQ23TXXltJuH1lcYPHRDpn6/+LtPe/FpiBy3/EAz9pofULixK6s9zkD7XHuLG1BD zRBu9U7KMp29NDaRz4WCbdHaKWREF8Z9qpo/cChQquRsDHwUYDDVGVRdPC9h+hY9c0eKtjnWD9 GMRj2PAcYC0pOAyE0vL1bu4nrL71IrDazvGbh4ATdZ7KkQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; 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=1601115893; bh=S1NdYUUTWoBajElmnuZ1HKeU/IbhUqXj7/WGfZgwEuQ=; 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=uKY39GtKYjwgbocBfHLLwHRdLhyRR2Ea12F4cIw1X51Xh8mb+fnxBw/CJvOFXU32cI1u8AcnCD r3kkq3UibcfGZ4Gq8Oqb0Q1hPyN9qwIuasmWC89m7u/9EnEb5YEN4FG83m3LpGutN7tKKgViKJ y9/o1pHQH7SUDQ+mytaBlgJmxGo9Y4PsVXzrwIP6XWQSYRWlALhELNKXWiEcTFHMEyjlgCPJR3 XzTzOKPoGmL0CRieLgPLPTHaaV9t3i9Z9W6SD6e8dRFzoXrv6i0a5K9NfM4lKf1/VI7i9mdXcO tfbKNC7rHBiQESIxwgBfFqXdg1m2XKq2Z1iDx+XSdhc6Dg==; 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=npudrCxCVivNk9FI90PSk+vprudS6jXY//yK2SxIIQk=; b=uDIusW87A62gJoihWOiOf0yYOz D0LNiqMeycM16RP2h9IUWogbk1JQ1/0Pd3UE7zg1Ymf5MDq92OSYSb17wTC8sHcTU6lMmaieAjWDe h382yy5p6u373l8Mq+71TfjZKE9Z3ZvycCpsJHZ9RFU6sbkZlMDeLvAxTUKczqcDD2cuYEuFkOr09 glenbnk7ID4SCzQz4pSR37pf+V6XxTruS0reS7zAr4S9dBftUtmvFOQCbj0/lXurhJK9PGNWMYVn1 8LgyuYAVOy6wvpxOtOm2CSaTMVzH5FNfKLz0iPL1lekMQexLVaJfYIwrjzbj5kl3eTFiyxwutpTlO 4NV7zwcQ==; Received: from authenticated user by zero.zsh.org with local id 1kM7Nq-0002xI-D8; Sat, 26 Sep 2020 10:24:50 +0000 Authentication-Results: zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; 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 out3-smtp.messagingengine.com ([66.111.4.27]:50899) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kM7NM-0002aH-7y; Sat, 26 Sep 2020 10:24:21 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B9A585C011C; Sat, 26 Sep 2020 06:24:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 26 Sep 2020 06:24:13 -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=npudrCxCVivNk9FI90PSk+vpru dS6jXY//yK2SxIIQk=; b=NsWnO8JNdH55KiZOMa3xXqK8NNVNVcpov8uyEVZE7A Nes7Q3Ua6/pPjecJx4ShkJyCLYtRMoXkfgGarpn6oQ8FJQUv3Jlm8eFniheggCmb +ex/8EnU+4D710E5i9hlxmXIf6+wOQ8A/j8uHM2TPZ90T5vGZ8lUAJrLLtWAlNGD 8fE01tQetSYtXkx1oYltAowZzkPCdjjba1ZCB+/98VBoyTMyI1BUqsdQfJfFwRZN FfkGwe43xDv8OyWe4/aOjvkkdoOd8KZh+38ztccu/b9+GCmme2ehLvCBzK8oEO8x twwX82NJwzE/aTTPxcTHiMEuQfk2rnjM8YK0bHVCzf+A== 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=npudrCxCVivNk9FI90PSk+vprudS6jXY//yK2SxII Qk=; b=bHCy/mY7u/RkEbM2PJm1Lyyqbx3X+ciGrr0V7kmG0aTM0ZknstigHUd5/ IjmRBYuRywyWoi/vemDRSFCp6gR9UV6SEvOkjZugw58VKwyNflxKc6Im8SjCLp6q tPZb3p3s80TJOSWmnHKYuunGW0Xz9V0FEkKZCoKz4/ZRXvA+pNJEowveeZ8Lu3i9 rPk8G7nbafXrbbaqc1VqtBkl1uX6OZJoqFcXVABqC/6ToPphEFslHS83r/fojCiU Xqitkdee+2qErJ29+231tDwgizP+j/LfoDVoZuv4f8OY6/RmjBvOYB57X7gt7tup MPRwAVv6HO46VnapzFttbASowpCgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddvgddvkecutefuodetggdotefrodftvf 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 1A8053280059; Sat, 26 Sep 2020 06:24:13 -0400 (EDT) Received: from tarpaulin.shahaf.local2 (localhost [IPv6:::1]) by tarpaulin.shahaf.local2 (Postfix) with ESMTP id 4Bz4dQ67hszqY; Sat, 26 Sep 2020 10:24:10 +0000 (UTC) Date: Sat, 26 Sep 2020 10:24:09 +0000 From: Daniel Shahaf To: Roman Perepelitsa Cc: Peter =?UTF-8?B?U2zDrcW+aWs=?= , Zsh Users Subject: Re: How to avoid infinite recursion in ZLE widgets Message-ID: <20200926102409.089a4225@tarpaulin.shahaf.local2> In-Reply-To: References: <20200923182558.nfokboenuhdypz45@localhost> <322971271.67362.1601044983375@mail2.virginmedia.com> <20200926092700.01784063@tarpaulin.shahaf.local2> 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: 26088 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: Roman Perepelitsa wrote on Sat, 26 Sep 2020 11:40 +0200: > On Sat, Sep 26, 2020 at 11:27 AM Daniel Shahaf w= rote: > > > > Redisplay the command line; this is to be called from within a user-de= fined > > -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 become > > +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 >=20 > I think the original documentation was correct. Consider this snippet: Good point. However, the language "this is to be called =E2=80=A6 to allow changes to become visible" does support Peter's interpretation that =C2=ABz= le -R=C2=BB must be called for changes to be shown, so I still think there's room for clarification. How about: diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 84be010e1..c71aa463e 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -501,8 +501,7 @@ 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 +Redisplay the command line. If a var(display-string) is given and not empty, this is shown in the status line (immediately below the line being edited). =20 @@ -511,9 +510,9 @@ prompt in the same way as completion lists are printed.= If no var(string)s are given but the tt(-c) option is used such a list is cleared. =20 -Note that this option is only useful for widgets that do not exit -immediately after using it because the strings displayed will be erased=20 -immediately after return from the widget. +Note that immediately after returning from running widgets, the command li= ne +will be redisplayed and the strings displayed will be erased. Therefore, = this +option is only useful for widgets that do not exit immediately after using= it. =20 This command can safely be called outside user defined widgets; if zle is active, the display will be refreshed, while if zle is not active, the