From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24663 invoked from network); 13 Jun 1997 00:41:16 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Jun 1997 00:41:16 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id UAA28253; Thu, 12 Jun 1997 20:33:05 -0400 (EDT) Resent-Date: Thu, 12 Jun 1997 20:31:48 -0400 (EDT) Message-ID: From: opk101@cs.york.ac.uk (Oliver P. Kiddle (3Y0)) Date: Fri, 13 Jun 1997 01:36:55 +0100 X-Mailer: Mail User's Shell (7.2.5 10/14/92 (ORBIT)) To: zsh-users@math.gatech.edu Subject: compctl for cd Resent-Message-ID: <"jnCTM2.0.jt6.pJ9ep"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/896 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I wonder if anyone could help me - I'm having a bit of trouble with completion for cd. I am trying to get it to work in the same way as tcsh (which I am currently converting from) but have come across a couple problems. Note: Under tcsh, I used: complete cd 'n/*/d/' I'm using zsh 3.0.1 Under tcsh, if I type cd [tab], It lists all directories except those starting with a dot but is still happy if I type cd .[tab] to complete directories starting with a dot and to list them. I tried to achieve this but the nearest I got was: compctl -g '*(-/)' -x 'S[.]' -g '*(D,-/)' -- cd mkdir rmdir This only matches with dot directories if the current word begins with a dot so for example, it is useless with bin/.something. I can't find a way of matching this properly (as */.[^/] if you understand that). As I experimented, I noticed a problem with the first expression in the completion: if from my home directory I did: cd b[tab] # No problem, expands to bin/ cd bin/[tab] # Now, all the files in bin aswell as directories are listed If you use: compctl -g '(*/)##' cd then it will list all directories recursively with their names relative to the current which is no use. Can anyone think of a solution (preferably without resorting to the use of functions)? What would be nice would be if there was an option similar to -g but which took all directories up to the last slash in the current word and performed the glob as if that was the current directory. While I'm e-mailing this list, I'll also point out in reference to the tilde expansion message recently sent by Wez that the manual contains a similar completion: compctl -Tx 'C[0,*/*]' -f - 's[~]' -k friends -S/ This applies the expansion across the line and not just to the command and seems to work better. Cheers Oliver Kiddle -- __ / \|. _ _ |_/. _| _|| _ E-mail: opk101@cs.york.ac.uk \__/||\/(-| | \|(_|(_||(- Web: http://www.york.ac.uk/~opk101/