RE: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Lars.Ericson
Hi Eli and Michael,

I can get plot window to show if I do ESC-X Shell and then run Octave in the shell with --line-editing and --interactive (note Octave 3.6.2 is confused by --i alone).  Note with Qt graphics, the plot window is unhappy, it shows the expected  graph and then goes into a "not responding" state where it doesn't accept mouse input.  Killing the plot window kills Octave in the shell.   If I restart Octave in the Shell window and switch graphics package to gnuplot with graphics_toolkit('gnuplot'), this problem goes away, so it is a feature of Qt graphics, not Emacs or Octave.

If I want to fix "run-octave", it does not work to add the following to my ~/.emacs file:

        (setq inferior-octave-startup-args '("--line-editing" "-i"))

This is because the run-octave command has "--no-line-editing" buried in the code, so what you get is this set of arguments inside of octave:

octave.exe> argv()
ans =
{
  [1,1] = -i
  [2,1] = --no-line-editing
  [3,1] = --line-editing
  [4,1] = -i
}

I then tried changing the code in emacs-24.2/lisp/progmodes/octave-inf.el on line 187 from

               (append (list "-i" "--no-line-editing")

to

               (append (list "--interactive" "--line-editing")

When I do this in a newly started Emacs, I get error "No such directory via CDPATH environment variable" and no Octave.  However if I do "run-octave" again in the same Emacs, the *Interior Octave* window comes up, and plots work.   If I revert to "--no-line-editing ", the problem goes away.  So that is a mystery but at least now I can get my plots.

So the remaining questions are:

1. Why does changing "no-line-editing" to "line-editing" cause me to get "No such directory via CDPATH" error?  There is a thread for this:  https://mailman.cae.wisc.edu/pipermail/help-octave/2005-August/017741.html

2. Why does QT freeze up and gnuplot doesn't?

Thanks,
Lars Ericson
[hidden email]

-----Original Message-----
From: Eli Zaretskii [mailto:[hidden email]]
Sent: Monday, October 22, 2012 12:56 PM
To: Ericson, Lars
Cc: [hidden email]
Subject: Re: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

> From: Lars Ericson <[hidden email]>
> Date: Mon, 22 Oct 2012 13:43:09 +0000 (UTC)
>
> The pipes idea is confirmed by Michael Goffioul on [hidden email].  He says:
>
> Yes, that's most probably the problem. FLTK and Qt backend uses the
> readline event loop to run events and/or interact with the graphics
> backend. If readline is not used, like when running octave over pipes,
> those graphics backend won't work. You may force readline usage with
> the flags: --line- editing -i

So did those switches solve the problem?
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

RE: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Lars.Ericson
Actually sorry, it only works if you run octave under with --interactive --line-editing ESC-X shell, even with args corrected in run-octave mode, I don't get plots, even if the switches are set correctly.  I have verified with argv() that both shell and run-octave versions of octave have same arguments:

octave.exe> argv()
argv()
ans =
{
  [1,1] = --interactive
  [2,1] = --line-editing
}

So it is something about run-octave versus shell windows that is different.

Very confusing!!!


-----Original Message-----
From: Ericson, Lars
Sent: Monday, October 22, 2012 2:27 PM
To: 'Eli Zaretskii'; 'Michael Goffioul'
Cc: [hidden email]; [hidden email]
Subject: RE: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Hi Eli and Michael,

I can get plot window to show if I do ESC-X Shell and then run Octave in the shell with --line-editing and --interactive (note Octave 3.6.2 is confused by --i alone).  Note with Qt graphics, the plot window is unhappy, it shows the expected  graph and then goes into a "not responding" state where it doesn't accept mouse input.  Killing the plot window kills Octave in the shell.   If I restart Octave in the Shell window and switch graphics package to gnuplot with graphics_toolkit('gnuplot'), this problem goes away, so it is a feature of Qt graphics, not Emacs or Octave.

If I want to fix "run-octave", it does not work to add the following to my ~/.emacs file:

        (setq inferior-octave-startup-args '("--line-editing" "-i"))

This is because the run-octave command has "--no-line-editing" buried in the code, so what you get is this set of arguments inside of octave:

octave.exe> argv()
ans =
{
  [1,1] = -i
  [2,1] = --no-line-editing
  [3,1] = --line-editing
  [4,1] = -i
}

I then tried changing the code in emacs-24.2/lisp/progmodes/octave-inf.el on line 187 from

               (append (list "-i" "--no-line-editing")

to

               (append (list "--interactive" "--line-editing")

When I do this in a newly started Emacs, I get error "No such directory via CDPATH environment variable" and no Octave.  However if I do "run-octave" again in the same Emacs, the *Interior Octave* window comes up, and plots work.   If I revert to "--no-line-editing ", the problem goes away.  So that is a mystery but at least now I can get my plots.

So the remaining questions are:

1. Why does changing "no-line-editing" to "line-editing" cause me to get "No such directory via CDPATH" error?  There is a thread for this:  https://mailman.cae.wisc.edu/pipermail/help-octave/2005-August/017741.html

2. Why does QT freeze up and gnuplot doesn't?

Thanks,
Lars Ericson
[hidden email]

-----Original Message-----
From: Eli Zaretskii [mailto:[hidden email]]
Sent: Monday, October 22, 2012 12:56 PM
To: Ericson, Lars
Cc: [hidden email]
Subject: Re: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

> From: Lars Ericson <[hidden email]>
> Date: Mon, 22 Oct 2012 13:43:09 +0000 (UTC)
>
> The pipes idea is confirmed by Michael Goffioul on [hidden email].  He says:
>
> Yes, that's most probably the problem. FLTK and Qt backend uses the
> readline event loop to run events and/or interact with the graphics
> backend. If readline is not used, like when running octave over pipes,
> those graphics backend won't work. You may force readline usage with
> the flags: --line- editing -i

So did those switches solve the problem?
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Jordi Gutiérrez Hermoso-2
In reply to this post by Lars.Ericson
On 22 October 2012 14:27,  <[hidden email]> wrote:

> If I want to fix "run-octave", it does not work to add the following to my ~/.emacs file:
>
>         (setq inferior-octave-startup-args '("--line-editing" "-i"))

Why are you using run-octave? This script is for testing Octave
in-place after you compiled it but before you install it, which is why
it has its own set of compile options. You're working on your own
compiled version of Octave? Then finish the installation procedure
first.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

RE: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Lars.Ericson
Octave is an interactive math language.  I am following these instructions to run it under Emacs:

http://www.gnu.org/software/octave/doc/interpreter/Running-Octave-From-Within-Emacs.html


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jordi Gutiérrez Hermoso
Sent: Monday, October 22, 2012 2:37 PM
To: Ericson, Lars
Cc: [hidden email]; [hidden email]; [hidden email]; [hidden email]
Subject: Re: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

On 22 October 2012 14:27,  <[hidden email]> wrote:

> If I want to fix "run-octave", it does not work to add the following to my ~/.emacs file:
>
>         (setq inferior-octave-startup-args '("--line-editing" "-i"))

Why are you using run-octave? This script is for testing Octave in-place after you compiled it but before you install it, which is why it has its own set of compile options. You're working on your own compiled version of Octave? Then finish the installation procedure first.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: [h-e-w] Plot in Octave under Gnu Emacs on Windows XP doesn't work

Jordi Gutiérrez Hermoso-2
On 22 October 2012 14:39,  <[hidden email]> wrote:
> Octave is an interactive math language.  I am following these instructions to run it under Emacs:
>
> http://www.gnu.org/software/octave/doc/interpreter/Running-Octave-From-Within-Emacs.html

Oh, the Emacs run-octave command, not the run-octave script. Sorry.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave