logo       

Re: __gnuplot_replot__ fails in octave-2.1.69: msg#00040

gnu.octave.bugs

Subject: Re: __gnuplot_replot__ fails in octave-2.1.69

On 21-Apr-2005, Joe Koski <jkoski11@xxxxxxxxxxx> wrote:

| Yes, but in your routines, and in my test, I didn't include the ();, so
| that's not the problem. My version didn't complain about the (); and issued
| the same error as without the parens. Thanks for pointing this out. I
| haven't been able to find a help file for __gnuplot_replot__.

OK, there was a bug in handling __gnuplot_replot__ without any
arguments.

Also, __gnuplot_replot__ with arguments (i.e., additional plot data)
is just broken, so I changed the warning message.

Please try the following patch.

I would also recommend using "replot" instead of using
__gnuplot_replot__ directly.

Thanks,

jwe


src/ChangeLog:

2005-04-27 John W. Eaton <jwe@xxxxxxxxxx>

* parse.y (make_plot_command): At this point, handle
__gnuplot_replot__ like a replot command.
(maybe_warn_replot_with_args): Print warnings for both replot and
__gnuplot_replot__.


Index: src/parse.y
===================================================================
RCS file: /usr/local/cvsroot/octave/src/parse.y,v
retrieving revision 1.224.2.10
diff -u -r1.224.2.10 parse.y
--- src/parse.y 27 Apr 2005 07:57:29 -0000 1.224.2.10
+++ src/parse.y 27 Apr 2005 20:14:39 -0000
@@ -1743,8 +1743,9 @@
return retval;
}

-// Print a warning if we are looking at a "replot" command with
-// arguments.
+// Print a warning if we are looking at a "replot" or
+// "__gnuplot_replot__" command with arguments.
+
static void
maybe_warn_replot_with_args (token *tok)
{
@@ -1757,10 +1758,12 @@
if (pttype == token::replot)
{
warned = true;
- warning ("Passing arguments to replot is deprecated and.");
- warning ("will not be allowed in a future version of Octave.");
- warning ("If you must have this functionality, use");
- warning ("__gnuplot_replot__ instead.");
+ warning ("replot no longer accepts arguments");
+ }
+ else if (pttype == token::gnuplot_replot)
+ {
+ warned = true;
+ warning ("__gnuplot_replot__ does not accept arguments");
}
}
}
@@ -1817,8 +1820,15 @@
lexer_flags.in_plot_range = false;
lexer_flags.in_plot_using = false;
lexer_flags.in_plot_style = false;
+
+ int nd = 0;
+
+ if (tok->pttype () == token::gnuplot_replot)
+ nd = token::replot;
+ else
+ nd = tok->pttype ();

- return new tree_plot_command (list, range, tok->pttype ());
+ return new tree_plot_command (list, range, nd);
}

static tree_expression *



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise