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

Re: Feature requests

On Sun, Jun 2, 2013 at 3:53 PM, Andi Șerbănescu <ac.serbanescu@xxxxxxxxx> wrote:
> There is no way, however, to disable the prompt altogether (the best
> one can do is to set LISTMAX to -1, which only prompts in case of a
> single match).

I have to say I don't understand the behavior, intended or actual, of
a negative value of LISTMAX, at all.  With LISTMAX=-1 and a
description format defined, it'll prompt when there are no matches and
falsely tell you there is a match.  On the other hand it never prompts
when completing in command position no matter how many/few matches
there are, only when completing arguments, which differs from the
behavior with a positive LISTMAX.

> Therefore, I kindly request a small modification in
> order to obtain the desired behaviour (e.g. never ask if LISTMAX is
> unset).

Does it not suffice to set LISTMAX to some very large positive number?

> The other one concerns the insertion and removal of suffixes (such as
> spaces or slashes) after a successful completion. ...
> My question is: can something be done to disable the removal of the
> space suffix (or any other suffix, if there are any besides space and
> slash) when followed by non-insertables, the way AUTO_REMOVE_SLASH
> does for slashes?

Can you give an example?  Do you mean, for example, that you want the
suffix to stay on the line when you invoke the backward-char widget,
but to be removed when you type a space?

The way to accomplish what I just described is to define your own widget, e.g.,

backward-char-keep-suffix() { zle auto-suffix-retain; zle .backward-char "$@" }
zle -N backward-char-keep-suffix
zle -A backward-char-keep-suffix backward-char

Suffix removal behavior of other user-defined widgets may be
controlled directly by those widgets, so the above doesn't generalize
except for other built-in widgets.

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