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

Re: PATCH: Re: Standard setopts for completion system, again



On Fri, 6 Oct 2000 I wrote:
} Unfortunately, we heavily recommend autoloading all completion functions
} with "autoload -U", which means an alias won't be expanded!

It occurred to me somewhat later that, even with "autoload -U", an alias
*would* be expanded during an "eval".  So we could put this:

alias _comp_setopt='setopt nullglob rcexpandparam extendedglob unset \
     no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob}'

into compinit, and then in the completion functions like _main_complete:

eval _comp_setopt localoptions

Another choice (still in compinit) would be simply to stuff the desired
options into an array:

_comp_setopts=(nullglob rcexpandparam extendedglob unset
     no{markdirs,globsubst,shwordsplit,shglob,ksharrays,cshnullglob})

and then reference them:

setopt localoptions $_comp_setopts

I guess I slightly prefer the latter, since we're already cluttering the
parameter space with completion stuff and I'd rather stay out of the alias
space, but either one would be OK.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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