[Top][All Lists]

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

Re: piping to octave

From: Jordi Gutierrez Hermoso
Subject: Re: piping to octave
Date: Thu, 8 Feb 2007 14:16:22 -0600

On 03/02/07, tr doug <address@hidden> wrote:
I'm very new to Octave and Linux(debian, X11, KDE).

ITYM, GNU/Linux... but I'm mostly just kidding. Mostly. ;-)
I usually like to edit and run my scripts from an editor like nEdit
or UltraEdit(when on windows).  I'm able to pipe my scripts into
octave and have my editor then display the text(stdout) outcome.

You do realise that you can open an xterm (probably Konsole in your
case), run Octave on it, open whatever else to edit your script, then
alt-tab to the terminal and type your script's name after you saved it
in your editor? Octave re-reads scripts by default unless they're
special system scripts, so you can see the effects of your work right
away. Octave is an interpreted language, after all.

If you want very similar (better, IMAO), functionality, try using GNU
Emacs. Debian has Emacs hooks for Octave, and it can open an Octave
shell within it. Do

  address@hidden:# aptitude install octave2.9-emacsen

(or octave2.1-emacsen, you get the idea.) You'll be especially
interested in the octave-send-* commands. Open your script from Emacs,
M-x (that is, hit alt-x) write octave-mode if Emacs for whatever
reason didn't recongise that you attempted to open an Octave script
(sometimes Emacs thinks that .m files are Objective-C files), and do
C-h (that is, ctrl-h), release Ctrl, then hit a. In the minibuffer at
the bottom of Emacs, type "octave", hit enter, and you'll get all of
the Octave-specific commands that are available in Emacs.

Emacs is notoriously difficult to get into, especially if you come
from the non-free world, but it is worth every second you spend
working through its tutorial. I remember complaining loudly and
dragging my feet each time I had to use it when I was learning it, but
now I'll do the same complaining if I have to edit any substantial
piece of text or code without using Emacs or at least Emacs-like keys
(btw, bash, the default shell in Debian and almost every other
GNU/Linux distribution, has Emacs-like keys enabled by default, so the
knowledge spent learning Emacs yields dividends in unexpected
places). Furthermore, moving your wrists away from the homerow keys
while editting is for chumps. :-) When you're ready, say goodbye to
the arrow keys and the Esc key.

Also, welcome to the editor wars, my friend. May you step into the
light of GNU and allow Emacs into your heart. Are you preaching it, oh
my potential sibling?  Are you typing in its holy name?

Here's a rude gesture to all the faithless users of heretic and
heathen editors! There is no editor but Emacs and rms is its original

Religiously yours,
- Jordi G. H.

(This email editted in The One True Editor using mail-mode, of course)

(And despite appearences, I wouldn't mind advertising blasphemous
editors, but I don't think they have extensive Octave modes available
in Debian. If anyone can correct me, feel free to do so.)

reply via email to

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