From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3651 invoked from network); 26 Jul 1999 16:26:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Jul 1999 16:26:20 -0000 Received: (qmail 20137 invoked by alias); 26 Jul 1999 16:26:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7282 Received: (qmail 20130 invoked from network); 26 Jul 1999 16:26:11 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: CVS completer (Re: PATCH: Re: Completion/User functions again) References: <199907211127.NAA02895@beta.informatik.hu-berlin.de> <990721155446.ZM6856@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 01:26:04 +0900 In-Reply-To: Tanaka Akira's message of "26 Jul 1999 13:48:53 +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: > This refines it. I found the problem with: cvs diff ~/xxx/ I also tried to complete only modified files for commit and diff. Since this use stat module, it does not works without dynamic loading by default. --- Completion/User/_cvs- Mon Jul 26 23:42:23 1999 +++ Completion/User/_cvs Tue Jul 27 00:48:42 1999 @@ -37,10 +37,10 @@ _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || _cvsrepositories ;; commit|ci|com) # "+nlRm:fF:r:" - _complete_opts n '' l '' R '' m: "$complete_m" f '' F: '' r: "$complete_r" || _cvstargets + _complete_opts n '' l '' R '' m: "$complete_m" f '' F: '' r: "$complete_r" || _cvstargets_modified ;; diff|di|dif) # "+abcdefhilnpstuw0123456789BHNRC:D:F:I:L:U:V:W:k:r:" - _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || _cvstargets + _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || _cvstargets_modified || _cvstargets ;; edit) # "+lRa:" _complete_opts l '' R '' a: '' || _cvstargets --- Completion/User/_cvsaddp- Mon Jul 26 23:42:24 1999 +++ Completion/User/_cvsaddp Tue Jul 27 01:03:00 1999 @@ -1,6 +1,6 @@ #autoload -local pref entries +local qpref pref entries _cvsprefix _cvsentries setopt localoptions unset @@ -9,5 +9,5 @@ omit=( $entries ${=cvsignore} ) [[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) ) [[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) ) -eval 'compadd -fp "$pref" - ${all:#('${(j:|:)omit}')}' || - compadd -fp "$pref" - ${pref}*~${pref}CVS(/:t) +eval 'compadd -fp "$qpref" -W "$pref" - ${all:#('${(j:|:)omit}')}' || + compadd -fp "$qpref" -W "$pref" - ${pref}*~${pref}CVS(/:t) --- /dev/null Mon Jul 26 23:54:18 1999 +++ Completion/User/_cvsentries_modified Tue Jul 27 01:06:39 1999 @@ -0,0 +1,31 @@ +#autoload + +local LANG=C +local OLDTZ="$TZ"; if ! (( $+TZ )); then unset OLDTZ; fi; export TZ=GMT + +local line Entries +typeset -A mtime + +if ! zmodload -e stat; then zmodload stat; fi +if zmodload -e stat; then + if [[ -f "${pref}CVS/Entries" ]]; then + Entries="$(<${pref}CVS/Entries)" + 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 + line=${line#$pref} + if [[ x"$mtime[${line%% *}]" == x"${line#* }" ]]; then + #print up-to-date "${line%% *}" + else + #print locally-modified "${line%% *}" + entries=($entries "${line%% *}") + fi + done + fi +else + entries=( "${(@)${(@)${(@)${(f@)Entries}:#D}#(D|)/}%%/*}" ) +fi + +if (( $+OLDTZ )); then TZ="$OLDTZ"; else unset TZ; fi --- Completion/User/_cvsprefix- Mon Jul 26 23:42:24 1999 +++ Completion/User/_cvsprefix Tue Jul 27 01:00:36 1999 @@ -1,16 +1,18 @@ #autoload local f -pref=$PREFIX -if [[ $pref != */ ]]; then - if [[ $pref = */* ]]; then - pref=$pref:h +qpref=$PREFIX +if [[ $qpref != */ ]]; then + if [[ $qpref = */* ]]; then + qpref=$qpref:h else - pref= + qpref= fi fi +pref=$~qpref if [[ ! -d "$pref" ]]; then + qpref= pref= fi -[[ -n "$pref" && "$pref" != */ ]] && pref=$pref/ +[[ -n "$pref" && "$pref" != */ ]] && qpref=$qpref/ pref=$pref/ --- Completion/User/_cvsremovep- Mon Jul 26 23:42:24 1999 +++ Completion/User/_cvsremovep Tue Jul 27 01:03:06 1999 @@ -1,11 +1,11 @@ #autoload -local pref entries +local qpref pref entries _cvsprefix _cvsentries setopt localoptions unset local omit omit=( ${pref}*(D:t) ) -eval 'compadd -fp "$pref" - ${entries:#('${(j:|:)omit}')}' || - compadd -fp "$pref" - ${pref}*~${pref}CVS(/:t) +eval 'compadd -fp "$qpref" -W "$pref" - ${entries:#('${(j:|:)omit}')}' || + compadd -fp "$qpref" -W "$pref" - ${pref}*~${pref}CVS(/:t) --- Completion/User/_cvstargets- Mon Jul 26 23:42:24 1999 +++ Completion/User/_cvstargets Tue Jul 27 01:02:21 1999 @@ -1,7 +1,7 @@ #autoload -local pref entries +local qpref pref entries _cvsprefix _cvsentries -compadd -fp "$pref" - $entries +compadd -fP "$qpref" -W "$pref" - $entries --- /dev/null Mon Jul 26 23:54:18 1999 +++ Completion/User/_cvstargets_modified Tue Jul 27 01:03:10 1999 @@ -0,0 +1,7 @@ +#autoload + +local qpref pref entries +_cvsprefix +_cvsentries_modified + +compadd -fp "$qpref" -W "$pref" - $entries -- Tanaka Akira