From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19192 invoked by alias); 13 Jul 2016 05:06:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38841 Received: (qmail 6699 invoked from network); 13 Jul 2016 05:06:53 -0000 X-Qmail-Scanner-Diagnostics: from hermes.apache.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(140.211.11.3):SA:0(-1.3/5.0):. Processed in 0.173787 secs); 13 Jul 2016 05:06:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at apache.org does not designate permitted sender hosts) Date: Wed, 13 Jul 2016 05:00:11 +0000 From: Daniel Shahaf To: Zsh Hackers' List Subject: add-zle-hook-widget Re: Next release (5.3) Message-ID: <20160713050011.GA18173@tarsus.local2> References: <20160704114016.190f48be@pwslap01u.europe.root.pri> <160704080424.ZM12848@torch.brasslantern.com> <20160707020021.GB6364@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160707020021.GB6364@tarsus.local2> User-Agent: Mutt/1.5.23 (2014-03-12) 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