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

Re: PATCH: Remove _message call from _mkdir



On Apr 12,  8:54pm, Peter Stephenson wrote:
}
} >        _wanted directories expl \
} >          'parent directory (alternatively specify name of directory)' \
} > -        _path_files -/ && ret=0 || _message 'name of directory'
} 
} I'm not really sure what that was doing there in this one case, anyway.

In the event that there really are no path prefixes to complete, it is
intended to change this:

torch% mkdir
No matches for `parent directory (alternatively specify name of directory)'

Into this:

torch% mkdir
name of directory

Trouble is there's no simple way to determine on the first call to _mkdir
whether there might be other paths suggested by later completers.

Hence my other suggestion from zsh-users:

> ...  Either that or it needs some option (the inverse
> of "_message -e"?) that tells _main_complete to continue even though a
> message is pending.

This is actually not too hard, just do not set _comp_mesg=yes, though the
option parsing for _message is unnecessarily ugly.  The doc for _message
says:

     ... the resulting string will
     always be shown whether or not matches were generated.

So with _comp_mesg not set, we'd potentially end up with:

torch% mkdir
name of directory
Completing parent directory (alternatively specify name of directory)
[list of the ignored files here]



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