[IPython-dev] Tab-completion in master

Jörgen Stenarson jorgen.stenarson at bostream.nu
Tue Aug 24 13:36:51 EDT 2010


Fernando Perez skrev 2010-08-24 19:18:
> On Tue, Aug 24, 2010 at 10:11 AM, Jörgen Stenarson
> <jorgen.stenarson at bostream.nu>  wrote:
>> Hi,
>>
>> I have a problem with tab-completion in the master branch when running
>> on windows with pyreadline. If there are both magics and regular
>> functions matching I get a list of matches but the line I started with
>> is removed, if there is only magics or regular matches it works as
>> expected. I think in 0.10 or earlier magics were only matched whith an
>> explicit % at the beginning of the line.
>>
>> example:
>> In [1]: r
>> %reset           reversed         raw_input        %rehashx
>> %rep             reduce           reload           round
>> return           repr             range            README.txt
>> raise            %run             ren              %r
>> %reload_ext      %reset_selective rmdir
>>
>> In [1]:
>>
>> with longer string
>>
>> In [1]: res
>> %reset           %reset_selective
>>
>> In [1]: %reset
>>
>>
>> Is the behaviour the same on Linux?
>
> Yes, I see the same:
>
> In [1]: r
> %r                       %rundemo                 repr
> %rehashx                 raise                    return
> %reload_ext              range                    reversed
> %rep                     raw_input                rich_ipython_widget.pyc
> %reset                   re                       rm
> %reset_selective         reduce                   rmdir
> %run                     reload                   round
>
> In [1]: res
> %reset            %reset_selective
>
> In [1]: %reset
>
> but that's actually fairly similar to what 0.10 gives me:
>
> IPython 0.10.1 -- An enhanced Interactive Python.
> ?         ->  Introduction and overview of IPython's features.
> %quickref ->  Quick reference.
> help      ->  Python's own help system.
> object?   ->  Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: r
> raise      raw_input  reload     return     rm         round
> range      reduce     repr       reversed   rmdir
>
> In [1]: %reset [This was re-written]
>
>
> I don't find it to be a big bother, what part of that behavior don't
> you like?  The auto-prepending of '%'?  I think that would be fairly
> easy to fix, though it's been around for a while without complaints...
>
> I'm happy to look at improving the behavior, I just want to make sure
> I understand what direction you'd like to see it improved in.
>
> Regards,
>
> f
>
The main problem is that as it works now (at least for me) is that it 
actually deletes everything I have written if there are matches both in 
magics and regular. For example if I try to complete on 'color' when in 
pylab mode then I get a list of 5 matches 2 magics and 3 regular but I 
get to start all over again and type in color again:

In [1]: color
colorbar    colors      %colors     colormaps   %color_info

In [1]: 			<--Empty line

I find it quite annoying to have to retype things in cases like this.

I think it would be nice to get alla matches including magics but not if 
the price is that I loose things I have typed.

/Jörgen




More information about the IPython-dev mailing list