On 5/11/06, Roland Mainz <roland.mainz at nrubsig.org> wrote:
> David Korn wrote:
> > > Roland Mainz wrote:
> > > Actually it could be done better... attached is a 2nd patch
> > > ("ksh93_tab_tab_gmacs_completion_try2.diff.txt") which also implements
> > > TAB-TAB completion like in bash3.
> > > Single TAB now completes the filename either completely - or if that
> > > isn't possible it's completed to the point where the filenames start to
> > > differ. TAB-TAB then displays a list of choices. Additionally in "gmacs"
> > > mode typing TAB on an empty string will try to do the filename
> > > completion for the whole directory (and TAB-TAB displays all choices
> > > then). "emacs" mode still behaves as usual, incl. the ability to enter
> > > the TAB character.
> >
> > The original idea of changing TAB to behave like \E= makes
> > no sense.
>
> Well, it makes sense for beginners as navigational help due lack of
> better options. But I agree that there are better solutions - that's why
> I wrote the 2nd patch... :-)
>
> > However, the idea of TAB-TAB make sense with the following
> > modifications:
> >
> > 1. It should work for vi as well as emacs.
>
> And "gmacs" ...
>
> BTW: Note that users expect that a TAB-TAB following a TAB-TAB
> redisplays all choices (which means a TAB following a TAB-TAB cannot be
> used to output a TAB, see below).
This is not correct. A TAB following a TAB-TAB redisplays the matches.
> > 2. The second TAB should be mapped into \E= only when the completion
> > did not complete a word. Otherwise, it should insert a TAB.
> > 3. A TAB following a complete word should just insert a TAB.
>
> Uhm... I am not sure whether this is a good idea. Sometimes uses want to
> see all the entries of a directory (or to see all commands in ${PATH}
> etc.) and type TAB-TAB intentionally in bash on an empty string. Maybe
> "emacs" and "gmacs" mode should differ here: "emacs" mode insers a TAB
> in the case, "gmacs" lists all matches for TAB-TAB on the empty string
> (AFAIK that's the reason why bash displays multiple results per line for
> "\E=").
I fully agree with Roland. IMO the creation of a "vim" mode
(VI-iMproved, being closer to bash in details like TAB-TAB completion)
in ksh93 may be a nice idea as well.
Irek