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

Re: zsh best practices ?



Hi Bart,

Thanks for answer.

le 26/05/2006,
Bart Schaefer nous écrivait :
> We should add something to Etc/zsh-development-guide discussing the
> conventions for naming completion functions, widgets, etc. that go
> into the distribution; I don't see anything in there about that.

hope it will come soon.

> It's a little more difficult with zsh than with perl because "private"
> functions are still usually something you type on the command line,
> not hidden in a libarary somewhere.  It's almost like asking if there
> is a naming convention for files in the directories in $PATH.  The
> completion system is a major exception to this.

i know the difficulty of that and thought that long time zsh scripters
had already shared their tips.

> One convention is to stick a "z" in front of anything that replaces a
> similarly-named external command, but that doesn't help where the dist
> has already adopted it.
> I sometimes use *two* leading underscores, but only if I'm really worried
> about a name collision.

thinking about it, i've decided to mix both : "private" functions will
be prefixed by z__ and local vars will be prefixed by the name of their
function.

For exemple:
function z__association_compare
variable z__association_compare_current_key 

Thanks for clues and regards,
mc



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