From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2477 invoked from network); 5 Feb 2002 17:47:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Feb 2002 17:47:05 -0000 Received: (qmail 18266 invoked by alias); 5 Feb 2002 17:46:50 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4655 Received: (qmail 18254 invoked from network); 5 Feb 2002 17:46:49 -0000 From: "Bart Schaefer" Message-Id: <1020205174636.ZM29789@candle.brasslantern.com> Date: Tue, 5 Feb 2002 17:46:35 +0000 In-Reply-To: <3C60140C.6020006@davh.dk> Comments: In reply to Dennis Haney "Re: cd ..?" (Feb 5, 6:19pm) References: <20020129102017.E3A633FC1B@pluto.sonofthor.dk> <15446.30464.872842.207355@wischnow.berkom.de> <3C572BEB.2030001@davh.dk> <020129171248.ZM11938@candle.brasslantern.com> <3C60140C.6020006@davh.dk> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk, Dennis Haney Subject: Re: cd ..? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 5, 6:19pm, Dennis Haney wrote: } } Bart Schaefer wrote: } } >>Is there a way to make this work properly with setopt GLOB_DOTS? } > } >Just make the style more specific: } > } > zstyle ':completion:*:(cd|chdir|pushd|popd):*' special-dirs .. } > } How is that going to help me? Apparently I misunderstood the question. It'll help by making ".." not be completed for commands other than "cd" et al., which was the only way I could think of (at the time) that GLOB_DOTS could be involved. } >You might also check the documentation for the ignore-parents style. } > } ignore-parent works the wrong way... Aha. } It want to ignore '..' when it is a stupid choice. } eg. } mkdir Z } cd Z/[tab] } should NOT complete to 'cd Z/../' } (unless CHASE_DOTS is on and 'cd Z/..' will be different from 'cd .') This is a case where you need 'zstyle -e'. You want the special-dirs style to be non-empty only in certain circumstances. This completes `..' only if the prefix is either empty, or has a leading `.' and contains no slashes: zstyle -e ':completion:*' special-dirs \ '[[ $PREFIX = (|.[^/]#) ]] && reply=(..)' To find out that `Z/..' is not the same directory as `.' requires a bit of extra work, which I don't have time to do just now, but you can see how you'd just insert that into the conditions under which the reply array is set by the style. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net