1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 18:30:55 +01:00

zsh-workers/7953

This commit is contained in:
Tanaka Akira 1999-09-21 01:42:21 +00:00
parent a7bf68a836
commit b204827535
3 changed files with 24 additions and 1 deletions

View file

@ -10,12 +10,14 @@ local oeg="$compconfig[expand_glob]"
local oem="$compconfig[expand_menu]"
local oeo="$compconfig[expand_original]"
local oep="$compconfig[expand_prompt]"
local oec="$compconfig[expand_completions]"
compconfig[expand_substitute]="${compconfig[expandword_substitute]}"
compconfig[expand_glob]="${compconfig[expandword_glob]-$oeg}"
compconfig[expand_menu]="${compconfig[expandword_menu]-$oem}"
compconfig[expand_original]="${compconfig[expandword_original]-$oeo}"
compconfig[expand_prompt]="${compconfig[expandword_prompt]-$oep}"
compconfig[expand_completions]="${compconfig[expandword_completions]-$oec}"
_main_complete _expand
@ -24,3 +26,4 @@ compconfig[expand_glob]="$oeg"
compconfig[expand_menu]="$oem"
compconfig[expand_original]="$oeo"
compconfig[expand_prompt]="$oep"
compconfig[expand_completions]="$oec"

View file

@ -58,6 +58,14 @@
local exp word="$PREFIX$SUFFIX" group=-V expl expl2 disp
# First, see if we should insert all *completions*.
if [[ -n "$compconfig[expand_completions]" &&
"${(e):-\$[$compconfig[expand_substitute]]}" -eq 1 ]]; then
compstate[insert]=all
return 1
fi
# Do this only for the first global matcher.
[[ "$compstate[matcher]" -le 1 ]] || return 1

View file

@ -479,6 +479,10 @@ tt(expand_menu), tt(expand_original), and tt(expand_prompt), see
ifzman(the section `Completion System Configuration' below)\
ifnzman(noderef(Completion System Configuration)).
In a different mode selected by the tt(expand_completions)
configuration key, all em(completions) generated for the string on the
line are inserted.
None of these configuration keys has a default value.
)
item(tt(_list))(
@ -1323,8 +1327,16 @@ tt(compadd) and thus may contain the control sequences `tt(%n)',
`tt(%B)', etc. Also, the sequence `tt(%o)' in this string will be
replaced by the original string.
)
item(tt(expand_completions))(
If this is set and non-empty, its value will be evaluated in the same
way as tt(expand_substitute) and if the result is `tt(1)', no
expansions will be generated, but instead the completions will be
generated as normal and all of them will be inserted in the command
line.
)
item(tt(expandword_substitute), tt(expandword_glob),
tt(expandword_menu),tt(expandword_original), tt(expandword_prompt))(
tt(expandword_menu), tt(expandword_original), tt(expandword_prompt),
tt(expandword_completions))(
If these keys are set, they are used by the tt(_expand_word) bindable
command to override the values for the configuration keys with the
tt(expand_) prefix.