bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doing completion and menu-completion with just one key


From: Ernest Adrogué
Subject: Re: doing completion and menu-completion with just one key
Date: Sun, 19 Jan 2014 23:18:00 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

2014-01-19, 14:04 (-0500); Chet Ramey escriu:
> On 1/4/14, 8:09 AM, Ernest Adrogué wrote:
> 
> > One solution is first use completion to narrow down completions and in the
> > end use menu-completion, but I think it would be much better to use just one
> > key.  In my opinion the best solution would be this: the first TAB does
> > completion and successive TABs do menu-completion.  Currently I don't think
> > it is possible to configure Readline to do this, is it?
> 
> This is an issue when there is more than one possible completion.  I will
> assume that you mean that when you say you want "completion" on the first
> TAB, you want the longest common prefix displayed, then subsequent TABs to
> cycle through the possible completions as menu-complete usually behaves.
> 
> If this is the behavior you want, bind TAB to menu-complete and set the
> readline variable `menu-complete-display-prefix'.

Yes this is what I meant, I think.  To be more specific:

* On the first TAB, I want the longest common prefix inserted and a list of
  possible completions displayed.

* On subsequent TABs, I want to cycle through possible completions.

If I bind TAB to `menu-complete' and set `menu-complete-display-prefix', the
first TAB displays a list of possible completions, which is what I wanted,
but it also inserts the first entry from the list of possible completions,
which is not what I wanted.

For example, if I do:

$ cd <TAB>

it displays the possible completions:

bar/  fooa/ foob/

and inserts `bar/'.  But `bar/' is not the longest common prefix, the empty
string is.

Regards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]