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

Re: possibly useful zsh_directory_name implementation



On Fri, 11 Mar 2011 13:06:13 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> If you don't have a prefix, how do you specify which of the functions
> should handle the argument?

I'm not sure I understand the question, but the way it would is each
hook function is passed the same arguments in turn.  If it's not in a
form it recognises, it returns a non-zero status.  This continues until
one function handles the argument and returns a zero status.  So each
function just looks at the pattern it's got and sees if it thinks it
makes sense to handle it.  That requires a minimal amount of cooperation
but in the name -> directory direction it's simply a question of failing
gracefully with unmatched names.  In the other direction there's more of
an ordering problem --- do you want the name to pop up as a relative
directory like '.dir', or using some kind of absolute naming scheme?
But that's up to the user's preference.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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