From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14604 invoked from network); 27 Jul 1999 11:45:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jul 1999 11:45:56 -0000 Received: (qmail 12160 invoked by alias); 27 Jul 1999 11:45:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7293 Received: (qmail 12152 invoked from network); 27 Jul 1999 11:45:33 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: CVS completer (Re: PATCH: Re: Completion/User functions again) References: <199907211127.NAA02895@beta.informatik.hu-berlin.de> <990721155446.ZM6856@candle.brasslantern.com> <990727074804.ZM25420@candle.brasslantern.com> 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: 27 Jul 1999 20:45:04 +0900 In-Reply-To: Tanaka Akira's message of "27 Jul 1999 19:07:10 +0900" 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 , Tanaka Akira writes: > Although _cvsremovep has same problem too, this fix is not applicable > because compgen -g does not generate nonexisting filenames. > > Any ideas? Hm. compset -P is bit dangerous for quoted characters. is27e1u11% autoload -U compinit; compinit -D is27e1u11% _tst () { compset -P '*/'; compadd tst } is27e1u11% compdef _tst tst is27e1u11% tst \#/ Then, I get: is27e1u11% tst \\\#/tst So, I removed compset -P from _cvs. --- Completion/User/_cvs Tue Jul 27 19:08:44 1999 +++ Completion/User/_cvs Tue Jul 27 20:44:07 1999 @@ -196,6 +196,8 @@ setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then entries=( ${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*} ) + else + entries=() fi } @@ -203,6 +205,8 @@ setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then entries=( ${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*} ) + else + entries=() fi } @@ -213,6 +217,7 @@ return fi + entries=() local line Entries typeset -A mtime @@ -242,52 +247,59 @@ _cvsdirs () { if [[ -d ${pref}CVS ]]; then _cvsdirentries - compadd -fW "$pref" - $entries + if (( $#entries )); then + compgen "$@" -g '('${(j:|:)entries:q}')' + fi else - _files -W "$pref" + _files fi } _cvstargets () { local qpref pref entries - _cvsprefix; compset -P '*/' + _cvsprefix if [[ -d ${pref}CVS ]]; then _cvsentries - compgen -W "$pref" -g "(${(j:|:)entries})" + if (( $#entries )); then + compgen -g '('${(j:|:)entries:q}')' + fi else - _files -W "$pref" + _files fi } _cvstargets_modified () { local qpref pref entries - _cvsprefix; compset -P '*/' + _cvsprefix if [[ -d ${pref}CVS ]]; then _cvsentries_modified - compgen -W "$pref" -g "(${(j:|:)entries})" + if (( $#entries )); then + compgen -g '('${(j:|:)entries:q}')' + fi else - _files -W "$pref" + _files fi } _cvsremovep () { local qpref pref entries - _cvsprefix; compset -P '*/' + _cvsprefix if [[ -d ${pref}CVS ]]; then _cvsentries setopt localoptions unset local omit omit=( ${pref}*(D:t) ) - eval 'compadd -fW "$pref" - ${entries:#('${(j:|:)omit}')}' || + eval 'entries=( ${entries:#('${(j:|:)omit:q}')} )' + compadd -P "$qpref" - ${entries:q} || _cvsdirs else - _files -W "$pref" + _files fi } _cvsaddp () { local qpref pref entries - _cvsprefix; compset -P '*/' + _cvsprefix if [[ -d ${pref}CVS ]]; then _cvsentries setopt localoptions unset @@ -296,10 +308,10 @@ omit=( CVS $entries ${=cvsignore} ) [[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) ) [[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) ) - compgen -W "$pref" -g "*~*/(${(j:|:)omit})" || - _cvsdirs + compgen -g '*~(*/|)('${(j:|:)omit:q}')' || + { _cvsdirentries; compgen -g '('${(j:|:)entries:q}')' } else - _files -W "$pref" + _files fi } -- Tanaka Akira