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: John W. Eaton
Subject: Re: How do I paste code at the Octave prompt?
Date: Thu, 16 Mar 2006 09:19:39 -0500

On 16-Mar-2006, Miquel Cabanas wrote:

| 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?

I think it would also be worth mentioning that instead of changing the
behavior of readline, many editors can be configured to insert the
appropriate number of space characters for TAB.

jwe



-------------------------------------------------------------
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]