zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: add-zle-hook-widget Re: Next release (5.3)
Date: Wed, 13 Jul 2016 05:00:11 +0000	[thread overview]
Message-ID: <20160713050011.GA18173@tarsus.local2> (raw)
In-Reply-To: <20160707020021.GB6364@tarsus.local2>

Daniel Shahaf wrote on Thu, Jul 07, 2016 at 02:00:21 +0000:
> Bart Schaefer wrote on Mon, Jul 04, 2016 at 08:04:24 -0700:
> > (2) add-zle-hook-widget [I'd be fine with omitting that entirely]
> > 
> 
> Well, I'd like to use it in z-sy-h.  (I'd like to use zle-line-pre-redraw
> in z-sy-h, because that would solve multiple bugs; and I'd like to do so
> through add-zle-hook-widget for interoperability with other plugins.)
> 
> How about including add-zle-hook-widget in 5.3, but without any indices
> or before:/after: support, just the basic 'add-zle-hook-widget
> $hook_name $widget_name' syntax?  (And have it just invoke the widgets
> in the order they were registered)  That would be an improvement over
> the 5.2 status quo, and we can add indices or --option arguments in 5.4.

I've heard neither ayes nor nays, so here's a patch we can use if we
choose this approach.

The ifzman() thing at the beginning is to fix a preëxisting issue
where the "rather than..." line is rendered in bold.  (I tried making
the example() macro generate \fB/\fP around the .RS/.RE but that didn't
help.)

Shall we go for this patch then, or something else (what?)?

Daniel


diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index d4a4538..2e4ba9a 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -345,9 +345,15 @@ tt(zle-isearch-exit), etc.
 var(widgetname) is the name of a ZLE widget.  If no options are given this
 is added to the array of widgets to be invoked in the given hook context.
 Note that the hooks are called as widgets, that is, with
-example(tt(zle )var(widgetname)tt( -Nw "$@"))
+example(tt(zle )var(widgetname)tt( -Nw "$@"))ifzman(NOTRANS(\fR))
 rather than as a function call.
 
+COMMENT(
+The implementation supports specifying a var(widgetname) of the form
+var(index)tt(:)var(name), however, that is an implementation detail that third
+party scripts may not rely on.  See various threads in June/July 2016.  The
+original docs of that feature are retained herein for reference:
+
 In typical usage, var(widgetname) has the form var(index)tt(:)var(name).
 In this case var(index) is an integer which determines the order in which
 the widget var(name) will be called relative to other widgets in the
@@ -355,6 +361,7 @@ array.  Widgets having the same var(index) are called in unspecified
 order.  However, var(widgetname) may omit the index, in which case an
 index is computed for it to arrange for it to be called in the order
 in which it was added to the array.
+)
 
 If the option tt(-d) is given, the var(widgename) is removed from
 the array of widgets to be executed.

Cheers,

Daniel


  reply	other threads:[~2016-07-13  5:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 10:40 Peter Stephenson
2016-07-04 15:04 ` Bart Schaefer
2016-07-05  6:00   ` Sebastian Gniazdowski
2016-07-05  6:33     ` Bart Schaefer
2016-07-05  8:33   ` Peter Stephenson
2016-07-05 11:48     ` Peter Stephenson
2016-07-05 16:29       ` Bart Schaefer
2016-07-07  2:00   ` Daniel Shahaf
2016-07-13  5:00     ` Daniel Shahaf [this message]
2016-07-14  0:11       ` add-zle-hook-widget " Bart Schaefer
2016-07-17  1:51         ` Bart Schaefer
2016-07-17 15:00           ` [PATCH] _add-zle-hook-widget: New completion Daniel Shahaf
2016-07-17 19:21             ` Bart Schaefer
2016-07-17 20:40               ` Bart Schaefer
2016-07-17 21:57             ` Bart Schaefer
2016-07-18  9:47             ` Oliver Kiddle
2016-07-18 15:30               ` Bart Schaefer
2016-07-19 10:30                 ` Oliver Kiddle
2016-07-19 17:58                   ` Bart Schaefer
2016-07-20  6:54               ` [PATCH v2] " Daniel Shahaf
2016-07-21 15:28                 ` Oliver Kiddle
2016-07-22  6:22                   ` Daniel Shahaf
2016-07-22 18:21                     ` Bart Schaefer
2016-07-22 18:45                     ` Oliver Kiddle
2016-07-23 18:03                       ` Daniel Shahaf
2016-07-17 14:59         ` add-zle-hook-widget Re: Next release (5.3) Daniel Shahaf
2016-07-17 18:48           ` Bart Schaefer

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=20160713050011.GA18173@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@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).