From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
Date: 27 Jul 1999 19:07:10 +0900 [thread overview]
Message-ID: <rsqd7xexv75.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Tue, 27 Jul 1999 07:48:04 +0000"
In article <990727074804.ZM25420@candle.brasslantern.com>,
"Bart Schaefer" <schaefer@candle.brasslantern.com> 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
next prev parent reply other threads:[~1999-07-27 10:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-21 11:27 Sven Wischnowsky
1999-07-21 12:35 ` Tanaka Akira
1999-07-21 15:43 ` Tanaka Akira
1999-07-21 15:54 ` Bart Schaefer
1999-07-25 9:23 ` Tanaka Akira
1999-07-25 11:38 ` Tanaka Akira
1999-07-26 4:48 ` Tanaka Akira
1999-07-26 16:26 ` Tanaka Akira
1999-07-26 17:10 ` Tanaka Akira
1999-07-27 7:48 ` PATCH: " Bart Schaefer
1999-07-27 8:12 ` Peter Stephenson
1999-07-27 10:07 ` Tanaka Akira [this message]
1999-07-27 11:45 ` Tanaka Akira
1999-07-27 13:49 ` Bart Schaefer
1999-07-27 13:58 ` Tanaka Akira
1999-07-27 14:11 ` Tanaka Akira
1999-07-28 16:05 ` Tanaka Akira
1999-07-27 8:15 ` Peter Stephenson
1999-07-27 8:58 ` Tanaka Akira
1999-08-02 9:47 PATCH: " Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=rsqd7xexv75.fsf@crane.jaist.ac.jp \
--to=akr@jaist.ac.jp \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).