From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1660 invoked from network); 27 Jan 1998 22:55:39 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 27 Jan 1998 22:55:39 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id RAA11665; Tue, 27 Jan 1998 17:46:13 -0500 (EST) Resent-Date: Tue, 27 Jan 1998 17:44:09 -0500 (EST) Date: Tue, 27 Jan 1998 23:45:38 +0100 (MET) From: Wessel Dankers X-Sender: wsl@anx1p13.cc.ruu.nl Reply-To: Wessel Dankers To: Zsh users mailing list Subject: Completion on cd Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"AFhuE3.0.1r2.uCcpq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1283 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi! Exploring compctl, I wanted to do completion on cd. So I used the obvious command: compctl -g '*(-/)' cd which gives me what I want... almost. If I enter: cd . I get no completions. OK, I thought, let's try a different approach. cdcomp() { setopt local_options null_glob; reply=($1*$2(-/)) } compctl -S / -q -K cdcomp cd Almost right, but still not quite. If I enter: cd ^D (^D does list-choices) I don't get slashes/at-signs behind the names indicating whether it's a directory or a link. The problem is obviously that -g should be passed the current prefix and suffix. Letting the completion mechanism select the possible entries just isn't enough. Or would it be an idea to integrate globbing and completion altogether, so that a * does not expand to all possible files/directories but to all possible selections in that position. In general, these would be files, but in other places hostnames, etc. This would be an easy way to get, say, all hostnames, or perhaps all manpages starting with zsh... Just an idea. -- Wessel Dankers