From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26683 invoked from network); 29 Jul 1999 20:45:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jul 1999 20:45:20 -0000 Received: (qmail 3846 invoked by alias); 29 Jul 1999 20:45:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7318 Received: (qmail 3839 invoked from network); 29 Jul 1999 20:45:04 -0000 To: zsh-workers@sunsite.auc.dk Subject: PATCH: _cvs update. 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: 30 Jul 1999 05:45:02 +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) This is _cvs update. * more cvsignores for _cvsaddp. * _cvsaddp tries completion without cvsignores if there is no completion candidates. * cvs_roots is renamed to _cvs_roots and the definition is moved to toplevel. Also, its definition is now external command free. * some code beautification. --- Completion/User/_cvs- Thu Jul 29 03:00:57 1999 +++ Completion/User/_cvs Fri Jul 30 05:31:49 1999 @@ -142,23 +142,12 @@ return fi - case ${+cvs_roots} in - 0) - cvs_roots=() - if [[ -f ~/.cvspass ]]; then - cvs_roots=( - $(cut -d ' ' -f 1 ~/.cvspass) - ) - fi - ;; - esac - _complete_opts \ H '' Q '' q '' r '' w '' l '' n '' t '' v '' f '' a '' \ b: "compadd /usr/local/bin" \ T: "compadd $TMPPREFIX:h $TMPDIR /tmp" \ e: "compadd vi" \ - d: "compadd $cvs_roots || _files -/" \ + d: "compadd $_cvs_roots || _files -/" \ z: "compadd 9'" \ s: "_cvs_user_variable" \ || @@ -198,7 +187,7 @@ _cvsdirentries () { setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then - entries=( ${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*} ) + entries=(${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*}) else entries=() fi @@ -207,7 +196,7 @@ _cvsentries () { setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then - entries=( ${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*} ) + entries=(${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*}) else entries=() fi @@ -233,8 +222,8 @@ local LANG=C local OLDTZ="$TZ"; if ! (( $+TZ )); then unset OLDTZ; fi; export TZ=GMT - mtime=( ${(s:/:)${(j:/:)${${${${(M)${(f)Entries}:#/*}#/}%/*/*}/\\/*\\///}}} ) - entries=( ${${${(M)${(f)Entries}:#D/*}#D/}%%/*} ) + mtime=(${(s:/:)${(j:/:)${${${${(M)${(f)Entries}:#/*}#/}%/*/*}/\\/*\\///}}}) + entries=(${${${(M)${(f)Entries}:#D/*}#D/}%%/*}) builtin stat -n +mtime -F '%a %b %e %T %Y' "$pref${(@k)^mtime}" | while read line do @@ -297,8 +286,8 @@ _cvsentries setopt localoptions unset local omit - omit=( ${pref}*(D:t) ) - eval 'entries=( ${entries:#('${(j:|:)omit:q}')} )' + omit=(${pref}*(D:t)) + eval 'entries=(${entries:#('${(j:|:)omit:q}')})' compadd -P "$qpref" - ${entries:q} || _cvsdirs else @@ -313,14 +302,32 @@ _cvsentries setopt localoptions unset local omit - omit=( CVS ${entries:q} ${=cvsignore} ) - [[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) ) - [[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) ) + omit=($_cvs_ignore_default ${entries:q} ${=cvsignore}) + [[ -r ~/.cvsignore ]] && omit=($omit $(<~/.cvsignore)) + [[ -r ${pref}.cvsignore ]] && omit=($omit $(<${pref}.cvsignore)) compgen -g '*~(*/|)('${(j:|:)omit}')(D)' || - { _cvsdirentries; compgen -g '('${(j:|:)entries:q}')(D)' } + compgen -g '*~(*/|)('${(j:|:)entries:q}')(D)' || + _cvsdirs else _files fi } + +if (( ! $+_cvs_ignore_default )); then + _cvs_ignore_default=( + RCS SCCS CVS CVS.adm RCSLOG 'cvslog.*' tags TAGS .make.state .nse_depinfo + '*\~' '\#*' '.\#*' ',*' '_$*' '*$' '*.old' '*.bak' '*.BAK' '*.orig' '*.rej' + '.del-*' '*.a' '*.olb' '*.o' '*.obj' '*.so' '*.exe' '*.Z' '*.elc' '*.ln' + core + ) +fi + +if (( ! $+_cvs_roots )); then + if [[ -f ~/.cvspass ]]; then + _cvs_roots=(${${(f)"$(<~/.cvspass)"}%% *}) + else + _cvs_roots=() + fi +fi _cvs "$@" -- Tanaka Akira