#autoload

local format

_tags messages || return 1

_style -s messages format format || _style -s descriptions format format

if [[ -n "$format" ]]; then
  if [[ $compstate[nmatches] -eq 0 ]]; then
    compstate[list]=list
    compstate[force_list]=yes
    compstate[insert]=''
    compadd -UX "${format//\\%d/$1}" -n ''
  else
    compadd -X "${format//\\%d/$1}" -n '' && compstate[force_list]=yes
  fi
fi
