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

Re: completion bug: treats substitution of unset parameter as empty string



>>>>> On July 29, 2009 -- Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:

> % unset Q
> % ls $Q/ <tab>

> lists completions in '/' rather than beep because there are no
> completions.

> I do have the 'nounset' option set, though I think this should
> give an error / no completions either way, as it did with the
> old compctl system.

OK, so just this line in _path_files needs 'setopt nounset':

|    eval 'realpath=${(e)~linepath}' 2>/dev/null

Is the best way to do that to use an anonymous function:

|    function {
|      setopt localoptions nounset
|      eval 'realpath=${(e)~linepath}' 2>/dev/null
|    }

or is this paradigm which I see in a few places preferred:

|    setopt nounset
|    eval 'realpath=${(e)~linepath}' 2>/dev/null
|    setopt unset

How exactly is the default set of shell options arrived at for the
evaluation of completion functions?  My own setopts do not seem to
effect the completion functions.. how is that?

thanks,
Greg



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