zsh-workers
 help / color / mirror / code / Atom feed
* Re: _path_files and _cd  with explicit glob pattern
@ 1999-03-19  8:35 Sven Wischnowsky
  1999-03-19  9:59 ` Andrej Borsenkow
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 1999-03-19  8:35 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> bor@itsrm2:/tools/src/zsh-3.1.5-pws-12/Completion%> zsh -f
> itsrm2% fpath=($PWD/${^~:-*(/)})
> itsrm2% source Core/compinit
> itsrm2% cdpath=(/tools/src)
> itsrm2% setopt globcomplete
> itsrm2% cd /tools
> itsrm2% l s/*3TAB
> itsrm2% l src/autoconf-2.13/
> autoconf-2.13/     samba-2.0.3/       tk8.0.3/           zsh-3.1.5-pws-12/
> mc-4.5.13/         sendmail-8.9.3/    top-3.4/
> ncftp-3.0beta18/   tcl8.0.3/          wget-1.5.3/
> 
> In other words, all files with ``3'' in them are taken. And menu starts
> immediately.

That's because with `globcomplete', the code inserts a `*' at the
cursor position. I'm reluctant to change this (since that would be an
incompatible change), but I always was aware of the problem and the
patch for matching-cleanup I'm working on will allow one to say that
no `*' should be inserted -- this is also interesting to have when
using auto-correction (and somehow I got a mail from Peter replying to 
a mail from Bart where this problem was mentioned).

> I think, if user explicitly gives glob pattern, he probably knows what he's
> doing. I noted this, when I tried to change to a directory; there were three
> dirs:
> SIN3C1 SIN3C2 SIN3C3 - and I wanted to select exactly one (the last) but got
> all three.
> 
> And another problem with _cd (I think)
> 
> itsrm2% cd s/*3TAB
>    Beep

Is this still with the setting of `cdpath' you gave above? If so, this 
is correct ;-)

> Ahem ... I'd expect it to complete to src/whatever
> 
> itsrm2% cd *3TAB  (they are all in /tools/src)
> itsrm2% cd autoconf-2.13
> autoconf-2.13      samba-2.0.3        tk8.0.3            zsh-3.1.5-pws-12
> mc-4.5.13          sendmail-8.9.3     top-3.4
> ncftp-3.0beta18    tcl8.0.3           wget-1.5.3
> 
> I get the same names and menu starts immediately (that's due to _path_files
> I think) but they are not marked with slash (and no autoremoved slash
> either)

Hm, this should work, and it does for me.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* RE: _path_files and _cd  with explicit glob pattern
  1999-03-19  8:35 _path_files and _cd with explicit glob pattern Sven Wischnowsky
@ 1999-03-19  9:59 ` Andrej Borsenkow
  1999-03-20  4:49   ` Geoff Wing
  0 siblings, 1 reply; 4+ messages in thread
From: Andrej Borsenkow @ 1999-03-19  9:59 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

> > And another problem with _cd (I think)
> > 
> > itsrm2% cd s/*3TAB
> >    Beep
> 
> Is this still with the setting of `cdpath' you gave above? If so, this 
> is correct ;-)
> 

Ehem ... cd first looks in the current directory. So

bor@itsrm2:~/test%> ls -l cd
total 0
drwxr-xr-x   2 bor      sinix         96 Mar 19 12:55 foo
bor@itsrm2:~/test%> echo $cdpath
/home/bor/test/cd
bor@itsrm2:~/test%> cd c/*oTAB
  Beeps, but
bor@itsrm2:~/test%> cd cd/foo
bor@itsrm2:~/test/cd/foo%>

So, it looks, like cd completion ignores current directory

/andrej


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

* Re: _path_files and _cd  with explicit glob pattern
  1999-03-19  9:59 ` Andrej Borsenkow
@ 1999-03-20  4:49   ` Geoff Wing
  0 siblings, 0 replies; 4+ messages in thread
From: Geoff Wing @ 1999-03-20  4:49 UTC (permalink / raw)
  To: zsh-workers

Andrej Borsenkow <borsenkow.msk@sni.de> typed:
:Ehem ... cd first looks in the current directory. So
[...stuff deleted...]
:So, it looks, like cd completion ignores current directory

Yes, I noticed this bug on my machine, so I just whacked ``.'' to the
start of cdpath.
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : (Australia) 0412 162 441
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/


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

* _path_files and _cd  with explicit glob pattern
@ 1999-03-18 16:37 Andrej Borsenkow
  0 siblings, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 1999-03-18 16:37 UTC (permalink / raw)
  To: ZSH workers mailing list

bor@itsrm2:/tools/src/zsh-3.1.5-pws-12/Completion%> zsh -f
itsrm2% fpath=($PWD/${^~:-*(/)})
itsrm2% source Core/compinit
itsrm2% cdpath=(/tools/src)
itsrm2% setopt globcomplete
itsrm2% cd /tools
itsrm2% l s/*3TAB
itsrm2% l src/autoconf-2.13/
autoconf-2.13/     samba-2.0.3/       tk8.0.3/           zsh-3.1.5-pws-12/
mc-4.5.13/         sendmail-8.9.3/    top-3.4/
ncftp-3.0beta18/   tcl8.0.3/          wget-1.5.3/

In other words, all files with ``3'' in them are taken. And menu starts
immediately.

I think, if user explicitly gives glob pattern, he probably knows what he's
doing. I noted this, when I tried to change to a directory; there were three
dirs:
SIN3C1 SIN3C2 SIN3C3 - and I wanted to select exactly one (the last) but got
all three.

And another problem with _cd (I think)

itsrm2% cd s/*3TAB
   Beep

Ahem ... I'd expect it to complete to src/whatever

itsrm2% cd *3TAB  (they are all in /tools/src)
itsrm2% cd autoconf-2.13
autoconf-2.13      samba-2.0.3        tk8.0.3            zsh-3.1.5-pws-12
mc-4.5.13          sendmail-8.9.3     top-3.4
ncftp-3.0beta18    tcl8.0.3           wget-1.5.3

I get the same names and menu starts immediately (that's due to _path_files
I think) but they are not marked with slash (and no autoremoved slash
either)

cheers

/andrej


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

end of thread, other threads:[~1999-03-20  4:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-19  8:35 _path_files and _cd with explicit glob pattern Sven Wischnowsky
1999-03-19  9:59 ` Andrej Borsenkow
1999-03-20  4:49   ` Geoff Wing
  -- strict thread matches above, loose matches on Subject: below --
1999-03-18 16:37 Andrej Borsenkow

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