help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I paste code at the Octave prompt?


From: Miquel Cabanas
Subject: Re: How do I paste code at the Octave prompt?
Date: Thu, 16 Mar 2006 14:30:03 +0100

it works like a charm. Tested on Debian with copy&paste of tabbed code
from gedit.

I think it's worth a mention in the "What features are unique to Octave?
| Command and variable name completion" section in the FAQ. A proposed
text is,

When pasting (*) code from an editor, the TAB characters in it, used for
instance to indent lines, could fool Octave into displaying annoying
completion questions. To avoid this problem, you can replace TAB by
[CTRL][TAB] by running the code (**) below at the command prompt (beware
of the dots)

        cat > ~/.octaveinputrc << .
        TAB: ""
        "\C-\t": complete
        .

        cat >> ~/.octaverc << .
        read_readline_init_file('~/.octaveinputrc')
        .

The change will be available in your next Octave session. To make it
available in a running session type,

        octave> read_readline_init_file('~/.octaveinputrc')

(*) does it also applies to code in functions or scripts?
(**) any objection Joan?

Miquel

On Thu, 2006-03-16 at 13:40 +0100, Joan Picanyol i Puig wrote:
> * Miquel Cabanas <address@hidden> [20060316 13:07]:
> > A possible fix at Octave's level could be to use a combination of keys
> > to access this readline feature, ie [ctrl][tab] and ignore all other
> > [tab] instances, but I do not know whether this can be easily done and
> > all the implications of such change.
> 
> readline is typically configured via ~/.inputrc, and Octave has a
> read_readline_init_file() builtin. So I suggest something like (copy &
> paste in a terminal):
> 
> cat > ~/.octaveinputrc << .
> TAB: ""
> "\C-\t": complete
> .
> cat >> ~/.octaverc << .
> read_readline_init_file('~/.octaveinputrc')
> .
> 
> which will move completion from TAB to Ctrl-TAB
> 
> qvb
> --
> pica
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]