Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
- X-seq: zsh-workers 7292
- From: Tanaka Akira <akr@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
- Date: 27 Jul 1999 19:07:10 +0900
- In-reply-to: "Bart Schaefer"'s message of "Tue, 27 Jul 1999 07:48:04 +0000"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <199907211127.NAA02895@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <990721155446.ZM6856@xxxxxxxxxxxxxxxxxxxxxxx> <rsqvhb9ulqj.fsf@xxxxxxxxxxxxxxxxx> <rsqpv1g2eyy.fsf@xxxxxxxxxxxxxxxxx> <rsq4sirs7hf.fsf@xxxxxxxxxxxxxxxxx> <rsq1zdvs5fz.fsf@xxxxxxxxxxxxxxxxx> <990727074804.ZM25420@xxxxxxxxxxxxxxxxxxxxxxx>
In article <990727074804.ZM25420@xxxxxxxxxxxxxxxxxxxxxxx>,
"Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> zsh% cvs add <C-d>
> F#bar F#baz
> zsh% cvs add <TAB>
> zsh% cvs add F\#<TAB>
> (BEEP)
> zsh% cvs add F\#<C-d>
> (BEEP)
> zsh% cvs add F\#<C-b><DEL><C-e>
> zsh% cvs add F#<C-d>
> F#bar F#baz
> zsh% cvs add F#<TAB>
> zsh% cvs add F\#
I tried to fix this problem by using compgen -g instead of compadd for
_cvsaddp, _cvstargets and _cvstargets_modified.
Although _cvsremovep has same problem too, this fix is not applicable
because compgen -g does not generate nonexisting filenames.
Any ideas?
--- Completion/User/_cvs Tue Jul 27 18:16:28 1999
+++ /home/fs114/akr/arch/sunos5/usr/local/share/zsh/functions/_cvs Tue Jul 27 19:01:03 1999
@@ -182,22 +182,14 @@
}
_cvsprefix () {
- local f
- qpref=$PREFIX
- if [[ $qpref != */ ]]; then
- if [[ $qpref = */* ]]; then
- qpref=$qpref:h
- else
- qpref=
- fi
- fi
- pref=$~qpref
- if [[ ! -d "$pref" ]]; then
+ #if [[ -prefix */ ]]; then
+ if [[ x"$PREFIX" == x*/* ]]; then
+ qpref="${PREFIX%/*}/"
+ pref=$~qpref
+ else
qpref=
- pref=
+ pref=./
fi
- [[ -n "$pref" && "$pref" != */ ]] && qpref=$qpref/ pref=$pref/
- [[ -z "$pref" ]] && pref=./
}
_cvsdirentries () {
@@ -248,56 +240,54 @@
}
_cvsdirs () {
- local qpref pref entries
- _cvsprefix
if [[ -d ${pref}CVS ]]; then
_cvsdirentries
- compadd -fP "$qpref" -W "$pref" - $entries
+ compadd -fW "$pref" - $entries
else
- _files
+ _files -W "$pref"
fi
}
_cvstargets () {
local qpref pref entries
- _cvsprefix
+ _cvsprefix; compset -P '*/'
if [[ -d ${pref}CVS ]]; then
_cvsentries
- compadd -fP "$qpref" -W "$pref" - $entries
+ compgen -W "$pref" -g "(${(j:|:)entries})"
else
- _files
+ _files -W "$pref"
fi
}
_cvstargets_modified () {
local qpref pref entries
- _cvsprefix
+ _cvsprefix; compset -P '*/'
if [[ -d ${pref}CVS ]]; then
_cvsentries_modified
- compadd -fP "$qpref" -W "$pref" - $entries
+ compgen -W "$pref" -g "(${(j:|:)entries})"
else
- _files
+ _files -W "$pref"
fi
}
_cvsremovep () {
local qpref pref entries
- _cvsprefix
+ _cvsprefix; compset -P '*/'
if [[ -d ${pref}CVS ]]; then
_cvsentries
setopt localoptions unset
local omit
omit=( ${pref}*(D:t) )
- eval 'compadd -fP "$qpref" -W "$pref" - ${entries:#('${(j:|:)omit}')}' ||
+ eval 'compadd -fW "$pref" - ${entries:#('${(j:|:)omit}')}' ||
_cvsdirs
else
- _files
+ _files -W "$pref"
fi
}
_cvsaddp () {
local qpref pref entries
- _cvsprefix
+ _cvsprefix; compset -P '*/'
if [[ -d ${pref}CVS ]]; then
_cvsentries
setopt localoptions unset
@@ -306,10 +296,10 @@
omit=( CVS $entries ${=cvsignore} )
[[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) )
[[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) )
- compgen -P "$qpref" -W "$pref" -g "*~*/(${(j:|:)omit})" ||
+ compgen -W "$pref" -g "*~*/(${(j:|:)omit})" ||
_cvsdirs
else
- _files
+ _files -W "$pref"
fi
}
--
Tanaka Akira
Messages sorted by:
Reverse Date,
Date,
Thread,
Author