zsh-users
 help / color / mirror / code / Atom feed
From: Wessel Dankers <wsl@cs.ruu.nl>
To: Zsh users mailing list <zsh-users@math.gatech.edu>
Subject: Completion on cd
Date: Tue, 27 Jan 1998 23:45:38 +0100 (MET)	[thread overview]
Message-ID: <Pine.LNX.3.96.980127202130.4232B-100000@telamon.dyn.ml.org> (raw)

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 .<TAB>

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



             reply	other threads:[~1998-01-27 22:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-27 22:45 Wessel Dankers [this message]
1998-01-28  0:35 ` Matthew Lovell
1998-01-28  9:31 ` Thomas Koehler
1998-01-28 10:10   ` Andrew Main
1998-01-28 10:50 ` Adam Spiers
1998-01-28  0:58 Steve Talley
1998-01-28 13:11 Oliver Kiddle
1998-01-28 15:26 ` Bruce Stephens
1998-01-28 16:25 ` Adam Spiers
1998-01-29 11:36 Oliver Kiddle
1998-01-30 21:07 Oliver Kiddle
1998-02-01  9:53 ` Andrej Borsenkow
1998-02-02  9:38 ` Owen M. Astley
1998-02-02 19:46   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.96.980127202130.4232B-100000@telamon.dyn.ml.org \
    --to=wsl@cs.ruu.nl \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).