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

Re: auto list choices



On Mar 8, 10:48am, joe M wrote:
} 
} This code does a list-choices on every self-insert. Might be of
} interest to someone.

Some brief critique:

(1) It's annoying to use application/octet-stream for text attachments.
This probably isn't your fault, you just have a broken email program,
or you haven't told it that the ".zsh" extension means a text type.

(2) In this line in list-completion:

   if ((compstate[list_lines] > ${INCR_MAX_MATCHES:-20} \
        || compstate[list_lines]+BUFFERLINES+2 > LINES))

The backslash-continuation is not necessary, "((" begins a syntactic
construct which continues even across newlines to the matching "))".

(3) In show-choices, this:

   unsetopt localoptions BANG_HIST

is not doing what you want.  This UNSETS the localoptions option, which
makes the unset of BANG_HIST become permanent outside the function.  You
meant

   setopt localoptions NO_BANG_HIST

or more verbosely

   setopt localoptions; unsetopt BANG_HIST

However, locally unsetting BANG_HIST is the correct solution to the
problem you were having, so good job figuring that out.



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