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

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



On Feb 4,  9:06am, Sven Wischnowsky wrote:
} Subject: Re: Fun with zsh (Re: Associative array ordering (Re: Example fun
}
} 
} Bart Schaefer wrote:
} 
} > 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

That's interesting.

The manual says of GLOB_COMPLETE, "If no matches are found, a `*' is added
to the end of the word or inserted at the cursor if tt(COMPLETE_IN_WORD)
is set, and expansion is attempted again."  Now, (I*)* _IS_ a glob pattern,
so this makes sense.

That also means that with globcomplete,

zsh% echo (I)<TAB>
zsh% echo INSTALL

which in fact is what happens.  [[ INSTALL = (I) ]] is definitely false ...
is globcomplete really using pattern matching the way you say?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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