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

Re: another file completion problem in 4.3.9-dev-2



On May 3, 12:56pm, Greg Klanderman wrote:
}
} >>>>> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
} 
} > "baz" is a mismatch in at least two dimensions, both position in the
} > word (not a prefix) and case.  I suspect the matcher list can adjust
} > for only one dimension at a time.
} 
} I don't think that's true, it usually works for me, for example:
} 
} lwm% touch FooBar FooBaz
} lwm% ls baz    # <TAB> ===> FooBaz

Right, and look at this:

torch% ls        
BarBaz  FooBaz
torch% ls baz<TAB>
torch% ls FooBaz <cursor>

The only match found is FooBaz.  The condition seems to be that "baz"
matches nothing, and "Ba" matches a prefix of BarBaz, so there's no
futher attempt to find another spot where "Ba" might match -- the
mismatch of "z" vs. "r" discards BarBaz as a possible completion
unless correction is also allowed.

Completion isn't coded like a regular expression engine that will
backtrack and retry until it finds all possible substring hits -- in
fact, when presented with the choice the decision frequently was to
make completion fail quickly even if that meant missing something.
Otherwise it's too easy to get into situations where you hit TAB and
the shell just goes away for minutes at a time.  Some people would
say that's already too easily perpetrated.
 
} Any thoughts on the other one I sent a couple weeks back, which seemed
} to have something to do with quoting of space?

I can't reproduce it using the steps that you outlined.  For example,
at the point where you say --

> OK, now <Control-d> lists:

I can't list with ^D, instead it deletes the backslash character
that is under the cursor.  If I invoke list-choices explicitly, the
cursor moves to the end of the line when the list is displayed, then
moves to the backslash again when I hit TAB; no "o" is inserted.

Is it possible you have some settings creeping in from /etc/z* even
when starting with zsh -f ?  Or perhaps the contents of the several
directories makes a difference -- can you reproduce with empty dirs?



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