Picon
Picon
Favicon

Re: Custom command completers implemented in SVN

On Tue, Oct 31, 2006 at 09:02:47PM +0200, Ville M. Vainio wrote:
> On 10/30/06, Ville M. Vainio <vivainio <at> gmail.com> wrote:
> 
> > I have a preliminary (but functional, and probably final)
> > implementation of custom completer hooks implemented in SVN. Now it's
> > quite easy to add your own completers.
> 
> I renamed the file to ipy_stock_completers.py and added two extra (and
> probably more useful) completers - "import" and "svn" command
> completers.

Thanks, Ville!  This is very useful.

A question about filename completion in general.  When I type

somefunc('/home

and <TAB> to complete, I see

fun('/home/'

Once the inverted-commas are closed, no more filename completion can
be done, and I have to type 'backspace <TAB>'.  I think this used to
work a long time ago, but I may recall incorrectly.

Cheers
Stéfan
Ville M. Vainio | 1 Nov 09:27
Picon
Gravatar

Re: Custom command completers implemented in SVN

On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:

> Thanks, Ville!  This is very useful.
>
> A question about filename completion in general.  When I type
>
> somefunc('/home
>
> and <TAB> to complete, I see
>
> fun('/home/'

Hmm, this doesn't happen with me. I don't get the terminating single
quote (and I tried w/ double quotes too).

--

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
Picon
Picon
Favicon

Re: Custom command completers implemented in SVN

On Wed, Nov 01, 2006 at 10:27:53AM +0200, Ville M. Vainio wrote:
> On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:
> 
> >Thanks, Ville!  This is very useful.
> >
> >A question about filename completion in general.  When I type
> >
> >somefunc('/home
> >
> >and <TAB> to complete, I see
> >
> >fun('/home/'
> 
> Hmm, this doesn't happen with me. I don't get the terminating single
> quote (and I tried w/ double quotes too).

I am running the latest ipython trunk on a standard Ubuntu Edgy
installation, with no modifications to the default ipythonrc and a
stock standard /etc/inputrc.

Any idea where I start looking for the problem?

Cheers
Stéfan
Ville M. Vainio | 1 Nov 14:05
Picon
Gravatar

Re: Custom command completers implemented in SVN

On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:

> I am running the latest ipython trunk on a standard Ubuntu Edgy
> installation, with no modifications to the default ipythonrc and a
> stock standard /etc/inputrc.
>
> Any idea where I start looking for the problem?

This is probably a difference b/w pyreadline (windows) and readline
(Linux). I gotta try it on Linux as well. ISTR that on linux, you
didn't actually need to press backspace and erase the quote but could
keep on typing letters as if the quote wasn't there.

--

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
Picon
Picon
Favicon

Re: Custom command completers implemented in SVN

On Wed, Nov 01, 2006 at 03:05:57PM +0200, Ville M. Vainio wrote:
> On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:
> 
> >I am running the latest ipython trunk on a standard Ubuntu Edgy
> >installation, with no modifications to the default ipythonrc and a
> >stock standard /etc/inputrc.
> >
> >Any idea where I start looking for the problem?
>
> This is probably a difference b/w pyreadline (windows) and treadline
> (Linux). I gotta try it on Linux as well. ISTR that on linux, you
> didn't actually need to press backspace and erase the quote but could
> keep on typing letters as if the quote wasn't there.

As far as I remember, that used to work a number of revisions ago.
Now, the completion after the quote isn't being done properly.  For
example, if I type fun('/home<tab><tab> I see

In [1]: fun('/home/'
Display all 192 possibilities? (y or n)

but if I type fun('/home/≤tab>

In [1]: fun('/home/stefan/'

Maybe someone else on a linux machine can try this example and report
on what they see -- could be that my setup that is broken.

Cheers
Stéfan
(Continue reading)

Steve Lianoglou | 1 Nov 14:43

Re: Custom command completers implemented in SVN

Hi,

> As far as I remember, that used to work a number of revisions ago.
> Now, the completion after the quote isn't being done properly.  For
> example, if I type fun('/home<tab><tab> I see
>
> In [1]: fun('/home/'
> Display all 192 possibilities? (y or n)
>
> but if I type fun('/home/≤tab>
>
> In [1]: fun('/home/stefan/'
>
> Maybe someone else on a linux machine can try this example and report
> on what they see -- could be that my setup that is broken.

What Stefan is explaining happens exactly the same way on my OS X  
machine .. it's been like this for as long as I can remember,  
actually, but for the record I'm probably running on an svn-compilled  
ipython from about 3 weeks ago or so (it says 0.7.3 SVN) ...

I'm not quite sure what I'm missing with this new "Custom command  
completers" thing just yet .. I'll have to get the latest from svn to  
check it out.

-steve
Picon
Picon
Favicon

Re: Custom command completers implemented in SVN

On Wed, Nov 01, 2006 at 03:16:20PM +0200, Stefan van der Walt wrote:
> On Wed, Nov 01, 2006 at 03:05:57PM +0200, Ville M. Vainio wrote:
> > On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:
> > 
> > >I am running the latest ipython trunk on a standard Ubuntu Edgy
> > >installation, with no modifications to the default ipythonrc and a
> > >stock standard /etc/inputrc.
> > >
> > >Any idea where I start looking for the problem?
> >
> > This is probably a difference b/w pyreadline (windows) and treadline
> > (Linux). I gotta try it on Linux as well. ISTR that on linux, you
> > didn't actually need to press backspace and erase the quote but could
> > keep on typing letters as if the quote wasn't there.

Some more strange behaviour in the new completer -- on my machine, at
least, it won't run under emacs:

- emacs /tmp/blah.py
- C-c !
- At the ipython prompt, type 'import time'

and then

time.a<TAB><TAB>

which results in

---------------------------------------------------------------------------
exceptions.IndexError                      Traceback (most recent call last)
(Continue reading)

Brian Granger | 1 Nov 17:54
Picon

Re: Custom command completers implemented in SVN

Mine too!

On 11/1/06, Steve Lianoglou <lists.steve <at> arachnedesign.net> wrote:
> Hi,
>
> > As far as I remember, that used to work a number of revisions ago.
> > Now, the completion after the quote isn't being done properly.  For
> > example, if I type fun('/home<tab><tab> I see
> >
> > In [1]: fun('/home/'
> > Display all 192 possibilities? (y or n)
> >
> > but if I type fun('/home/≤tab>
> >
> > In [1]: fun('/home/stefan/'
> >
> > Maybe someone else on a linux machine can try this example and report
> > on what they see -- could be that my setup that is broken.
>
> What Stefan is explaining happens exactly the same way on my OS X
> machine .. it's been like this for as long as I can remember,
> actually, but for the record I'm probably running on an svn-compilled
> ipython from about 3 weeks ago or so (it says 0.7.3 SVN) ...
>
> I'm not quite sure what I'm missing with this new "Custom command
> completers" thing just yet .. I'll have to get the latest from svn to
> check it out.
>
> -steve
> _______________________________________________
(Continue reading)

Fernando Perez | 1 Nov 19:15
Picon
Gravatar

Re: Custom command completers implemented in SVN

On 11/1/06, Stefan van der Walt <stefan <at> sun.ac.za> wrote:

> As far as I remember, that used to work a number of revisions ago.
> Now, the completion after the quote isn't being done properly.  For
> example, if I type fun('/home<tab><tab> I see
>
> In [1]: fun('/home/'
> Display all 192 possibilities? (y or n)
>
> but if I type fun('/home/≤tab>
>
> In [1]: fun('/home/stefan/'
>
> Maybe someone else on a linux machine can try this example and report
> on what they see -- could be that my setup that is broken.

Stefan, I think you are mistaken, at least since quite a while.
Reverting back to 0.7.1:

IPython 0.7.1.fix1 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: fun('/home/'
Display all 204 possibilities? (y or n)

In [1]: fun('/home/fperez/'
Display all 204 possibilities? (y or n)
(Continue reading)

Picon
Picon
Favicon

Re: Custom command completers implemented in SVN

On Wed, Nov 01, 2006 at 11:15:45AM -0700, Fernando Perez wrote:
> >Maybe someone else on a linux machine can try this example and report
> >on what they see -- could be that my setup that is broken.
> 
> Stefan, I think you are mistaken, at least since quite a while.
> Reverting back to 0.7.1:
> 
> IPython 0.7.1.fix1 -- An enhanced Interactive Python.
> ?       -> Introduction to IPython's features.
> %magic  -> Information about IPython's 'magic' % functions.
> help    -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
> 
> In [1]: fun('/home/'
> Display all 204 possibilities? (y or n)
> 
> In [1]: fun('/home/fperez/'
> Display all 204 possibilities? (y or n)
> 
> In [1]: fun('/home/fperez/'

As I said originally, I wasn't sure whether this ever worked.  Clearly
it never did (I just reverted to 0.6.16_svn to make sure), so sorry
for all the noise! (interesting behaviour on Ville's machine, though)

> Basically, ever since the code has had the ability to close the quote
> mark on an unambiguous completion, it has worked this way.  This could
> be improved, but it would be /new/ functionality, not fixing a
> regression.  The analysis to do is to check whether the end of the
> completion is a filename or a non-empty directory.  If it's a
(Continue reading)


Gmane