Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to avoid infinite recursion in ZLE widgets
- X-seq: zsh-users 26088
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: How to avoid infinite recursion in ZLE widgets
- Date: Sat, 26 Sep 2020 10:24:09 +0000
- Archived-at: <https://zsh.org/users/26088>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-09/20200926102409.089a4225%40tarpaulin.shahaf.local2>
- 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
- Cc: Peter Slížik <peter.slizik@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <CAN=4vMpUS4oSczhUi6yMhTNU+n8=1DxKBAWvfj7jCoovLgO8Bw@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <CAC-uhUD6-t3F0ZQuz1A_OWsFOJVj7L0dibNwbnDJurpq4-mZ+Q@mail.gmail.com> <20200923182558.nfokboenuhdypz45@localhost> <CAC-uhUAFiL=LfZZ+PcYRRHgZVTyYJ5rd4r6vFWQTfkHMFNc+gQ@mail.gmail.com> <CAC-uhUC8UY=SJTqdcAZM1Ja3AWAecvy7gcV0RVtKephttQRfRA@mail.gmail.com> <322971271.67362.1601044983375@mail2.virginmedia.com> <20200926092700.01784063@tarpaulin.shahaf.local2> <CAN=4vMpUS4oSczhUi6yMhTNU+n8=1DxKBAWvfj7jCoovLgO8Bw@mail.gmail.com>
- Sender: zsh-users-request@xxxxxxx
Roman Perepelitsa wrote on Sat, 26 Sep 2020 11:40 +0200:
> On Sat, Sep 26, 2020 at 11:27 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > 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 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).
>
> I think the original documentation was correct. Consider this snippet:
Good point. However, the language "this is to be called … to allow
changes to become visible" does support Peter's interpretation that «zle
-R» 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).
@@ -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.
-Note that this option is only useful for widgets that do not exit
-immediately after using it because the strings displayed will be erased
-immediately after return from the widget.
+Note that immediately after returning from running widgets, the command line
+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.
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author