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

Re: Fun with zsh (Re: Associative array ordering (Re: Example function))



Bart Schaefer wrote:

> On Feb 3,  4:00pm, Sven Wischnowsky wrote:
> } Subject: Re: Fun with zsh (Re: Associative array ordering (Re: Example fun
> } 
> } Bart Schaefer wrote:
> } 
> } > Following application of your patch, using 3.1.5-pws-6 zsh -f,
> } > 
> } >     zsh% foo=('(I*)<TAB>
> } > 
> } > only feeps
> } 
> } Whew. The first behavior is the correct one, since the completion code 
> } should take the `(I*)' as the prefix of the string to complete and as
> } long as you don't have a file with a name starting with this, nothing
> } should be matched.
> 
> But I *DO* have a file beginning with "I" -- $PWD is the zsh source root,
> so the INSTALL file is there.  (I*) apparently isn't a glob pattern:
> 
> zagzig% echo (I*)    
> zsh: no matches found: (I*)
> zagzig% echo (I*|)
> INSTALL
> 
> So if your patch somehow makes (I*) complete, something weird is going on.

Something weird indeed: me again, forgetting to mention the option
globcomplete. *Only* if that option is set, (I*) will complete to
INSTALL.
Now one may argue that (I*) isn't a glob pattern so an option named
*glob*complete shouldn't make this happen. But the name of the option
has historical reasons, the option uses pattern matching (not
globbing) to match possible completions, and indeed:

  [[ INSTALL = (I*) ]] && echo yep, indeed

Ok?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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