<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>My PR is up for this feature now, <a href="https://github.com/ipython/ipython/pull/2636">here</a>.</div><div><br></div><div>One thing I discovered when working on the code for this feature is that I think the IPython completer code could use some refactoring.</div><div><br></div><div>With this PR, there are/will be three independent hooks into the completer system. One of them is is what's used for `import` and `cd` and also provides a somewhat user facing hook API (`get_ipython().set_hook('custom_completer', ...` and `IPython.core.completerlib.quick_completer`). </div><div><br></div><div>Another way of interacting is via interactiveshell.set_custom_completer, which, confusingly, is NOT the same mechanism as `get_ipython().set_hook('custom_completer', ...` (!!).</div><div><br></div><div>And now there's this new feature. It's a bit of crazyness.</div><div><br></div><div>Because none of the completer methods are talking to each other effectively, there's some duplication of effort. For instance, before any of the completers get called, the input line of code is split on delimiters, but only the last element is saved and passed around. So completers that need more info need to reparse the line. The obvious parsing to do is tokenizing the line, but if two completers need to do that, they don't currently have any way to share the tokens, so the tokenizer will just get run twice.</div><div><br></div><div>From working on this new feature, I have some idea of what could be done to improve the situation.</div><div><br></div><div>Is it important to maintain full backwards compatibility with the `get_ipython().set_hook('custom_completer', ...` / `IPython.core.completerlib.quick_completer` API? (Is anyone using that in the wild?)</div><div><br></div><div>-Robert</div><div><br></div><div><div>On Nov 30, 2012, at 3:55 PM, Robert McGibbon wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Awesome. Keep me in the loop! I'm happy to play a support role.<div><br></div><div>-Robert</div><div><br><div><div>On Nov 30, 2012, at 3:51 PM, Thomas Kluyver wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_extra"><div class="gmail_quote">On 30 November 2012 23:47, Robert McGibbon <span dir="ltr"><<a href="mailto:rmcgibbo@gmail.com" target="_blank">rmcgibbo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div></div><div>If someone else wants to try to get this discussion going in the wider python community, I'm all ears. But I don't</div><div>think that person is going to be me.</div></blockquote></div><br>I might do that. Thanks for your thoughts - I look forward to seeing the results.<br>

<br>Thomas<br></div>
_______________________________________________<br>IPython-dev mailing list<br><a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br><a href="http://mail.scipy.org/mailman/listinfo/ipython-dev">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br></blockquote></div><br></div></div></blockquote></div><br></body></html>