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

Re: prefix-needed style in _popd

Bart Schaefer wrote:

> This is actually what _mailboxes does ... it adds all possible matches,
> with + or @ or % or full paths or whatever ... I was wondering whether
> it ought to be testing prefix-needed, too.

It should really. As should _mh. Also, it seems that _mh acts as if
prefix-needed is true while _mailboxes acts like it is false. 

> Sven's patch to _popd makes it behave as if prefix-needed were true
> without actually testing the style any more, whereas _mailboxes behaves
> as if prefix-needed were false.  The inconsistency concerns me (but not
> very much).

We should probably agree on a consistent default for prefix-needed (and
quite possibly other styles). It is already `true' by default for
options which is the most significant thing which prefix-needed affects
so true is going to suprise the least people. On the other hand, there
is the argument that the default should be completeness and the styles
should be used to refine this down to what the user wants.

> I don't set prefix-needed at all, myself, but I don't understand the
> objection to the `false' behavior.  If you're used to typing a prefix,
> then you'll have typed one, and any listing will be restricted to the
> matches that have that prefix.  Is the issue that you don't want to
> see the possible completions that have a prefix when you complete with
> no prefix in the word on the line?

It is exactly what you describe at the end. I consider the completion
system to be as valuable for providing information as for "completing".
I now rarely use ls other than with -l, so I regularly press tab without
first typing a few letters. Without options in the list of completions,
it is often much easier to see what I want. I'm not even convinced that
I like having long options completed unless I first type two minuses.

Completion can be more useful if it is generating fewer matches but is
being intelligent enough to include those things which the user wants
(the fewer things in the list of matches, the less buried the one the
user wants is). I find that with prefix-needed it is more often
successful with this and I find it predictable because I'm used to it
working that way.


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