# HG changeset patch # User Rik # Date 1442922647 25200 # Node ID 1f330d33388fd65c5380a35c6632eab48103115d # Parent bb09279e5c994f7d6417c32bbd9a0823a4c93b8b# Parent caa5de39147e296f545359d7a2ddcc3fae4e17d3 maint: Periodic merge of stable to default. diff -r bb09279e5c99 -r 1f330d33388f NEWS --- a/NEWS Tue Sep 22 11:25:04 2015 +0200 +++ b/NEWS Tue Sep 22 04:50:47 2015 -0700 @@ -322,6 +322,7 @@ finite | isfinite fmod | rem fnmatch | glob or regexp + gmap40 | ---- loadaudio | audioread luinc | ilu or ichol mouse_wheel_zoom | mousewheelzoom axes property diff -r bb09279e5c99 -r 1f330d33388f doc/interpreter/image.txi --- a/doc/interpreter/image.txi Tue Sep 22 11:25:04 2015 +0200 +++ b/doc/interpreter/image.txi Tue Sep 22 04:50:47 2015 -0700 @@ -196,15 +196,6 @@ @DOCSTRING(contrast) -An additional colormap is @code{gmap40}. This code map contains only -colors with integer values of the red, green and blue components. This -is a workaround for a limitation of gnuplot 4.0, that does not allow the color -of line or patch objects to be set. @code{gmap40} is chiefly useful to gnuplot -4.0 users, and particularly in conjunction with the @var{bar}, @var{surf}, -and @var{contour} functions. - -@DOCSTRING(gmap40) - The following three functions modify the existing colormap rather than replace it. diff -r bb09279e5c99 -r 1f330d33388f doc/interpreter/vectorize.txi --- a/doc/interpreter/vectorize.txi Tue Sep 22 11:25:04 2015 +0200 +++ b/doc/interpreter/vectorize.txi Tue Sep 22 04:50:47 2015 -0700 @@ -455,25 +455,19 @@ @noindent that may have relied on matrices of different size producing an error. -Due to how broadcasting changes semantics with older versions of Octave, -by default Octave warns if a broadcasting operation is performed. To -disable this warning, refer to its ID (@pxref{XREFwarning_ids,,warning_ids}): +Because such operation is now valid Octave syntax, this will no longer +produce an error. Instead, the following code should be used: @example -warning ("off", "Octave:broadcast"); +@group +if (isequal (size (a), size (b))) + c = a .* b; +else + c = a .* a; +endif +@end group @end example -@noindent -If you want to recover the old behavior and produce an error, turn this -warning into an error: - -@example -warning ("error", "Octave:broadcast"); -@end example - -@noindent -For broadcasting on scalars that worked in previous versions of Octave, -this warning will not be emitted. @node Function Application @section Function Application diff -r bb09279e5c99 -r 1f330d33388f libgui/src/octave-cmd.cc --- a/libgui/src/octave-cmd.cc Tue Sep 22 11:25:04 2015 +0200 +++ b/libgui/src/octave-cmd.cc Tue Sep 22 04:50:47 2015 -0700 @@ -78,5 +78,5 @@ command_editor::set_initial_input (pending_input); command_editor::redisplay (); - command_editor::interrupt (); + command_editor::accept_line (); } diff -r bb09279e5c99 -r 1f330d33388f libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Tue Sep 22 11:25:04 2015 +0200 +++ b/libinterp/octave-value/ov-fcn-handle.cc Tue Sep 22 04:50:47 2015 -0700 @@ -1856,8 +1856,8 @@ functions are ignored in the lookup.\n\ \n\ Note: @code{str2func} does not currently accept strings which define\n\ -anonymous functions (those which begin with @samp{a}).\n\ -Use @code{eval (@var{str})} as a replacement.\n\ +anonymous functions (those which begin with @samp{@@}).\n\ +Use @w{@code{eval (@var{str})}} as a replacement.\n\ @seealso{func2str, inline}\n\ @end deftypefn") { diff -r bb09279e5c99 -r 1f330d33388f libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Tue Sep 22 11:25:04 2015 +0200 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Sep 22 04:50:47 2015 -0700 @@ -866,7 +866,10 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - error ("nargout: invalid function name: %s", name.c_str ()); + { + error ("nargin: invalid function name: %s", name.c_str ()); + return retval; + } } octave_function *fcn_val = func.function_value (); @@ -973,7 +976,10 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - error ("nargout: invalid function name: %s", name.c_str ()); + { + error ("nargout: invalid function name: %s", name.c_str ()); + return retval; + } } if (func.is_inline_function ()) diff -r bb09279e5c99 -r 1f330d33388f libinterp/octave.cc --- a/libinterp/octave.cc Tue Sep 22 11:25:04 2015 +0200 +++ b/libinterp/octave.cc Tue Sep 22 04:50:47 2015 -0700 @@ -714,7 +714,8 @@ octave_print_terse_usage_and_exit (); } - an_octave_program = (script_file || ! code_to_eval.empty ()) && ! persist; + an_octave_program = ((script_file || ! code_to_eval.empty ()) + && ! persist && ! traditional); } diff -r bb09279e5c99 -r 1f330d33388f scripts/plot/draw/private/__ezplot__.m --- a/scripts/plot/draw/private/__ezplot__.m Tue Sep 22 11:25:04 2015 +0200 +++ b/scripts/plot/draw/private/__ezplot__.m Tue Sep 22 04:50:47 2015 -0700 @@ -71,35 +71,13 @@ fun = varargin{1}; if (ischar (fun)) if (exist (fun, "file") || exist (fun, "builtin")) - fun = inline ([fun "(t)"]); + fun = str2func (fun); # convert to function handle else - fun = vectorize (inline (fun)); - endif - argids = argnames (fun); - if (isplot && length (argids) == 2) - nargs = 2; - elseif (numel (argids) != nargs) - error ("%s: expecting a function of %d arguments", ezfunc, nargs); + fun = vectorize (inline (fun)); # convert to inline function endif - fstr = formula (fun); - if (isplot) - xarg = argids{1}; - if (nargs == 2) - yarg = argids{2}; - else - yarg = ""; - endif - elseif (isplot3) - xarg = "x"; - yarg = "y"; - elseif (ispolar) - xarg = ""; - yarg = ""; - else - xarg = argids{1}; - yarg = argids{2}; - endif - elseif (strcmp (typeinfo (fun), "inline function")) + endif + + if (strcmp (typeinfo (fun), "inline function")) argids = argnames (fun); if (isplot && length (argids) == 2) nargs = 2; @@ -133,6 +111,11 @@ fstr = fstr(idx+2:end); # remove '@(x) ' from string name else args = {"x"}; + try + if (builtin ("nargin", fun) == 2) + args{2} = "y"; + endif + end_try_catch endif if (isplot && length (args) == 2) nargs = 2; diff -r bb09279e5c99 -r 1f330d33388f scripts/time/asctime.m --- a/scripts/time/asctime.m Tue Sep 22 11:25:04 2015 +0200 +++ b/scripts/time/asctime.m Tue Sep 22 04:50:47 2015 -0700 @@ -19,14 +19,14 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} asctime (@var{tm_struct}) ## Convert a time structure to a string using the following -## format: @qcode{"ddd mmm mm HH:MM:SS yyyy"}. +## format: @qcode{"ddd mmm mm HH:MM:SS yyyy@xbackslashchar{}n"}. ## ## For example: ## ## @example ## @group ## asctime (localtime (time ())) -## @result{} "Mon Feb 17 01:15:06 1997" +## @result{} "Mon Feb 17 01:15:06 1997@xbackslashchar{}n" ## @end group ## @end example ## @@ -51,6 +51,8 @@ %! t = time (); %! assert (strcmp (asctime (localtime (t)), ctime (t))); +%!assert (asctime (localtime (time ()))(end), "\n") + %!error asctime () %!error asctime (1, 2) diff -r bb09279e5c99 -r 1f330d33388f scripts/time/ctime.m --- a/scripts/time/ctime.m Tue Sep 22 11:25:04 2015 +0200 +++ b/scripts/time/ctime.m Tue Sep 22 04:50:47 2015 -0700 @@ -28,7 +28,7 @@ ## @example ## @group ## ctime (time ()) -## @result{} "Mon Feb 17 01:15:06 1997" +## @result{} "Mon Feb 17 01:15:06 1997@xbackslashchar{}n" ## @end group ## @end example ## @seealso{asctime, time, localtime} @@ -51,6 +51,8 @@ %! t = time (); %! assert (strcmp (asctime (localtime (t)), ctime (t))); +%!assert (ctime (time ())(end), "\n") + %!error ctime () %!error ctime (1, 2)