[IPython-User] More candidates in qtconsole auto-completion

klo uo klonuo@gmail....
Fri Sep 21 06:47:07 CDT 2012


On Fri, Sep 21, 2012 at 12:52 PM, Matthias BUSSONNIER wrote:

>
> That would be 'width' parameter of SlidingInterval  constructor.
> In completion_**html**.py , and not 8 but 6 because 8 = 6+2*1 where 6 and 1
> should configurable.
> 6 being always 6 shown rows.
> 2*1 being potential '…' on top and '…' on bottom that are "allowed" to be
> completion result when near the edges.
>
>
That's it. Works as you said. Thanks for helping me out.
'ncurses' options is best IMHO. It's good to have those alternative, and
drop-down control is interesting, but this is it - in front of you in easy
accessible table and now I can set it in shape (in rows for now) that I
please :)


If auto-complete functions were sorted alphabetically by row we would have
seen full 3 columns with 24 functions, while currently we see just 2 items
in 3rd column (in posted qtconsole example). For me it's easier to read
alphabetically sorted table by row in this case when table is clipped


No, because to do so the 3 colums would have been more than 80 characters
> wide.
> Under the hood the colomnizer create the column to be sure it does not get
> wider than a give width.
> and the visible items are not the only one taken into account.
>
> as you can see here it's 86 chars width
> ====
> api.AdaptToWordStr           api.AllWordConfidences      api.AnalyseLayout
>
> api.Clear                    api.ClearAdaptiveClassifier
> api.DeleteBlockList
> api.DetectOS                 api.DumpPGM                 api.End
>
> api.FindLinesCreateBlockList api.FindRowForBox
> api.GetBlockTextOrientations
> api.GetBoolVariable          api.GetBoxText
>  api.GetConnectedComponents
> api.GetCubeRecoContext       api.GetDawg
> api.GetDoubleVariable
> api.GetFeaturesForBlob       api.GetHOCRText
> api.GetInitLanguagesAsString
> api.GetIntVariable           api.GetIterator
> api.GetLoadedLanguagesAsVector
> ====
> by row, colonize would have given you 2 columns.
> ===
> api.AdaptToWordStr           api.AllWordConfidences
> api.AnalyseLayout            api.Clear
> api.ClearAdaptiveClassifier  api.DeleteBlockList
> api.DetectOS                 api.DumpPGM
> api.End                      api.FindLinesCreateBlockList
> api.FindRowForBox            api.GetBlockTextOrientations
> api.GetBoolVariable          api.GetBoxText
> api.GetConnectedComponents   api.GetCubeRecoContext
> api.GetDawg                  api.GetDoubleVariable
> api.GetFeaturesForBlob       api.GetHOCRText
> api.GetInitLanguagesAsString api.GetIntVariable
> api.GetIterator              api.GetLoadedLanguagesAsVector
> ===
>
> it is a tricky problem,
> considering this :
> ====
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb ccc
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb ccc
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb
> ===
>
> wanting to decrease the number of rows from 5 to 4 to fill the last column
> will give you this :
> ===
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb                       bbbbbb
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb                       ccc
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb                       ccc
> aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb
> ===
> so almost twice as wide.
>
>
I don't quite understand what you saying here.
I expect that colomnizer calculates whole table before it show "selected"
part of it, but won't column width depend on context? In a manner that if
some time sorted by row gives wider columns the other time it would be
opposite?
Or are you saying that probability of wider columns is less when there are
less items shown (as in example that 3rd column isn't populated when sorted
by column)? I guess not, but can't get the meaning of this


as that's how cursor TAB interaction has been made.
>>
>>
>> [...]
>>
>> Writing this was much more complicated to do than I first thought, but
>> I'll be happy if you find a better solution than mine.
>>
>
> I get you. I don't speak English too ;)
> It's tricky when you think more about it. If I look for a function I can't
> remember it's name I usually "know/suspect" the beginning and using TAB to
> move through available function which aren't alphabetically sorted is
> unintuitive for sure. But hey, I didn't know that arrow keys work, so
> that's good thing to know ;)
>
>
> Yes, and one might want to also bing PgUP, PgDown, and shift tab...
>
>
>
>  If you wan't to give a shot a making things configurable, or write your
> on completer-gui, take a look at
>
>> ipython/IPython/frontend/qt/console/completion_html.py
>> ipython/IPython/frontend/qt/console/console_widget.py  :  L96
>>
>>
> Yet another tip. That's great. I also didn't know about it.
> So plain mode is just like auto-completion in terminal console, while
> there is also drop-down control available!
>
>
> yes, plain mode is just the old mode, and drop-down has been around for a
> while.
>
> Thanks again Matthias for your always insightful support
>
> Case closed
>
>
> You can still try to make row number configurable.
> And columns which adapt with window width.
>
> And we are not forgetting qtconsole.
> We jus want a more feature/protocol 'stable' notebook.
> Ultimately it would be great to have a qtconsole that use QtWebkit instead
> of QRichText Widget
> But that would be a huge re-write.
>

OK :D
I really wanted to post that couple of times, and while reading Thomas'
reply got carried



> --
> Matthias
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120921/96cfd305/attachment.html 


More information about the IPython-User mailing list