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

Re: possibly useful zsh_directory_name implementation



On 11 March 2011 13:17, Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> 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.

Okay, I completely misinterpreted one of your sentences, it makes
complete sense now. I thought you meant the . and / in _my_ function
wouldn't be needed, somehow. Clearly that referred to the other
functions.
("the function here would interact nicely with other functions that
implemented naming without the "/" or "." at the start.")

-- 
Mikael Magnusson



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