zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: "Peter Slížik" <peter.slizik@gmail.com>, "Zsh Users" <zsh-users@zsh.org>
Subject: Re: How to avoid infinite recursion in ZLE widgets
Date: Sat, 26 Sep 2020 10:24:09 +0000	[thread overview]
Message-ID: <20200926102409.089a4225@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAN=4vMpUS4oSczhUi6yMhTNU+n8=1DxKBAWvfj7jCoovLgO8Bw@mail.gmail.com>

Roman Perepelitsa wrote on Sat, 26 Sep 2020 11:40 +0200:
> On Sat, Sep 26, 2020 at 11:27 AM Daniel Shahaf <d.s@daniel.shahaf.name> 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


  reply	other threads:[~2020-09-26 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  8:34 Peter Slížik
2020-09-23 11:21 ` Peter Stephenson
2020-09-23 11:24   ` Peter Slížik
2020-09-23 11:29 ` Daniel Shahaf
2020-09-23 11:32   ` Peter Slížik
2020-09-23 18:25 ` zsugabubus
2020-09-24  9:55   ` Peter Slížik
2020-09-25 14:19     ` Peter Slížik
2020-09-25 14:43       ` Peter Stephenson
2020-09-26  9:27         ` Daniel Shahaf
2020-09-26  9:40           ` Roman Perepelitsa
2020-09-26 10:24             ` Daniel Shahaf [this message]
2020-09-26 10:31               ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200926102409.089a4225@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=peter.slizik@gmail.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).