On 13/04/15 03:18, Bart Schaefer wrote: > >> I have set the >> completion system to ignore hidden files and only show them when there >> are no other options (no other files in the listed directory or I >> explicitly type . at the beginning). > This actually should be the default behavior with no ignored-patterns set > at all. Oh, sorry about this, I thought the options I have set don't affect the style in particular, but you're right. I attach a more complete .zshrc with the options I have set as well. > Once I got that straight I was able to find the real reason for: > >> It works perfectly with all >> commands but mkdir, which simply refuses to offer hidden files, ever. > Which turns out to be that _mkdir calls _message which breaks out of the > loop over _completers in _main_complete, so the _ignored completer in your > style is never reached. > > This would not happen if you did not have a "format" style for the context > with tag "descriptions" (which is used as a fallback for tag "messages"). > > _message really ought to be called only when there is no possibility of > other completions being generated, not merely to suggest what ought to > be typed at that point. Either that or it needs some option (the inverse > of "_message -e"?) that tells _main_complete to continue even though a > message is pending. > > There is at least a workaround: > > zstyle ':completion::*:mkdir::messages' format '' Great find! Although that workaround did not work for me, the one that did (a more ugly one, but...) was to simply remove the call to _messages: functions[_mkdir]="${functions[_mkdir]:s/ || _message 'name of directory'/}" And now it works great. Thank you!