From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 887 invoked from network); 25 May 2000 12:00:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 May 2000 12:00:36 -0000 Received: (qmail 3215 invoked by alias); 25 May 2000 12:00:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11570 Received: (qmail 3207 invoked from network); 25 May 2000 12:00:18 -0000 Date: Thu, 25 May 2000 14:00:11 +0200 (MET DST) Message-Id: <200005251200.OAA02522@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk CC: Andy Spiegl In-reply-to: Andy Spiegl's message of Thu, 25 May 2000 12:46:44 +0200 Subject: PATCH: Re: dev-19 -> 20: special-dirs changed? [ moved to zsh-workers ] Andy Spiegl wrote: > Bart Schaefer wrote: > > _path_files now recognizes special-dirs only when one of -f or -/ is used. > > The doc says that -f means "complete all files." However, _files always > > calls `_path_files -g ...' so there's no way to get special-dirs to be > > recognized for default file completions. > > > > This is presumably a bug, but whether it's a bug in _path_files or _files > > I don't know. > > Hm, haven't heard anything about this issue since. Did it make it onto > the bug list? I still find it pretty annoying that completion doesn't > work in these cases. :-( > > I investigated a little more: > Here are cases where no slash is appended after hitting TAB: > cd bar/.. > mv foo .. > mv foo ../bar/.. > ls .. > ls ../bar/.. Oops, indeed. Seems like I forgot to fix that, sorry. Bye Sven Index: Completion/Core/_path_files =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v retrieving revision 1.14 diff -u -r1.14 _path_files --- Completion/Core/_path_files 2000/05/16 11:24:55 1.14 +++ Completion/Core/_path_files 2000/05/25 11:59:42 @@ -142,6 +142,9 @@ zstyle -s ":completion:${curcontext}:paths" special-dirs sdirs && [[ "$sdirs" = (yes|true|on|1) ]] && sdirs=yes +[[ "$pats" = ((|*[[:blank:]])\*(|[[:blank:]]*)|*\([^[:blank:]]#/[^[:blank:]]#\)*) ]] && + sopt=$sopt/ + zstyle -s ":completion:${curcontext}:files" ignore-parents ignpar # We get the prefix and the suffix from the line and save the whole @@ -293,9 +296,9 @@ fi if [[ -n "$sdirs" && ( -o globdots || "$PREFIX" = .* ) ]]; then if [[ "$sdirs" = yes ]]; then - tmp1=( "$tmp1[@]" . .. ) + tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} ) elif [[ "$sdirs" = .. ]]; then - tmp1=( "$tmp1[@]" .. ) + tmp1=( "$tmp1[@]" $^tmp2${skipped}.. ) fi fi else @@ -304,13 +307,12 @@ else tmp1=( ${^tmp1}${skipped}${^~pats} ) fi - if [[ -n "$sdirs" && - ( "$sopt" = *[/f]* || "$pats" = *\([^[:blank:]]#/[^[:blank:]]#\)* ) && + if [[ -n "$sdirs" && "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]]; then if [[ "$sdirs" = yes ]]; then - tmp1=( "$tmp1[@]" . .. ) + tmp1=( "$tmp1[@]" $^tmp2${skipped}{.,..} ) elif [[ "$sdirs" = .. ]]; then - tmp1=( "$tmp1[@]" .. ) + tmp1=( "$tmp1[@]" $^tmp2${skipped}.. ) fi fi fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de