flyingfoxlee
flyingfoxlee

Reputation: 1794

Running octave in Emacs

I am using run-octave in Emacs to trigger octave. Something is acting abnormally. Every time I hit TAB to complete, there would be a tailing ^M; If I edit a .m file using edit a.m, it would start a new frame instead of a new buffer and the prompt is waiting for the closure of that frame so it would not respond to any input. How could I configure .emacs so that run-octave would behave normally?

Any comment is appreciated!

Upvotes: 1

Views: 2431

Answers (1)

Rupert Swarbrick
Rupert Swarbrick

Reputation: 2803

You seem to have two problems. I'm not sure about the trailing ^M, which seems to be caused by some sort of Windows/Unix CR/LF problem, but maybe I can help with the second problem.

The edit command uses the EDITOR environment variable to decide what to run. It seems that yours is either set to emacsclient or has defaulted to it. You haven't said whether you're on Unix or Windows, so I'm going to assume the former: you'll have to change this a bit for Windows.

To avoid the waiting thing, try running octave with a different EDITOR. For example, try out running

EDITOR='emacsclient -n' octave

When you type edit foo, it should bring up an Emacs buffer (if you want a new frame as well, use -c too) but not wait until you're done.

If this fixes things for you, you could change your ~/.bashrc to include the line

export EDITOR='emacsclient -n'

Upvotes: 4

Related Questions