[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command_editor and generating completions
From: |
Rik |
Subject: |
Re: command_editor and generating completions |
Date: |
Sun, 17 May 2009 11:43:50 -0700 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090318) |
>
> ------------------------------------------------------------------------
>
> Subject:
> command_editor and generating completions
> From:
> John Swensen <address@hidden>
> Date:
> Fri, 15 May 2009 16:21:34 -0400
> To:
> Octave Maintainers List <address@hidden>
>
> To:
> Octave Maintainers List <address@hidden>
>
>
> I just found out about an add-on to GtkSourceView that does
> autocompletion. So, I have been looking into how Octave uses GNU
> readline to do completion from the command line. It looks like there
> are a lot of utility functions already there to make my life easier,
> but have a couple of questions about how the
> command_editor::generate_*_completions() functions work. I'm assuming
> that as with everything else, this interaction with readline and the
> list of function defined in Octave is *not* threadsafe? My only
> problem is that this autocompletion is for the editor and it would
> stink if auto-completion wasn't available while Octave is currently
> executing. I often start a script running, then go off and edit some
> other file while it is running. Since my threadsafe workaround so far
> has been to only interact with the internals of Octave during the
> readline idle event loop, I can't use this while a function/script is
> executing.
>
> So, my question is whether there is a way to get a snapshot of
> whatever readline is storing so that I can reference this copy while
> the Octave interpreter is running? What are the implications of
> calling GNU readline functions for finding possible completions while
> in the middle of executing a script?
>
5/17/09
John,
Before you go borrowing code extensively from Octave you might want to
wait for a recent bug in auto-completion to be fixed. I reported on
this mailing list just a week ago that Octave is now incorrectly
generating auto-completions for bogus words like "foobar". See "Bug in
command line completion" on 5/11/09.
Cheers,
Rik