zsh-users
 help / color / mirror / code / Atom feed
* Re: Completion on cd
@ 1998-01-30 21:07 Oliver Kiddle
  1998-02-01  9:53 ` Andrej Borsenkow
  1998-02-02  9:38 ` Owen M. Astley
  0 siblings, 2 replies; 14+ messages in thread
From: Oliver Kiddle @ 1998-01-30 21:07 UTC (permalink / raw)
  To: zsh-users

On Jan 28, 10:10am, zefram@tao.co.uk wrote:
>    compctl -g '*(D-/)' cd
> 
> is better.  The point of using + is that the non-. filenames are used
> if possible, approximating the behaviour of normal filename completion.
> Of course, with the recent compctl patches, one should use
> 
> compctl -/ cd

I was hoping that these -/ options would fix my problems when I upgraded
to 3.1.2-zefram but that wasn't the case. Using the above compctl for cd
and the 3.1.2-zefram I still get the problems I previously described. If
you can't remember, I shall outline it again:

% compctl -/ cd
% cd
% cd [tab]
 -- Only my directories not beginning with "." are listed which is fine
% cd .[tab]
 -- Only my directories beginning with "." are listed which is fine
% cd .netscape/[tab]
 -- All the *files* and directories in .netscape/ (not starting ".") are
 -- listed! I'd have expected it to complete to "cd .netscape/plugins/"
 -- Also annoying is this behaviour:
% cd ..[tab]
 -- I get a beep! It should complete to "cd ../" as in tcsh.

The new -W option is nice though and seems to work very well. Would be
nice if the -Y compctl option patch was included.

Another problem which I've been having with zsh which wasn't a problem
in 3.0.5 but is in 3.1.2 or 3.1.2-zefram is with a particular bindkey:

Under 3.0.5, I used:
bindkey '^[[161q' up-line-or-search

This meant that if I typed a letter, and then pressed Shift-Up the
history would be searched back for a line starting with what I had typed
and the cursor would be positioned at the end of the line. This worked
in the same way as "history-search-backward" from tcsh and was what I
wanted. Under zsh 3.1.2, I just get a beep when I press Shift-Up.
Instead, I have been using:
bindkey '^[[161q' history-beginning-search-backward
which I don't like as much because it leaves the cursor at the same
position.

Oliver Kiddle


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Completion on cd
@ 1998-01-29 11:36 Oliver Kiddle
  0 siblings, 0 replies; 14+ messages in thread
From: Oliver Kiddle @ 1998-01-29 11:36 UTC (permalink / raw)
  To: zsh-users

On Jan 28,  3:26pm, B.Stephens@isode.com wrote:

> > This is one of the main things I miss from tcsh. I'm hoping those
> > recent patches have sorted this one out but I haven't yet compiled
> > that version of zsh. 
> 
> Yes.
> compctl -/ cd
> completes only directories, even beyond the first level.

Brilliant. These patches are in the recent 3.1.2-zefram version aren't
they? I'll have to compile it.

On Jan 28,  4:25pm, adam@thelonious.new.ox.ac.uk wrote:

> > cd [tab]
> > -- all non directories listed - good.
> I'm sure I'm being stupid, but why on earth would you want
> non-directories listed here?  Surely you would only want
> directories (named or otherwise) and symbolic links to
> directories listed?

I think I meant to say "all non-hidden (i.e., starting with ".") 
directories. So it was me being stupid by not reading through what I'd
written before sending it.

Oliver


-- 
 __
/  \|.   _ _  |_/. _| _|| _     E-mail: opk101@cs.york.ac.uk
\__/||\/(-|   | \|(_|(_||(-        Web: http://www.york.ac.uk/~opk101/


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Completion on cd
@ 1998-01-28 13:11 Oliver Kiddle
  1998-01-28 15:26 ` Bruce Stephens
  1998-01-28 16:25 ` Adam Spiers
  0 siblings, 2 replies; 14+ messages in thread
From: Oliver Kiddle @ 1998-01-28 13:11 UTC (permalink / raw)
  To: zsh-users

On Jan 27,  5:35pm, lovell@fc.hp.com wrote:

> I don't have a comment on the suggestion, just my compctl setting for getting
> .<dir>'s to show up:
> 
>   # cd/pushd only directories or symbolic links to directories.  If none of those
>   # match, resort to shell variables
>   compctl -g '*(-/)' + -g '.*(-/)' -v cd pushd rmdir    

This is roughly what I use but the annoying thing is that it only works
properly for the first level of directories:

from my home:

cd [tab]
-- all non directories listed - good.
cd .[tab]
-- all hidden directories listed
cd .netscape/[tab]
-- all of the *files* and directories in my .netscape directory listed.

This is one of the main things I miss from tcsh. I'm hoping those recent
patches have sorted this one out but I haven't yet compiled that version
of zsh.

Oliver Kiddle


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Completion on cd
@ 1998-01-28  0:58 Steve Talley
  0 siblings, 0 replies; 14+ messages in thread
From: Steve Talley @ 1998-01-28  0:58 UTC (permalink / raw)
  To: wsl, lovell; +Cc: zsh-users


> From lovell@fc.hp.com Tue Jan 27 17:54:03 1998
> Date: Tue, 27 Jan 1998 17:35:20 -0700 (MST)
> From: Matthew Lovell <lovell@fc.hp.com>
> To: Wessel Dankers <wsl@cs.ruu.nl>
> Cc: Zsh users mailing list <zsh-users@math.gatech.edu>
> Subject: Re: Completion on cd
> 
> I don't have a comment on the suggestion, just my compctl setting for getting
> .<dir>'s to show up:
> 
>   # cd/pushd only directories or symbolic links to directories.  If none of those
>   # match, resort to shell variables
>   compctl -g '*(-/)' + -g '.*(-/)' -v cd pushd rmdir    

also known as

compctl -g '(.*|*)(-/)'

~~
Steve


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Completion on cd
@ 1998-01-27 22:45 Wessel Dankers
  1998-01-28  0:35 ` Matthew Lovell
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Wessel Dankers @ 1998-01-27 22:45 UTC (permalink / raw)
  To: Zsh users mailing list

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



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1998-02-02 20:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-30 21:07 Completion on cd Oliver Kiddle
1998-02-01  9:53 ` Andrej Borsenkow
1998-02-02  9:38 ` Owen M. Astley
1998-02-02 19:46   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
1998-01-29 11:36 Oliver Kiddle
1998-01-28 13:11 Oliver Kiddle
1998-01-28 15:26 ` Bruce Stephens
1998-01-28 16:25 ` Adam Spiers
1998-01-28  0:58 Steve Talley
1998-01-27 22:45 Wessel Dankers
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

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