summaryrefslogtreecommitdiff
path: root/Completion/compinit
diff options
context:
space:
mode:
authorFrank Terbeck <ft@bewatermyfriend.org>2011-06-02 10:50:35 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2011-06-02 10:50:35 +0200
commit2438a0e95aa448f0aeda468752444306b44fe7d0 (patch)
tree8477e9c6af360f6a89af13e8cb5f2a4f9c1cff2c /Completion/compinit
parentb495ba1e5a3ab1396844490ad8cad17dec23d6c1 (diff)
parent21266db1d9ae433bf1dcb196a4e258c00541b599 (diff)
downloadzsh-2438a0e95aa448f0aeda468752444306b44fe7d0.tar.gz
zsh-2438a0e95aa448f0aeda468752444306b44fe7d0.zip
Merge commit 'zsh-4.3.12' into debian
Diffstat (limited to 'Completion/compinit')
-rw-r--r--Completion/compinit13
1 files changed, 8 insertions, 5 deletions
diff --git a/Completion/compinit b/Completion/compinit
index aa42a12de..a0f2348a9 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -26,7 +26,7 @@
# expand-or-complete, expand-or-complete-prefix, list-choices,
# menu-complete, menu-expand-or-complete, or reverse-menu-complete).
# This creates a widget behaving like <style> so that the
-# completions are chosen as given in the the rest of the file,
+# completions are chosen as given in the rest of the file,
# rather than by the context. The widget has the same name as
# the autoload file and can be bound using bindkey in the normal way.
#
@@ -160,7 +160,9 @@ _comp_options=(
# have a valid stdin descriptor (zle closes it before calling widgets)
# and don't get confused by user's ZERR trap handlers.
-typeset -g _comp_setup='setopt localoptions localtraps ${_comp_options[@]};
+typeset -g _comp_setup='local -A _comp_caller_options;
+ _comp_caller_options=(${(kv)options});
+ setopt localoptions localtraps ${_comp_options[@]};
local IFS=$'\'\ \\t\\r\\n\\0\''
exec </dev/null;
trap - ZERR
@@ -229,7 +231,7 @@ comppostfuncs=()
# delete the definitions for the command names `bar' and `baz'
compdef() {
- local opt autol type func delete new i ret=0 cmd svc
+ local opt autol type func delete eval new i ret=0 cmd svc
local -a match mbegin mend
emulate -L zsh
@@ -242,7 +244,7 @@ compdef() {
return 1
fi
- while getopts "anpPkKd" opt; do
+ while getopts "anpPkKde" opt; do
case "$opt" in
a) autol=yes;;
n) new=yes;;
@@ -263,6 +265,7 @@ compdef() {
fi
;;
d) delete=yes;;
+ e) eval=yes;;
esac
done
shift OPTIND-1
@@ -276,7 +279,7 @@ compdef() {
# If the first word contains an equal sign, all words must contain one
# and we define which services to use for the commands.
- if [[ "$1" = *\=* ]]; then
+ if [[ -z "$eval" ]] && [[ "$1" = *\=* ]]; then
while (( $# )); do
if [[ "$1" = *\=* ]]; then
cmd="${1%%\=*}"