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

Re: PATCH: One small step towards making ~[foo]<tab> work

On Thu, Jun 18, 2015 at 1:28 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> I'm not sure if the first hunk does anything useful, because I'm unable
> to make much else after that work yet. The second hunk at least makes it
> so ~[foo/]/ tries ~[foo/] as the prefix instead of ~[foo. This results
> in ~[m48/]<tab> completing to files inside the directory I want but,
> it lists it as "corrections (errors: 1)". Doing ~[m48/]/<tab> produces a
> "no match" error.
> ~[m48]<tab> still produces nonsense results like ~man ~messagebus etc,
> I guess it thinks [m48] is a character class. I don't know where to hook
> into that properly to redirect it to _path_files(?).
> (The %%]*] is not strictly correct, zsh currently accepts
> ~[foo]blabla/hello as an expansion to bazblabla/hello if ~[foo] expands
> to baz, which is possibly not something we should allow. It feels weird
> anyway).

I realized my ~[foo] expansions where foo doesn't contain a / seem to
work pretty well, as long as you put the trailing slash after manually
(or completion puts it there for you), so there must be somewhere else
that doesn't know about the ~[foo] syntax in the completion code. Any
idea where that might be? I can live with ~[foo]<tab> not working for
now :). I can just invoke expand-word after all.

Mikael Magnusson

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