From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12199 invoked from network); 17 Sep 1999 00:55:57 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Sep 1999 00:55:57 -0000 Received: (qmail 26124 invoked by alias); 17 Sep 1999 00:55:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7886 Received: (qmail 26116 invoked from network); 17 Sep 1999 00:55:39 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: -d for everone (and misc.) References: <199909151354.PAA32362@beta.informatik.hu-berlin.de> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 17 Sep 1999 09:55:37 +0900 In-Reply-To: Sven Wischnowsky's message of "Wed, 15 Sep 1999 15:54:51 +0200 (MET DST)" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <199909151354.PAA32362@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > I forgot to say `... except for _cvs and _apt'. Following patch modifies _apt and _cvs to use -d instead of -y. Also, it modifies _describe to make it work without option for compadd. Index: Completion/Base/_describe =================================================================== RCS file: /projects/zsh/zsh/Completion/Base/_describe,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _describe --- _describe 1999/09/15 14:35:20 1.1.1.1 +++ _describe 1999/09/17 00:50:41 @@ -58,7 +58,7 @@ (( nsets++ )) descr="$1" [[ -n "$showd" ]] && adescr=( "$adescr[@]" "${(@PM)^descr:#*:?*},$nsets" ) - if [[ "$2" = -* ]]; then + if [[ $# = 1 || "$2" = -* ]]; then match='' shift else Index: Completion/Debian/_apt =================================================================== RCS file: /projects/zsh/zsh/Completion/Debian/_apt,v retrieving revision 1.1.1.5 diff -u -F^( -r1.1.1.5 _apt --- _apt 1999/09/14 00:20:36 1.1.1.5 +++ _apt 1999/09/17 00:50:42 @@ -54,7 +54,7 @@ case \$current_option in ${comp_hasarg}esac" - local short_seq false true bool __bool_ intlevel word word1 nul + local short_seq false true bool bool_prefix intlevel word word1 nul local comp_bool comp_intlevel comp_configfile comp_arbitem comp_long comp_opt local regex_short regex_long regex_all @@ -66,7 +66,7 @@ true=(yes true with on enable) bool=($false $true) - __bool_=(--${^bool}-) + bool_prefix=(--${^bool}-) intlevel='[0-9]##' @@ -82,36 +82,28 @@ comp_short=\ 'if [[ $PREFIX = -'"$short_seq"' ]]; then _apt_consume_short ${PREFIX[2,-1]} - tmp1=(${${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}#-}) - if [[ $PREFIX = - ]]; then - compadd "$expl_opt[@]" - -${^tmp1} - else - tmp2=(-${^tmp1}) - compadd "$expl_opt[@]" -y "($tmp2)" - ${PREFIX}${^tmp1} - fi + tmp1=(${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}) + tmp2=(${PREFIX}${^tmp1#-}) + _describe -o option tmp1 tmp2 elif [[ -z "$PREFIX" ]]; then - compadd "$expl_opt[@]" - ${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?} + tmp1=(${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}) + _describe -o option tmp1 fi' comp_long=\ 'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}" tmp2=(--${(M)^long_bool:#$~tmp1} --${(M)^long_intlevel:#$~tmp1}) -compadd "$expl_opt[@]" - $tmp2 -tmp2=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1}) -compadd "$expl_opt[@]" -S= - $tmp2 -compadd "$expl_opt[@]" -S "" - '"$__bool_" +tmp3=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1}) +_describe -o option tmp2 -- tmp3 -S= -- bool_prefix -S ""' comp_long_prefix=\ 'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}" tmp2=($_ra_left${(M)^long_bool:#$~tmp1} $_ra_left${(M)^long_intlevel:#$~tmp1}) -compadd "$expl_opt[@]" - $tmp2 -tmp2=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1}) -compadd "$expl_opt[@]" -S= - $tmp2 +tmp3=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1}) tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#-?}#-}}" -tmp2=($_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1}) -compadd "$expl_opt[@]" - $tmp2 -tmp2=($_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1}) -compadd "$expl_opt[@]" -S= - $tmp2' +tmp2=("$tmp2[@]" $_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1}) +tmp3=("$tmp3[@]" $_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1}) +_describe -o option tmp2 -- tmp3 -S=' comp_opt='[[ -prefix - || -z "$compconfig[option_prefix]" || "$compconfig[option_prefix]" = *\!$words[1]* ]]'" && { $comp_short; $comp_long }" @@ -321,6 +313,7 @@ local short_hasarg short_bool short_intlevel short_configfile short_arbitem local long_hasarg long_bool long_intlevel long_configfile long_arbitem + local bool_prefix short_hasarg=($short_hasarg) short_bool=($short_bool) short_intlevel=($short_intlevel) @@ -331,13 +324,14 @@ long_intlevel=($long_intlevel) long_configfile=($long_configfile) long_arbitem=($long_arbitem) + bool_prefix=($bool_prefix) local expl_opt expl_bool expl_configfile _description expl_opt option _description expl_bool 'bool value' _description expl_configfile 'config file' - local current_option tmp1 tmp2 + local current_option tmp1 tmp2 tmp3 ${funcname}_sm }" Index: Completion/User/_cvs =================================================================== RCS file: /projects/zsh/zsh/Completion/User/_cvs,v retrieving revision 1.1.1.10 diff -u -F^( -r1.1.1.10 _cvs --- _cvs 1999/09/09 14:10:17 1.1.1.10 +++ _cvs 1999/09/17 00:50:42 @@ -227,7 +227,7 @@ _cvs_history_x () { compset -P '*' - compadd "$@" -y '( + compadd "$@" -S '' -d '( F\ --\ release O\ --\ checkout E\ --\ export -- Tanaka Akira