Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] add-zle-hook-widget: Escape "$@".
- X-seq: zsh-workers 39495
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] add-zle-hook-widget: Escape "$@".
- Date: Thu, 29 Sep 2016 09:50:09 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=2qR MufoKWrmgAbo9GxZ5ZLBwzpg=; b=qyabB6JwzJw91NRLktkwpn86UGrTfCjI2Mz CcTCWaTYF01zHgNgDpEoQMJvORWSzuRQfCy7V8jczfp5c1AYhBpAgTP0jlpTSexo QEk0KqGDg1oEHyHKEDFg77sAJFafSM18dCtfk8z0zXvZ3aJVAgAGe8v7aJ+eDVdo QkOr48M8=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=2q RMufoKWrmgAbo9GxZ5ZLBwzpg=; b=rfyJ1K31crDzskvns6UORAgX37b99ULiWG OdDJK5rTvEB3+vBjODnx8YY/3KMosSDjt0PYlDdPZjpvW4eD+ZMJkLwzv5oztROc NOe8UWc10TqXy+yvphX/VUPpmDcDPOQiSGAPqYaEaTnvsffLiokNjThXvrkA9wF9 GZElfnjpE=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Mainly for educational reasons in the documnetation.
Currently, the only special widget that takes arguments is zle-keymap-select.
Cheers,
Daniel
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 63df292..189a084 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -346,7 +346,7 @@ as the var(hook) argument.
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 -- "$@"))
vindex(WIDGET, in hooks)
Note that this means that the `tt(WIDGET)' special parameter tracks the
diff --git a/Functions/Misc/add-zle-hook-widget b/Functions/Misc/add-zle-hook-widget
index 572de25..d8a3950 100644
--- a/Functions/Misc/add-zle-hook-widget
+++ b/Functions/Misc/add-zle-hook-widget
@@ -47,9 +47,9 @@ function azhw:${^hooktypes} {
for hook in "${(@)${(@on)hook_widgets[@]}#<->:}"; do
if [[ "$hook" = user:* ]]; then
# Preserve $WIDGET within the renamed widget
- zle "$hook" -N "$@"
+ zle "$hook" -N -- "$@"
else
- zle "$hook" -Nw "$@"
+ zle "$hook" -Nw -- "$@"
fi || return
done
return 0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author