|
From: Ethan M. <merritt@u.washington.edu> - 2005-05-10 18:25:12
|
> set term post
> set output 'result.ps'
> plot 'foo'
> set term win
> plot 'baz' using 1:2
> (then result.ps becomes blank
> This is a rather non natural behavior that must trick a quite a few
> users.
It does seem to be a recurring complaint.
Can anyone see bad side effects if we were to
1) Give win and x11 an explicit term->flags TERM_NO_OUTFILE
(aquaterm? vgagl? others?)
2) Modify term_init() to check for TERM_NO_OUTFILEE, and if present
then *close* the output file rather than re-opening it; i.e.
call term_close_output() rather than term_set_output().
The following proof-of-principle test works for x11, but I don't
know what wrinkles may exist in doing the same for win.trm
--- gnuplot/src/term.c 2005-04-28 14:34:35.000000000 -0700
+++ gnuplot-cvs/src/term.c 2005-05-10 11:16:04.378445568 -0700
@@ -483,6 +483,10 @@
* resulted in output files being truncated
*/
+ /* If this is an interactive terminal, close previous output file */
+ if (outstr && !strncmp(term->name,"x11",3))
+ term_close_output();
+
if (outstr &&
(((term->flags & TERM_BINARY) && !opened_binary) ||
((!(term->flags & TERM_BINARY) && opened_binary)))) {
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|