zsh-workers
 help / color / mirror / code / Atom feed
* Another keep-prefix problem
@ 2001-04-24  0:46 Wayne Davison
  2001-04-24 16:50 ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Wayne Davison @ 2001-04-24  0:46 UTC (permalink / raw)
  To: Zsh Workers

I noticed one other problem with the current zsh (in CVS) and how it
handles keeping the prefix.  After Bart's last set of tweaks, this
works:

   % ls $var1/foo/$var2/bar<TAB>

But leaving off the leading variable results in a useless expansion:

   % ls /full/path/foo/$var/bar<TAB>

When the filename only has an embedded variable, it is expanded.
Here's a (completely usless) failure case:

   zsh -f
   % autoload -U compinit
   % compinit
   % zstyle ':completion:*' completer _expand _complete
   % zstyle ':completion:*:expand:*' keep-prefix true
   % bindkey '\t' complete-word
   % www=/var/www/html
   % mkdir $www/subdir
   % echo ~
   /home/wayne
   % ls -l ~/../..$www/sub<TAB>

... properly expands to 'subdir' ...

   % ls -l /home/wayne/../..$www/sub<TAB>

... does not.

..wayne..


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Another keep-prefix problem
@ 2001-04-26 14:27 Oliver Kiddle
  2001-04-26 15:43 ` Wayne Davison
  2001-04-27  9:03 ` Sven Wischnowsky
  0 siblings, 2 replies; 10+ messages in thread
From: Oliver Kiddle @ 2001-04-26 14:27 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:

> I won't commit this before I get positive replies and answers to the
> question if we then should add another possible value for the
> keep-prefix style for this new behaviour or if that's not needed (I

As seems to be the consensus, I don't think we need another value for
keep-prefix for this.

This is more than likely nothing to do with the latest patch but when
I tried testing all this, things didn't work as I'd like or expect.

For _expand I use the glob 1, substitute 1, suffix 1, accept-exact
false and tag-order all-expansions styles. keep-prefix changed is
the default so that too.

To test I did:
c1=/home
c3=cvs
Now,
cd $c1/kiddleo/$c3/<tab> expands both $c1 and $c3 which I don't want.
Having typed the / after $c3, I expect it to complete subdirectories
in my ~/cvs and not do expansion.

Okay, so I tried setting keep-prefix to 1 and things start working nicely.
Except what is going on here (where I mix globs with variables):
   cd /home/kiddle?/$c3/<tab> results in:
   cd /home/kiddle?/$c3//home/kiddleo/cvs/
this definitely isn't right.

So in what situations is the changed value of keep-prefix useful for?
It sounds something like subst-globs-only from the docs. I can't
remember why I used it and not a value of 1.

Actually, talking of the docs for styles, the section on tag-order is
messed up and seems to have the same example twice.

Oliver


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

end of thread, other threads:[~2001-04-27  9:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-24  0:46 Another keep-prefix problem Wayne Davison
2001-04-24 16:50 ` Bart Schaefer
2001-04-24 19:18   ` Wayne Davison
2001-04-25 13:25     ` Sven Wischnowsky
2001-04-26  4:33       ` Bart Schaefer
2001-04-26 14:27 Oliver Kiddle
2001-04-26 15:43 ` Wayne Davison
2001-04-26 17:18   ` Bart Schaefer
2001-04-26 23:38     ` Wayne Davison
2001-04-27  9:03 ` Sven Wischnowsky

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