From 9ef6eed52a5cdba96bb95711eadd71d21bd81388 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Fri, 23 Mar 2001 12:44:21 +0000 Subject: add commands and call-command styles; mention some of the more expensive things about completion setup in the docs (13727) --- Completion/User/_init_d | 3 ++- Completion/User/_make | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/User/_init_d b/Completion/User/_init_d index 93065cd80..280b0a9af 100755 --- a/Completion/User/_init_d +++ b/Completion/User/_init_d @@ -17,6 +17,7 @@ read -u0k 2 magic < $words[1] && [[ $magic = '#!' ]] && # # cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $words[1])"}:#[[:blank:]]#(\'|)[a-z_|]##(\'|)\)}}//[^a-z_]} ) -(( $#cmds )) || cmds=(start stop) +(( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds || + cmds=(start stop) _sub_commands $cmds diff --git a/Completion/User/_make b/Completion/User/_make index 958e2a5af..7c7bbdae3 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -32,7 +32,8 @@ else fi if [[ -n "$file" ]] && _tags targets; then - if [[ -n "$_is_gnu[$words[1]]" ]]; then + if [[ -n "$_is_gnu[$words[1]]" ]] && + zstyle -t ":completion:${curcontext}:targets" call-command; then tmp=( $(_call targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null | awk '/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}' FS=:) ) else tmp=( -- cgit 1.4.1