From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17795 invoked from network); 21 Jan 2000 13:55:25 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jan 2000 13:55:25 -0000 Received: (qmail 20691 invoked by alias); 21 Jan 2000 13:55:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9403 Received: (qmail 20684 invoked from network); 21 Jan 2000 13:55:18 -0000 Date: Fri, 21 Jan 2000 14:55:16 +0100 (MET) Message-Id: <200001211355.OAA04991@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Alexandre Duret-Lutz's message of 20 Jan 2000 11:21:11 +0100 Subject: Re: completion after // Alexandre Duret-Lutz wrote: > I will try later not to rewrite PREFIX and SUFFIX but only the copies > of these used by _path_files. Then,_path_files should complete > as if there no sequence of slashes, but since the line won't be modified, > I suppose the braces won't move. May I suggest this simple solution? `squeeze-slashes' may be a bit of a misnomer with it, though. Bye Sven diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files --- ../z.old/Completion/Core/_path_files Fri Jan 21 14:40:49 2000 +++ Completion/Core/_path_files Fri Jan 21 14:50:20 2000 @@ -3,7 +3,7 @@ # Utility function for in-path completion. This allows `/u/l/b' # to complete to `/usr/local/bin'. -local linepath realpath donepath prepath testpath exppath +local linepath realpath donepath prepath testpath exppath skips local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre local pats haspats=no ignore group expl addpfx addsfx remsfx rem remt local nm=$compstate[nmatches] menu mspec matcher mopts atmp sort match @@ -157,13 +157,9 @@ fi fi -# Squeeze sequences of slashes -if zstyle -t ":completion${curcontext}:paths" squeeze-slashes -then - PREFIX="${PREFIX//(\\/)#//}" - SUFFIX="${SUFFIX//(\\/)#//}" - [[ $PREFIX = */ ]] && SUFFIX=${SUFFIX#/} -fi +# Skip over sequences of slashes. + +zstyle -t ":completion${curcontext}:paths" squeeze-slashes && skips=yes # We get the prefix and the suffix from the line and save the whole # original string. Then we see if we will do menucompletion. @@ -269,6 +265,14 @@ if [[ "$tpre" = (.|..)/* ]]; then tmp1=( ${^tmp1}${tpre%%/*}/ ) tpre="${tpre#*/}" + continue + fi + + # Skip over multiple slashes? + + if [[ -n "$skips" && "$tpre" = /* ]]; then + tmp1=( ${^tmp1}/ ) + tpre="${tpre#/}" continue fi diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo --- ../z.old/Doc/Zsh/compsys.yo Fri Jan 21 14:40:25 2000 +++ Doc/Zsh/compsys.yo Fri Jan 21 14:53:31 2000 @@ -1199,9 +1199,7 @@ ) item(tt(squeeze-slashes))( If set to `true', sequences of slashes (like in `tt(foo//bar)') will be -rewritten with a single slash (`tt(foo/bar)') when completing directory -names. Using this style can confuse tt(zsh) if slashes get squeezed -before braces completion (e.g. when trying to complete `tt(//{etc)'). +treated as if they were only one slash when completing pathnames. ) item(tt(stop))( If set to `true', the tt(_history_complete_word) bindable -- Sven Wischnowsky wischnow@informatik.hu-berlin.de