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

Still something strange with ambiguous prefix



After applying all patches (except compset) and using


bindkey -e
bindkey '\033^M' accept-and-menu-complete
bindkey '^I' complete-word
bindkey '^[q' push-line-or-edit

##
## New completion
##

fpath=(~/.zsh.d/Completion/* "$fpath[@]")
source ~/.zsh.d/Completion/Core/compinit
compconf completer=_complete:_match
compconf match_original=yes

1.

bor@itsrm2:~%> sudo mkdir -p /foo/{bar,bar1}
bor@itsrm2:~%> sudo touch /foo/{bar,bar1}/baz
bor@itsrm2:~%> l /f/b/bTAB
bor@itsrm2:~%> l /foo/bar/baz

That is strange. bar1 seems to be never completed. (I noted it as we have
both /usr/lib and /usr/lib64s with (basically) the same contents). I'd
expect it to menu complete {bar,bar1}

2.

bor@itsrm2:~> l /t/s/z/D/z*iTAB
bor@itsrm2:~%> l /tools/src/zsh-3.1.5-pws-13/Doc/zsh.info
zsh.info         zsh.info-5       zshbuiltins.1    zshoptions.1
zsh.info-1       zsh.info-6       zshbuiltins.yo   zshoptions.yo
zsh.info-10      zsh.info-7       zshcompwid.1     ztexi.yo
zsh.info-2       zsh.info-8       zshcompwid.yo
zsh.info-3       zsh.info-9       zshmisc.1
zsh.info-4       zsh.texi         zshmisc.yo

Yesterday it completed just to zsh.texi

3.

bor@itsrm2:~%> l /t/s/gl/co*TAB
bor@itsrm2:~%> l /tools/src/glib-1.1.15/co* <= cursor here
glib-1.1.15/  glib-1.2.0/

So, menu completion is started for prefix, but cursor is placed at the end
of word.

4. It seems to be impossible to complete only prefix in /u/i/s/*.h (oh, I
like this example :-) Reading README, _expand completer has a
expand_original option, that makes it include original string in a set of
matches. What about something like it for _match as well (with intention,
that it should be used by _path_files also)? I understand, that it probably
needs either another member to compstate - or probably we could add special
value of pattern_insert? With meaning "menu completion with original
pattern"?

Just a comment - I personally would prefer dots for options names:
expand.menu, match.original etc. It gives more "multilevel" impression -
e.g. if we decide to add more precise options to match.original, they could
be match.original.foo, match.original.bar etc.
And it is so Tcl'ish ... :-)

cheers

/andrej



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