patchGNU Octave - Patches: patch #7847, Make gnuplot Qt terminal default...

 
 

patch #7847: Make gnuplot Qt terminal default for GUI/IDE via environment variable

Submitter:  Dan Sebald <sebald>
Submitted:  Thu 13 Sep 2012 06:16:19 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 22 Sep 2012 02:20:29 PM UTC, comment #5: 

To avoid the gnuplot error, I suggest not defining GNUTERM=qt before checking that gnuplot supports the qt terminal.  The gnuplot toolkit includes a private function _gnuplot_has_terminal_.m which will detect if gnuplot includes support for the qt terminal.


        .scripts/plot/private/__gnuplot_has_terminal__.m


To make use of this for the gui, we may need to make the function public.  In any event, if it is in your path, all you need to do is


        has_qt = __gnuplot_has_terminal__ ("qt");


Ben

Ben Abbott <bpabbott>
Group Member
Sat 22 Sep 2012 06:52:12 AM UTC, comment #4: 

I'm going to open this discussion to the maintainers list because it would be nice to see generally how people feel the octave-gui vs. octave-cli figure should behave.

I think the patch you submitted is probably where we will end up, but the ramification is that using the pre-defined GNUTERM variable might mean that the Qt terminal for the GUI/IDE is missed when the Octave developers preference is to use Qt.

We did need a change like yours for replacing "putenv" with something that also compiles under Windows.

More on the discussion list...

Dan Sebald <sebald>
Sat 22 Sep 2012 03:00:33 AM UTC, comment #3: 

I just ran into this change tonight. I do not have the "qt" terminal installed so I see an annoying warning but it does properly fall back to "x11".

So firstly, for you gnuplot experts, is it possible to suppress this warning message from gnuplot:


Unknown or ambiguous terminal name 'qt'


And secondly, how about the attached change to respect the GNUTERM variable if it is already in the environment?

(file #26616)

Mike Miller <mtmiller>
Group Member
Thu 13 Sep 2012 04:35:22 PM UTC, comment #2: 

Thanks, I've pushed and merged your change:

http://hg.savannah.gnu.org/hgweb/octave/graph/e4ecc18a24cc

In the future, it would be easier to apply if you provided a commit message and you used "hg export" to produce the change.

http://hg.savannah.gnu.org/hgweb/octave/rev/860b4edb0bea
http://wiki.octave.org/Commit_message_guidelines

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 13 Sep 2012 11:59:41 AM UTC, comment #1: 

The changes look good to me.

Ben Abbott <bpabbott>
Group Member
Thu 13 Sep 2012 06:16:19 AM UTC, original submission:  

This patch is a few small changes to make GUI/IDE+O use the Qt terminal by setting the environment variable GNUTERM (which gnuplot searches for).  Most of this is actually clean up of the code that establishes default terminal for Octave so that it uses the already existing gnuplot process rather than creating one or two more to check for availability of terminals.  If you want to check what I mean, try the latest version with:

env GNUTERM="foo" octave-cli

then plot something at the command line.  gnuplot warning messages will keep popping up with each plot command because new instances are created each time.

After the patch, launching the GUI/IDE+O will set the GNUTERM environment variable.  Octave will attempt to use the GNUTERM setting, but if that terminal doesn't exist will fall back on the current defaults.  It's only the first plot command for which

Unknown or ambiguous terminal name 'qt'

will appear on the screen via gnuplot.

This is a good setup.  GUI/IDE+O will only use gnuplot Qt if it were built into one's version of gnuplot.  So some testers should emerge who begin simply by running gnuplot Qt term on their system which means debugging Windows Qt can be deferred to testers running the gnuplot demos.  If the testers can't get it to work, just rebuild gnuplot without Qt support, which is easy to do.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #26616:  respect-gnuterm.diff added by mtmiller (516B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-22 mtmiller Attached File- Added respect-gnuterm.diff, #26616
    2012-09-13 jordigh StatusNone Done
        Open/ClosedOpen Closed
    2012-09-13 sebald Attached File- Added octave-gnuplot_qt_for_ide-2012sep13.patch, #26544

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code