From: Andrej Borsenkow <borsenkow.msk@sni.de>
To: Zsh workers mailing list <zsh-workers@math.gatech.edu>
Subject: ZSH 3.0.5 breaks script
Date: Tue, 30 Sep 1997 16:28:36 +0400 (MSD) [thread overview]
Message-ID: <Pine.SV4.3.95.970930162145.22229B-100000@itsrm1> (raw)
Hi!
I installed 3.0.5, and since then my script for cd completion doesn't
work. I wrote it long ago (pre 3.x.x) and never changed since then (I
know, it could look better ... ;)
Currently I get:
bor@itsmx1:~%> cdTAB
bor@itsmx1:~%> cd ${temp_reply}/
instead of listing choices.
setopt gives:
autoparamslash
autoremoveslash
nobanghist
nobeep
extendedglob
histignoredups
ignoreeof
interactive
nolistbeep
listtypes
login
magicequalsubst
menucomplete
monitor
nonomatch
numericglobsort
shinstdin
zle
compctl for cd is:
cd -qUQ -K multi_cd_comp -S /
where multi_cd_comp is
local pref head sofar origtop newtop globdir="(-/)" wild cdpath_dirs i origpref temp_reply
setopt localoptions nullglob rcexpandparam globdots
unsetopt markdirs globsubst shwordsplit
pref="${1}$2"
# Hack to allow programmable completion to select multicomp after a :
# (e.g.
# compctl -D -f -x 's[:]' -U -K multicomp
# )
pref="${pref#:}"
origpref="${pref}"
if [[ "$pref" == [/\~]* ]]; then
cdpath_dirs=('')
else
cdpath_dirs=("${cdpath[@]:-''}")
fi
reply=()
temp_reply=('')
for i in "${cdpath_dirs[@]}"; do
sofar=('')
origtop=""
if [[ -n "${i}" ]]; then
pref=${i}/${origpref}
else
pref=${origpref}
fi
if [[ "$pref" = \~* ]]; then
# If the string started with ~, save the head and what it will become.
origtop="${pref%%/*}"
newtop=${~origtop}
# Save the expansion as the bit matched already
sofar=($newtop)
pref="${pref#$origtop}"
fi
while [[ -n "$pref" ]]; do
[[ "$pref" = /* ]] && sofar=(${sofar}/) && pref="${pref#/}"
head="${pref%%/*}"
pref="${pref#$head}"
if [[ -n "$pref" && -z $sofar[2] && -d "${sofar}$head" ]]; then
# Exactly matched directory: don't try to glob
temp_reply=("${sofar}$head")
else
# if path segment contains wildcards, don't add another.
if [[ "$head" = *[\*\?]* ]]; then
wild=
else
wild='*'
fi
temp_reply=(${sofar}"${head}${wild}${globdir}")
temp_reply=(${~temp_reply})
fi
[[ -z $temp_reply[1] ]] && temp_reply=() && break
[[ -n $pref ]] && sofar=($temp_reply)
done
# Restore ~'s in front if there were any.
# There had better not be anything funny in $newtop.
[[ -n "${i}" ]] && temp_reply=(${temp_reply#${i}/})
if [[ -n "$origtop" ]]; then
reply=(${reply} "$origtop"${temp_reply#$newtop})
else
reply=(${reply} ${temp_reply})
fi
done
What's wrong?
-------------------------------------------------------------------------
Andrej Borsenkow Fax: +7 (095) 252 01 05
SNI ITS Moscow Tel: +7 (095) 252 13 88
NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de
-------------------------------------------------------------------------
next reply other threads:[~1997-09-30 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-30 12:28 Andrej Borsenkow [this message]
1997-09-30 15:13 ` BUG in rcexpandparam? (was: ZSH 3.0.5 breaks script) Andrej Borsenkow
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=Pine.SV4.3.95.970930162145.22229B-100000@itsrm1 \
--to=borsenkow.msk@sni.de \
--cc=zsh-workers@math.gatech.edu \
/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).