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

Re: Help w/compctl & ksh_glob



On Sat, Aug 16, 2003 at 05:07:39PM +0000, Bart Schaefer wrote:
: On Aug 16,  2:59am, Jerry A! wrote:
: } Subject: Help w/compctl & ksh_glob
: }
: } I'm trying to setup some simple completions under zsh 4.0.6 using
: } 'compctl' and 'emulate ksh'.
: 
: Any particular reason you're not using compinit?

Yeah, I think that compinit is overkill for simple file extension
completion.

: } compctl -/g '*.+(b{oo,ar,az}|quu|txt)' foo
:                     ^^^^^^^^^^
: The documentation for 'compctl -g' may have part of the answer:
: 
:      [...]  More than one pattern may be
:      given separated by blanks. (Note that brace expansion is _not_
:      part of globbing.  Use the syntax `(either|or)' to match
:      alternatives.)
: 
: (Of course you need +(oo|ar|az) with KSH_GLOB set.)
: 
: However, the real problem is something to do with the SH_GLOB option,
: which is set by 'emulate ksh'.  If I 'unsetopt SH_GLOB' then even as
: (incorrectly) written your compctl offers me directories and .txt files.

Actually, {} globbing is valid ksh93 syntax.  It's not valid ksh88
syntax.  But I've always pictured zsh's ksh emulation as ksh93
emulation.

: This SH_GLOB problem doesn't affect globbing outside of compctl as far
: as I can tell.

This got the wheel's turning.  Turn's out that 'emulate ksh' turns on
'SH_GLOB', which in turns disables (|) globbing.  Boo, not the expected
behavior since ksh expects these characters to enumerate shell globbing.

Turning off SH_GLOB makes everything work correctly.  Thanks for giving
me a path to track down.

        --Jerry

-- 
Open-Source software isn't a matter of life or death...
...It's much more important than that!



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