head	2.1;
access;
symbols
	3_0_1:2.1
	3_0_0:2.0
	3_0-pre6:2.0
	3_0-pre5:2.0
	3_0-pre4:2.0
	beta15:1.3
	beta14:1.3
	beta13:1.3
	beta12:1.3
	beta11:1.3
	beta10:1.3
	3_0-pre3:2.0
	3_0-pre2:2.0
	3_0-pre1:2.0
	beta21:2.0
	beta20:2.0
	beta19:2.0
	beta18:2.0
	beta17:2.0
	beta16:2.0;
locks;
comment	@# @;


2.1
date	96.10.06.12.21.08;	author hzoli;	state Exp;
branches;
next	2.0;

2.0
date	96.05.02.22.57.04;	author hzoli;	state Exp;
branches;
next	1.3;

1.3
date	95.02.28.04.55.35;	author coleman;	state Exp;
branches;
next	1.2;

1.2
date	95.02.10.02.00.18;	author coleman;	state Exp;
branches;
next	1.1;

1.1
date	94.11.08.07.01.18;	author zsh;	state Exp;
branches;
next	;


desc
@@


2.1
log
@add emulate -R zsh to some function examples.  From Bart (2172)
@
text
@# Start of cdmatch.
# Save in your functions directory and autoload, then do
# compctl -x 'S[/][~][./][../]' -g '*(-/)' - \
#         'n[-1,/], s[]' -K cdmatch -S '/' -- cd pushd
#
# Completes directories for cd, pushd, ... anything which knows about cdpath.
# You do not have to include `.' in your cdpath.
#
# It works properly only if $ZSH_VERSION > 3.0-pre4.  Remove `emulate -R zsh'
# for all other values of $ZSH_VERSION > 2.6-beta2. For earlier versions
# it still works if RC_EXPAND_PARAM is not set or when cdpath is empty.
emulate -R zsh
setopt localoptions
local narg pref cdp

read -nc narg
read -Ac pref

cdp=(. $cdpath)
reply=( ${^cdp}/${pref[$narg]%$2}*$2(-/DN^M:t:gs/ /\\\\ /) )

return
# End of cdmatch.
@


2.0
log
@New maintainer: Zoltn Hidvgi <hzoli@@cs.elte.hu>
@
text
@d9 2
a10 1
# It works properly only if $ZSH_VERSION > 2.6-beta2. For erarlier versions
d12 2
a13 1

@


1.3
log
@*** empty log message ***
@
text
@@


1.2
log
@*** empty log message ***
@
text
@d3 2
a4 4
#   compctl -K cdmatch -S '/' cd pushd
# or if you prefer
#   compctl -K cdmatch -S '/' -x 'S[/][~][./][../]' -g '*(-/)' -- cd pushd
# (to use ordinary globbing for absolute paths).
d7 4
a10 5
# Note that . is NOT automatically included.  It's up to you to put it in
# cdpath somewhere.

local dir nword args pref
setopt localoptions nullglob globdots
d12 1
a12 3
read -nc nword
read -Ac args
pref=$args[$nword]
d14 2
a15 4
if [[ $pref[1] = [/\~] ]]; then
  eval "reply=($pref*(-/))"
else
  reply=()
d17 2
a18 5
  for dir in $cdpath
  do
    eval "reply=(\$reply $dir/$pref*(-/:s,$dir/,,:gs/ /\\\\\\\\ /))"
  done
fi
@


1.1
log
@Initial revision
@
text
@d12 2
a13 5
local dir nword args pref ngtrue gdtrue

[[ -o nullglob ]] && ngtrue=1
[[ -o globdots ]] && gdtrue=1
setopt nullglob globdots
a28 3

[[ $ngtrue = 1 ]] || unsetopt nullglob
[[ $gdtrue = 1 ]] || unsetopt globdots
@
