Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Programmable completion bug in beta18



> On May 22,  8:08pm, Zoltan Hidvegi wrote:
> } Subject: Re: Programmable completion bug in beta18
> }
> } > compctl -g '*(D-/)' cd
> } > {jagor}[0][~/hrv/zsh-2.6-beta18]$ cd [^D]
> } > 
> } > ^D gives no output. TAB refuses to menu-complete. Shortly, it doesn't work.
> } 
> } You need to set extended_glob for that.
> 
> For what, specifically?
> 
> } I think that extended_glob should be set by default when zsh is not called
> } as sh or ksh.
> 
> There's a whole lot of extendedglob stuff that I don't normally want, so
> up through 2.5* I've not had it set.  Under what circumstances is it now
> required where it was not required before?

In case of compctl, the pattern is stored as a string, and tokenize() is
called to tokenize it, the same function which is used for GLOB_SUBST.  My
previous example was not really correct.  The problem is that:

% foo='*(/)'
% echo $foo

If zsh is called as sh this should print the files ending in (/) instead of
the directories.

echo *(D-/) is syntactically incorrect under sh and it still works in zsh
without extended_glob.  Everything is affected which uses tokenize()
internally.  E.g. the builtin command arguments after -m only know *, ? and
[...].  Elternatives does not work line (foo|bar)*.  Maybe some more
fine-grained control of glob behaviour is preferable.  With sh (, | and )
are ordinary characters in glob patterns.  Maybe we can keep the original
zsh behaviour and add a new option something like SH_GLOB wich does not
handle (, | and ) specially.

Zoltan




Messages sorted by: Reverse Date, Date, Thread, Author