How to get Octave's plot to work under emacs? - emacs

Using octave in a terminal window
x=1:10;
plot(x);
works fine, produces a plot window which is zoomable etc.
running octave under emacs, the plot appears, but the plot window is hung and you can't zoom. If you execute plot(x); again, the window disappears.
I'm using Debian Jessie, with GNU Emacs 24.3.1 and GNU Octave, version 3.8.1.
To get it to work at all I had to make a .octaverc to set the prompt.
$ cat ~/.octaverc
PS1(">> ")

It seems that the problem is caused by octave-mode running octave with the no-line-editing switch. You can just hack this out of the compiled lisp file and everything works fine!
On my system:
cd /usr/share/emacs/24.4/lisp/progmodes
sudo vi octave.elc
change --no-line-editing to --line-editing directly in the .elc file
restart emacs and everything should be fine.

Related

Run MATLAB in command line allowing display of plots

To run MATLAB on Linux in the command line I use the following:
matlab -nodisplay
But I guess this does not allow windows of plots to open either, because the following command has no output:
plot(X,Y)
How to allow only graphs and plots to display when running MATLAB from the command line?
Under Linux, to run MATLAB in a terminal window use the -nodesktop option. It causes MATLAB to start without the GUI, with all text input and output to happen through the terminal window. But it does not disable the JVM software altogether and so allows interactive figure windows to be displayed.
The -nojvm option disables the JVM software, disallowing all Java-based components of MATLAB, including figure windows. The -nodisplay option disables al graphical display output, but doesn't disable the JVM.
For more details, see the documentation.

Execution of bash script differs when runned from Matlab and Terminal

I have a bash script and I want to execute it from Matlab 2014b in Ubuntu 14.04. When I launch it from terminal (that I start from os) everything is ok. I try to launch it from Matlab like this
!./script.sh
It executes but cannot open image files that have to be loaded.
More than that if I launch terminal window from Matlab
!./gnome-terminal
and use it to launch the script I got the same 'file not found' problem. Text files are accessed with no problem. Path to the images are global. To load images opencv library is used. My guess is that for some reason opencv works different from Matlab, but I don't know what to do.
I spend a lot of time to figure out the problem, but still cannot resolve it. I will appreciate any advise or help.
LD_LIBRARY_PATH of Matlab shell differs from one of teminal shell. Following command in Matlab:
setenv('LD_LIBRARY_PATH', <content of LD_LIBRARY_PATH from terminal>)
solves the problem.
Content of LD_LIBRARY_PATH from terminal is printed by
echo $LD_LIBRARY_PATH

auto-completion in MATLAB with nodesktop option

I'm using MATLAB R2012b on a win7 computer.
When I launch MATLAB from cmd using matlab -nodesktop, the tab is disabled for auto-completion in command line window. So I have to type the full name of a file, a path or a function.
When I open GUI and set as this link says, (http://www.mathworks.com/company/newsletters/articles/avoiding-repetitive-typing-with-tab-completion.html) auto-completion works fine in GUI. But it doesn't work when -nodesktop option is used.
I used to use R2014b on a Ubuntu machine with -nodesktop option, the auto-completion function works fine.
Is there any way to enable auto-completion in cmd when -nodesktop is chosen.

emacs ess julia hangs on "using DataFrames"

I'm trying to follow a very simple example to get started with Julia using ESS. But the very first command:
using DataFrames
results in emacs' spinning slash, nothing else happens, and the command prompt is not restored. This is emacs 24.3.1 on OS X 10.8.5, ess-20140304.2344 installed via emacs' package system. In my init.el, I have
(require ess-site)
(setq inferior-julia-program-name
"/Applications/Julia/Contents/Resources/julia/bin/julia-basic")
Note: /Applications/Julia is a softlink to /Applications/Julia-0.2.1.app
I tried the "using" command with the Julia.app terminal and it worked fine.
Tried it using julia/bin/julia-basic in an iTerm2 session and it hung. Tried julia/bin/julia-readline in an iTerm2 session and it hung. Tried julia/bin/julia and it worked in iTerm2 but not in emacs, which is strange since that's just a link to julia-readline. Tried putting julia/bin on emacs' exec-path. Nothing seems to work.
Any suggestions?

How do you get ediff + hg working in emacs 23.2 for mac?

Im using the emacs binary from http://emacsformacosx.com/
When I'm editing a file in a mercurial source directory and run "ediff-revision" I get:
"File /the/file/im/editing.py is not under version control"
This command works on the vanilla windows distribution and also with aquamacs, is there something I need to do for vanilla GNU Emacs for mac to work correctly?
I've tried it with only this in my .emacs
(require 'ediff)
So Mercurial for OSX installs itself in /usr/local/bin It seems emacs knows to look there in the Aquamacs and the command line versions. To get it working for GNU emacs I made a symbolic link of /usr/local/bin/hg in /usr/bin After that, every thing started working just fine.
# Open Terminal
cd /usr/bin
sudo ln -s /usr/local/bin/hg hg
Another method I ran across was to set the variable vc-path, however I couldn't get that solution to work. Thanks for those that took a stab at this.
I had to do 2 things to get it working right for me.
First, make sure Emacs' vc system can see hg:
(add-to-list 'exec-path "/usr/local/bin")
And second, make sure that hg can be found from the shell:
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
I faced the similar situation and tell you my story.
Typing C-x v = (vc-diff) on a buffer I have been working on I got:
File is not under version control
What? Then I came here, checked every comment posted above, and found nothing irregular.
Hmm... What is wrong? The status bar shows like this:
U:--- xxx.py 84% (500, 38) (Py Outl)
I tried to open another file in the same directory by typing C-x d RET (dired), then g to update the buffer, C-n to move to another file, e to open it. Well, this time the status bar shows like this:
-:--- yyy.py All (1, 0) Hg-0 (Py Outl)
Now I got a point! Firstly, I had started editing the first file with Aquamacs (emacs variant for Mac OS). Secondly, I did hg init, hg ci -m 'Imported the first version' .
Okay, C-x k (kill-buffer) to close xxx.py and then open it again. Bingo! Now the status bar shows like this:
-:--- xxx.py Bot (500, 0) Hg:0 (Py Outl)
Everything works fine now. You have a nice day!