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

Obscure issues with "zle complete-word ..."



At the top of _history_complete_word is the following test:

  if [[ $WIDGET = *newer ]]; then
    direction=older
  else
    direction=newer
  fi

However, the value of $WIDGET matches neither *newer nor *older when the
function is called via

  zle complete-word _history_complete_word

As it is, for example, when placed in compconfig[incremental_completer]
for use by incremental-complete-word.

I've just erased and retyped this next paragraph four times, so I guess
I really don't know what I expect to be done about this.  I suppose the
only way is to create two functions as well as two widgets.

This caused me to notice something else; the documentation for the "zle"
command says:

    WIDGET [ -n NUM ] [ -N ] ARGS ...
          Invoke the specified widget.  This can only be done when ZLE
          is active; normally this will be within a user-defined widget.

           [...]

          Any further arguments will be passed to the widget.  If it is
          a shell function, these are passed down as positional
          parameters; for builtin widgets it is up to the widget in
          question what it does with them.  Currently arguments are
          only handled by the incremental-search commands, the
          history-search-forward and -backward and the correspeonding
          functions prefixed by vi-, and by universal-argument.

Clearly complete-word (and other builtin completion widgets?) also will
accept arguments.  Are there other widgets that aren't mentioned?  Is it
time to start documenting the arguments in the subsctions on "Standard
Widgets"?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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