Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
- X-seq: zsh-workers 7279
- From: Tanaka Akira <akr@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
- Date: 26 Jul 1999 13:48:53 +0900
- In-reply-to: Tanaka Akira's message of "25 Jul 1999 18:23:00 +0900"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <199907211127.NAA02895@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <990721155446.ZM6856@xxxxxxxxxxxxxxxxxxxxxxx> <rsqvhb9ulqj.fsf@xxxxxxxxxxxxxxxxx>
In article <rsqvhb9ulqj.fsf@xxxxxxxxxxxxxxxxx>,
Tanaka Akira <akr@xxxxxxxxxxx> writes:
> Most of codes to handle CVS/* are taken from Misc/compctl-examples.
This refines it.
--- Completion/User/_cvsaddp- Mon Jul 26 13:43:26 1999
+++ Completion/User/_cvsaddp Mon Jul 26 13:43:42 1999
@@ -5,8 +5,9 @@
_cvsentries
setopt localoptions unset
local all omit
-all=( ${pref}*(D) )
-omit=( $entries ${pref}${^${=cvsignore}} )
-[[ -r ~/.cvsignore ]] && omit=( $omit ${pref}${^$(<~/.cvsignore)} )
-[[ -r ${pref}.cvsignore ]] && omit=( $omit ${pref}${^$(<${pref}.cvsignore)} )
-eval 'compadd - ${all:#('${(j:|:)omit}')}'
+all=( ${pref}*~${pref}CVS(D:t) )
+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)
--- Completion/User/_cvsentries- Mon Jul 26 13:43:26 1999
+++ Completion/User/_cvsentries Mon Jul 26 13:43:42 1999
@@ -2,6 +2,6 @@
setopt localoptions nullglob unset
if [[ -f ${pref}CVS/Entries ]]; then
- entries=( "${pref}${(@)^${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" )
+ entries=( "${(@)${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D}#(D|)/}%%/*}" )
fi
--- Completion/User/_cvsprefix- Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvsprefix Mon Jul 26 13:43:42 1999
@@ -2,10 +2,15 @@
local f
pref=$PREFIX
-if [[ -d $pref:h && ! -d $pref ]]; then
+if [[ $pref != */ ]]; then
+ if [[ $pref = */* ]]; then
pref=$pref:h
-elif [[ $pref != */* ]]; then
+ else
pref=
+ fi
+fi
+if [[ ! -d "$pref" ]]; then
+ pref=
fi
[[ -n "$pref" && "$pref" != */ ]] && pref=$pref/
--- Completion/User/_cvsremovep- Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvsremovep Mon Jul 26 13:43:42 1999
@@ -5,5 +5,7 @@
_cvsentries
setopt localoptions unset
local omit
-omit=( ${pref}*(D) )
-eval 'compadd - ${entries:#('${(j:|:)omit}')}'
+omit=( ${pref}*(D:t) )
+eval 'compadd -fp "$pref" - ${entries:#('${(j:|:)omit}')}' ||
+ compadd -fp "$pref" - ${pref}*~${pref}CVS(/:t)
+
--- Completion/User/_cvstargets- Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvstargets Mon Jul 26 13:43:42 1999
@@ -4,6 +4,4 @@
_cvsprefix
_cvsentries
-compadd - $entries
-
-compgen -g "^CVS(/)"
+compadd -fp "$pref" - $entries
--
Tanaka Akira
Messages sorted by:
Reverse Date,
Date,
Thread,
Author