From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22318 invoked from network); 21 Jan 2000 18:12:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jan 2000 18:12:05 -0000 Received: (qmail 13330 invoked by alias); 21 Jan 2000 18:11:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9404 Received: (qmail 13323 invoked from network); 21 Jan 2000 18:11:51 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: completion after ../ References: <200001211339.OAA04917@beta.informatik.hu-berlin.de> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 22 Jan 2000 03:11:48 +0900 In-Reply-To: Sven Wischnowsky's message of "Fri, 21 Jan 2000 14:39:14 +0100 (MET)" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <200001211339.OAA04917@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > Let's try it... I tried it but it doesn't work for me even after one typo fix. Z:akr@is27e1u11% Src/zsh -f is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst is27e1u11% mkdir -p tstdir/{foo,bar} is27e1u11% cd tstdir is27e1u11% ls bar foo is27e1u11% zstyle '*' ignore-parents parent is27e1u11% ls foo/../ bar/ foo/ `foo/' shouldn't be listed, I think. set -x says (after the patch in this message is applied): is27e1u11% ls foo/../ ... +_description:33> zstyle -a :completion:complete::ls::files ignored-patterns _comp_ignore +_description:36> _comp_ignore=( ) ... +_path_files:344> compadd -D tmp1 -F _comp_ignore - bar foo ... +_path_files:308> zstyle -s :completion:complete::ls::files ignore-parents rem ... +_path_files:320> _comp_ignore=( foo/../foo ) ... +_path_files:474> compadd -Qf -p foo/../ -W foo/../ -M r:|/=* r:|=* -J -default- - bar foo ... The updated _comp_ignore is not used. > Note however, that there is no automatic switching to list-only and no > way to get at the ignored directories on a second TAB or something > like this. The ignored names are put in the alternate set so that one > gets them if no other names match. > > > I think what sometimes irritated me can be fixed with `pwd' or maybe > `pwd ..' and Tanaka's with `parent' or `parent ..'. I hope. Hm. It's not enough for me. Sometimes I hit after a path which contains only one directory. Suppose zsh-3.1.6-dev-15 is installed in its own prefix /app/zsh-3.1.6-dev-15 and the current working directory is /app/zsh-3.1.6-dev-15/share/zsh/3.1.6-dev-15/functions. When completion is tried as `cd ../../../', the alternative set has only one entry `zsh' and non-alternative set is empty if I understand the style correctly and it works well. So zsh completes the line as `cd ../../../zsh/'. But it frustrates me because I must remove `zsh/' before adding `../'. I hope a style to automatic switching to list-only. Although I tried to do it, I couldn't find a way. Index: Completion/Core/_path_files =================================================================== RCS file: /projects/zsh/zsh/Completion/Core/_path_files,v retrieving revision 1.1.1.61 diff -u -r1.1.1.61 _path_files --- Completion/Core/_path_files 2000/01/21 16:33:49 1.1.1.61 +++ Completion/Core/_path_files 2000/01/21 17:28:33 @@ -311,7 +311,7 @@ if [[ "$rem" = *parent* ]]; then for i in "$tmp2[@]"; do if [[ -d "$i" && "$i" = */* ]]; then - remt="${i/*}" + remt="${i%/*}" while [[ "$remt" = */* ]]; do [[ "$remt" -ef "$i" ]] && break remt="${remt%/*}" -- Tanaka Akira