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

Re: [PATCH] _add-zle-hook-widget: New completion.



On Jul 17,  3:00pm, Daniel Shahaf wrote:
}
} I wanted to use 'autoload +X add-zle-hook-widget; zstyle -g reply
} zle-hook types' to avoid duplicating $hooktypes, but couldn't get it
} to work. (Neither with -k nor with -z was the style defined)

Er, yeah:

     The flag +X attempts to load each NAME as an autoloaded function,
     but does _not_ execute it.

This is in part why I went to some lengths to be able to "source" the
file as well as autoload it.

You could do this:

_add-zle-hook-widget_classes() {
  local -a hooktypes=( ${^${=${(f)"$( add-zle-hook-widget -h )"}[3]}} )
  compadd "$@" -M 'L:|zle-=' -a hooktypes
}



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