# HG changeset patch # User John W. Eaton # Date 1548162475 18000 # Node ID a7d56e0a5c8c93e30044de2e682f64d7fdc72621 # Parent ec3c4f31823bac27fb3c7df1eed90b03cd5b5948# Parent 088b8a2dcb0672a230fe760d4fc6092ad257dbf2 maint: Merge stable to default. diff -r ec3c4f31823b -r a7d56e0a5c8c doc/interpreter/geometry.txi --- a/doc/interpreter/geometry.txi Tue Jan 22 07:27:03 2019 +0100 +++ b/doc/interpreter/geometry.txi Tue Jan 22 08:07:55 2019 -0500 @@ -313,7 +313,8 @@ @float Figure,fig:voronoi @center @image{voronoi,4in} -@caption{Delaunay triangulation and Voronoi diagram of a random set of points} +@caption{Delaunay triangulation (blue lines) and Voronoi diagram (red lines) +of a random set of points} @end float @end ifnotinfo diff -r ec3c4f31823b -r a7d56e0a5c8c doc/interpreter/geometryimages.m --- a/doc/interpreter/geometryimages.m Tue Jan 22 07:27:03 2019 +0100 +++ b/doc/interpreter/geometryimages.m Tue Jan 22 08:07:55 2019 -0500 @@ -51,7 +51,8 @@ yc = r * cos (pi*pc) + c(2); plot (xc, yc, "g-", "LineWidth", 3); axis ([0, 1, 0, 1]); - legend ("Delaunay Triangulation", "Voronoi Diagram"); + set (gca, "dataaspectratio", [1, 1, 1], + "plotboxaspectratio", [1, 1, 1]); print (outfile, d_typ); elseif (strcmp (nm, "triplot")) rand ("state", 2) diff -r ec3c4f31823b -r a7d56e0a5c8c doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi Tue Jan 22 07:27:03 2019 +0100 +++ b/doc/interpreter/plot.txi Tue Jan 22 08:07:55 2019 -0500 @@ -1071,8 +1071,9 @@ hold on; plot (x, x, "r"); axis ([0, 3, 0, 1]); -text (0.65, 0.6175, ['$\displaystyle\leftarrow x = @{2 \over \sqrt@{\pi@}@}'... - '\int_@{0@}^@{x@} e^@{-t^2@} dt = 0.6175$'], +text (0.65, 0.6175, ... + ['$\displaystyle\leftarrow x = @{2 \over \sqrt@{\pi@}@}'... + '\int_@{0@}^@{x@} e^@{-t^2@} dt = 0.6175$'], "interpreter", "latex"); xlabel ("x"); ylabel ("erf (x)"); diff -r ec3c4f31823b -r a7d56e0a5c8c doc/interpreter/strings.txi --- a/doc/interpreter/strings.txi Tue Jan 22 07:27:03 2019 +0100 +++ b/doc/interpreter/strings.txi Tue Jan 22 08:07:55 2019 -0500 @@ -256,8 +256,9 @@ @itemize @bullet @item All string concatenation functions except @code{cstrcat} -convert numerical input into character data by taking the corresponding ASCII -character for each element, as in the following example: +convert numerical input into character data by taking the corresponding UTF-8 +character for each element (or multi-byte sequence), as in the following +example: @example @group @@ -266,6 +267,10 @@ @end group @end example +For conversion between locale encodings and UTF-8, see +@ref{XREFunicode2native,,unicode2native} and +@ref{XREFnative2unicode,,native2unicode}. + @item @code{char} and @code{strvcat} concatenate vertically, while @code{strcat} and @code{cstrcat} concatenate @@ -363,13 +368,13 @@ @node Converting Numerical Data to Strings @subsection Converting Numerical Data to Strings Apart from the string concatenation functions (@pxref{Concatenating Strings}) -which cast numerical data to the corresponding ASCII characters, there are -several functions that format numerical data as strings. @code{mat2str} and -@code{num2str} convert real or complex matrices, while @code{int2str} converts -integer matrices. @code{int2str} takes the real part of complex values and -round fractional values to integer. A more flexible way to format numerical -data as strings is the @code{sprintf} function (@pxref{Formatted Output}, -@ref{XREFsprintf,,sprintf}). +which cast numerical data to the corresponding UTF-8 encoded characters, there +are several functions that format numerical data as strings. @code{mat2str} +and @code{num2str} convert real or complex matrices, while @code{int2str} +converts integer matrices. @code{int2str} takes the real part of complex +values and round fractional values to integer. A more flexible way to format +numerical data as strings is the @code{sprintf} function +(@pxref{Formatted Output}, @ref{XREFsprintf,,sprintf}). @DOCSTRING(mat2str) diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/cellfun.cc Tue Jan 22 08:07:55 2019 -0500 @@ -1808,7 +1808,8 @@ [2,1] = 3 4 @} -## all rows and cols appear in each element of C (hence, only 1 output) +## all rows and cols appear in each element of C +## (hence, only 1 output) num2cell (x, [1, 2]) @result{} @{ @@ -2136,8 +2137,10 @@ 10 11 12 @group -## The 4 rows (dim1) are divided in to two cell elements with 2 rows each. -## The 3 cols (dim2) are divided in to three cell elements with 1 col each. +## The 4 rows (dim1) are divided in to two cell elements +## with 2 rows each. +## The 3 cols (dim2) are divided in to three cell elements +## with 1 col each. mat2cell (x, [2,2], [1,1,1]) @result{} @{ @@ -2172,7 +2175,8 @@ @end group @group -## The 4 rows (dim1) are divided in to two cell elements with a 3/1 split. +## The 4 rows (dim1) are divided in to two cell elements +## with a 3/1 split. ## All columns appear in each output element. mat2cell (x, [3,1]) @result{} diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/graphics.cc Tue Jan 22 08:07:55 2019 -0500 @@ -5082,7 +5082,7 @@ } /* -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! unwind_protect @@ -5102,7 +5102,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! fpos = get (hf, "position"); @@ -5122,7 +5122,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! fpos = get (hf, "position"); @@ -11832,7 +11832,7 @@ %! setappdata (gcbf (), "cb_exec", [getappdata(gcbf (), "cb_exec") h]); %!endfunction %! -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off", "resizefcn", @cb); %! unwind_protect %! ## Default diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/help.cc Tue Jan 22 08:07:55 2019 -0500 @@ -237,14 +237,17 @@ { std::string file; - type = ""; + if (name.empty ()) + return file; - symbol_table& symtab = m_interpreter.get_symbol_table (); - - octave_value val = symtab.find_function (name); + type = ""; if (name.find_first_of ('.') == std::string::npos) { + symbol_table& symtab = m_interpreter.get_symbol_table (); + + octave_value val = symtab.find_function (name); + if (val.is_defined ()) { octave_function *fcn = val.function_value (); diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/pr-output.cc Tue Jan 22 08:07:55 2019 -0500 @@ -3387,12 +3387,26 @@ /* %!test -%! str = evalc ("x = 1.1; display (x)"); -%! assert (str, "x = 1.1000\n"); +%! [old_fmt, old_spacing] = format (); +%! unwind_protect +%! format short; +%! str = evalc ("x = 1.1; display (x)"); +%! assert (str, "x = 1.1000\n"); +%! unwind_protect_cleanup +%! format (old_fmt); +%! format (old_spacing); +%! end_unwind_protect %!test -%! str = evalc ("display (1.1)"); -%! assert (str, " 1.1000\n"); +%! [old_fmt, old_spacing] = format (); +%! unwind_protect +%! format short; +%! str = evalc ("display (1.1)"); +%! assert (str, " 1.1000\n"); +%! unwind_protect_cleanup +%! format (old_fmt); +%! format (old_spacing); +%! end_unwind_protect ## Test input validation %!error display () diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/symtab.cc Tue Jan 22 08:07:55 2019 -0500 @@ -401,6 +401,27 @@ return octave_value (); } + octave_value symbol_table::find_function (const std::string& name) + { + if (name.empty ()) + return octave_value (); + + if (name[0] == '@') + { + size_t pos = name.find_first_of ('/'); + + if (pos == std::string::npos) + return octave_value (); + + std::string method = name.substr (pos+1); + std::string dispatch_type = name.substr (1, pos-1); + + return find_method (method, dispatch_type); + } + else + return find_function (name, ovl ()); + } + octave_value symbol_table::find_function (const std::string& name, const octave_value_list& args) diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/corefcn/symtab.h Tue Jan 22 08:07:55 2019 -0500 @@ -212,9 +212,21 @@ fcn_table_find (const std::string& name, const octave_value_list& args = octave_value_list ()); + // If NAME is of the form @CLASS/FUNCTION, call + // + // find_method (FUNCTION, CLASS) + // + // otherwise call + // + // function_function (NAME, ovl ()) + + octave_value find_function (const std::string& name); + + // NAME should just be function name; dispatch type determined + // from types of ARGS. + octave_value - find_function (const std::string& name, - const octave_value_list& args = octave_value_list ()); + find_function (const std::string& name, const octave_value_list& args); octave_value find_user_function (const std::string& name) { diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/dldfcn/__init_fltk__.cc Tue Jan 22 08:07:55 2019 -0500 @@ -30,7 +30,7 @@ */ -// PKG_ADD: if (__have_feature__ ("FLTK") && __have_feature__ ("OPENGL") && have_window_system ()) register_graphics_toolkit ("fltk"); endif +// PKG_ADD: if (__have_feature__ ("FLTK") && __have_feature__ ("OPENGL") && have_window_system () && ! (ismac () && __octave_link_enabled__ ())) register_graphics_toolkit ("fltk"); endif #if defined (HAVE_CONFIG_H) # include "config.h" diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/op-kw-docs --- a/libinterp/op-kw-docs Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/op-kw-docs Tue Jan 22 08:07:55 2019 -0500 @@ -673,6 +673,18 @@ @deftypefnx {} {} parfor (@var{i} = @var{range}, @var{maxproc}) Begin a for loop that may execute in parallel. +A @code{parfor} loop has the same syntax as a @code{for} loop. If your Octave +session has a parallel processing pool enabled, the iterations of the +@code{parfor} loop will be executed in parallel across the pool's workers. +Otherwise, @code{parfor} will behave exactly as @code{for}. + +When operating in parallel mode, a @code{parfor} loop's iterations are not +guaranteed to occur sequentially, and there are additional restrictions about +the data access operations you can do inside the loop body. + +@strong{Warning:} parallel processing pools are currently unimplemented in +Octave; @code{parfor} currently behaves exactly as a normal @code{for} loop. + @example @group parfor i = 1:10 diff -r ec3c4f31823b -r a7d56e0a5c8c libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Tue Jan 22 07:27:03 2019 +0100 +++ b/libinterp/parse-tree/oct-parse.yy Tue Jan 22 08:07:55 2019 -0500 @@ -5799,10 +5799,17 @@ %! b = 2; %!endfunction %!test -%! [s, a, b] = evalc ("__f_evalc ()"); -%! assert (s, "foobar 3.1416\n"); -%! assert (a, 1); -%! assert (b, 2); +%! [old_fmt, old_spacing] = format (); +%! unwind_protect +%! format short; +%! [s, a, b] = evalc ("__f_evalc ()"); +%! assert (s, "foobar 3.1416\n"); +%! assert (a, 1); +%! assert (b, 2); +%! unwind_protect_cleanup +%! format (old_fmt); +%! format (old_spacing); +%! end_unwind_protect %!error (evalc ("error ('foo')")) %!error (evalc ("error ('foo')", "error ('bar')")) diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/general/circshift.m --- a/scripts/general/circshift.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/general/circshift.m Tue Jan 22 08:07:55 2019 -0500 @@ -37,19 +37,23 @@ ## x = [1, 2, 3; ## 4, 5, 6; ## 7, 8, 9]; -## circshift (x, 1) # positive shift on rows (1st non-singular dim) +## ## positive shift on rows (1st non-singular dim) +## circshift (x, 1) ## @result{} 7, 8, 9 ## 1, 2, 3 ## 4, 5, 6 -## circshift (x, -2) # negative shift on rows (1st non-singular dim) +## ## negative shift on rows (1st non-singular dim) +## circshift (x, -2) ## @result{} 7, 8, 9 ## 1, 2, 3 ## 4, 5, 6 -## circshift (x, [0,1]) # no shift of rows, shift columns by 1 (2nd dimension) +## ## no shift of rows, shift columns by 1 (2nd dimension) +## circshift (x, [0,1]) ## @result{} 3, 1, 2 ## 6, 4, 5 ## 9, 7, 8 -## circshift (x, 1, 2) # shift columns (2nd dimension) +## ## shift columns (2nd dimension) +## circshift (x, 1, 2) ## @result{} 3, 1, 2 ## 6, 4, 5 ## 9, 7, 8 diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/inputdlg.m --- a/scripts/gui/inputdlg.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/inputdlg.m Tue Jan 22 08:07:55 2019 -0500 @@ -67,7 +67,8 @@ ## prompt = @{"Width", "Height", "Depth"@}; ## defaults = @{"1.10", "2.20", "3.30"@}; ## rowscols = [1,10; 2,20; 3,30]; -## dims = inputdlg (prompt, "Enter Box Dimensions", rowscols, defaults); +## dims = inputdlg (prompt, "Enter Box Dimensions", ... +## rowscols, defaults); ## @end group ## @end example ## diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/questdlg.m --- a/scripts/gui/questdlg.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/questdlg.m Tue Jan 22 08:07:55 2019 -0500 @@ -47,7 +47,8 @@ ## ## @example ## @group -## btn = questdlg ("Close Octave?", "Some fancy title", "Yes", "No", "No"); +## btn = questdlg ("Close Octave?", "Some fancy title", ... +## "Yes", "No", "No"); ## if (strcmp (btn, "Yes")) ## exit (); ## endif diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/uicontextmenu.m --- a/scripts/gui/uicontextmenu.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/uicontextmenu.m Tue Jan 22 08:07:55 2019 -0500 @@ -36,15 +36,17 @@ ## ## @example ## @group -## % create figure and uicontextmenu -## f = figure; +## ## create figure and uicontextmenu +## f = figure (); ## c = uicontextmenu (f); ## -## % create menus in the context menu -## m1 = uimenu ("parent",c,"label","Menu item 1","callback","disp('menu item 1')"); -## m2 = uimenu ("parent",c,"label","Menu item 2","callback","disp('menu item 2')"); +## ## create menus in the context menu +## m1 = uimenu ("parent", c, "label", "Menu item 1", ... +## "callback", "disp('menu item 1')"); +## m2 = uimenu ("parent", c, "label", "Menu item 2", ... +## "callback", "disp('menu item 2')"); ## -## % set the context menu for the figure +## ## set the context menu for the figure ## set (f, "uicontextmenu", c); ## @end group ## @end example diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/uicontrol.m --- a/scripts/gui/uicontrol.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/uicontrol.m Tue Jan 22 08:07:55 2019 -0500 @@ -86,7 +86,8 @@ ## ## Create figure and panel on it ## f = figure; ## ## Create a button (default style) -## b1 = uicontrol (f, "string", "A Button", "position", [10 10 150 40]); +## b1 = uicontrol (f, "string", "A Button", ... +## "position", [10 10 150 40]); ## ## Create an edit control ## e1 = uicontrol (f, "style", "edit", "string", "editable text", ... ## "position", [10 60 300 40]); diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/uimenu.m --- a/scripts/gui/uimenu.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/uimenu.m Tue Jan 22 08:07:55 2019 -0500 @@ -106,7 +106,7 @@ %! uimenu (f, 'label', 'Close', 'accelerator', 'q', 'callback', 'close (gcf)'); %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)'); -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect @@ -123,7 +123,7 @@ %! end_unwind_protect ## check for top level menus file and edit -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect @@ -136,7 +136,7 @@ %! graphics_toolkit (toolkit); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/uipanel.m --- a/scripts/gui/uipanel.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/uipanel.m Tue Jan 22 08:07:55 2019 -0500 @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## @deftypefn {} {} uipanel (@var{property}, @var{value}, @dots{}) -## @deftypefnx {} {} uipanel (@var{parent}, "@var{property}, @var{value}, @dots{}) +## @deftypefnx {} {} uipanel (@var{parent}, @var{property}, @var{value}, @dots{}) ## @deftypefnx {} {@var{hui} =} uipanel (@dots{}) ## ## Create a uipanel object. @@ -42,13 +42,15 @@ ## ## @example ## @group -## % create figure and panel on it +## ## create figure and panel on it ## f = figure; ## p = uipanel ("title", "Panel Title", "position", [.25 .25 .5 .5]); ## -## % add two buttons to the panel -## b1 = uicontrol ("parent", p, "string", "A Button", "position",[18 10 150 36]); -## b2 = uicontrol ("parent", p, "string", "Another Button", "position",[18 60 150 36]); +## ## add two buttons to the panel +## b1 = uicontrol ("parent", p, "string", "A Button", ... +## "position", [18 10 150 36]); +## b2 = uicontrol ("parent", p, "string", "Another Button", ... +## "position",[18 60 150 36]); ## ## @end group ## @end example diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/gui/uitable.m --- a/scripts/gui/uitable.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/gui/uitable.m Tue Jan 22 08:07:55 2019 -0500 @@ -82,9 +82,11 @@ ## ## popup_options = @{"A", "B", "C", "D", "E"@}; ## -## columnformat_options = @{ "[]", "char", "pop-up", "numeric", "short", "short e", ... -## "short eng", "short g", "long", "long e", "long eng", ... -## "long g", "bank", "+", "rat", "logical"@}; +## columnformat_options = @{ "[]", "char", "pop-up", "numeric", ... +## "short", "short e", "short eng", ... +## "short g", "long", "long e", ... +## "long eng", "long g", "bank", "+", ... +## "rat", "logical"@}; ## columnformat_values = columnformat_options; ## columnformat_values@{1@} = ""; ## columnformat_values@{3@} = popup_options; @@ -117,32 +119,42 @@ ## l_editable_table = uicontrol (f, "Position", [ 0 502 200 25 ], ... ## "Style", "text", ... ## "String", "Set Data Columns Editable:"); -## t_editable_table = uitable (f, "Position", [ 0 434 1000 65 ], ... -## "Data", repmat (false, 1, columns (default_data)), ... -## "ColumnEditable", true); +## t_editable_table = ... +## uitable (f, "Position", [ 0 434 1000 65 ], ... +## "Data", repmat (false, 1, columns (default_data)), ... +## "ColumnEditable", true); ## ## l_format_table = uicontrol (f, "Position", [ 0 406 200 25 ], ... ## "Style", "text", ... ## "String", "Set Data Column Format:"); -## t_format_table = uitable (f, "Position", [ 0 338 1000 65 ], ... -## "Data", columnformat_options, ... -## "ColumnEditable", true, ... -## "ColumnFormat", arrayfun (@@(x) @{columnformat_options@}, 1:columns (columnformat_options))); +## t_format_table = ... +## uitable (f, "Position", [ 0 338 1000 65 ], ... +## "Data", columnformat_options, ... +## "ColumnEditable", true, ... +## "ColumnFormat", arrayfun (@@(x) @{columnformat_options@}, ... +## 1:columns (columnformat_options))); ## -## l_data_table = uicontrol (f, "Style", "text", "String", "Data:", "Position", [ 0 310 60 25 ]); +## l_data_table = uicontrol (f, "Style", "text", ... +## "String", "Data:", ... +## "Position", [ 0 310 60 25 ]); ## t_data_table = uitable (f, "Position", [ 0 15 1000 290 ], ... ## "Data", default_data, ... ## "ColumnFormat", columnformat_values); ## -## set (t_format_table, "CellEditCallback", ... -## @@(x, y) update_column_format (y.NewData, y.Indices, t_data_table, popup_options)); +## set (t_format_table, ... +## "CellEditCallback", ... +## @@(x, y) update_column_format (y.NewData, y.Indices, ... +## t_data_table, popup_options)); ## set (t_point_table, "CellEditCallback", ... -## @@(x, y) validate_point_table (x, y, t_data_table)); -## set (t_editable_table, "CellEditCallback", @@(x,y) set (t_data_table, ... -## "ColumnEditable", get (t_editable_table, "Data"))); -## set (b_add, "Callback", @@(x, y) ... -## update_data (b_add, t_point_table, t_type_table, t_data_table)); -## set (t_data_table, "cellselectioncallback", @@(x, y) update_point_table (y.Indices, t_point_table)); +## @@(x, y) validate_point_table (x, y, t_data_table)); +## set (t_editable_table, "CellEditCallback", ... +## @@(x,y) set (t_data_table, ... +## "ColumnEditable", get (t_editable_table, "Data"))); +## set (b_add, ... +## "Callback", @@(x, y) update_data (b_add, t_point_table, ... +## t_type_table, t_data_table)); +## set (t_data_table, "CellSelectionCallback", ... +## @@(x, y) update_point_table (y.Indices, t_point_table)); ## endfunction ## ## function validate_point_table (h, dat, t_data_table) @@ -155,7 +167,8 @@ ## endif ## endfunction ## -## function update_column_format (format, indices, t_data_table, popup_options) +## function update_column_format (format, indices, t_data_table, ... +## popup_options) ## cf = get (t_data_table, "ColumnFormat"); ## if (strcmp (format, "[]")) ## format = ""; @@ -173,7 +186,8 @@ ## set (t_point_table, "Data", indices(1,:)); ## endfunction ## -## function update_data (b_add, t_point_table, t_type_table, t_data_table) +## function update_data (b_add, t_point_table, t_type_table, ... +## t_data_table) ## indices = get (b_add, "UserData"); ## if (isempty (indices)) ## indices = [1, 1]; diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/help/warning_ids.m --- a/scripts/help/warning_ids.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/help/warning_ids.m Tue Jan 22 08:07:55 2019 -0500 @@ -247,6 +247,7 @@ ## ## @item Octave:nearly-singular-matrix ## @itemx Octave:singular-matrix +## These warnings are emitted if a (nearly) singular matrix is inverted. ## By default, the @code{Octave:nearly-singular-matrix} and ## @code{Octave:singular-matrix} warnings are enabled. ## @@ -269,7 +270,7 @@ ## ## @item Octave:num-to-str ## If the @code{Octave:num-to-str} warning is enable, a warning is -## printed for implicit conversions of numbers to their ASCII character +## printed for implicit conversions of numbers to their UTF-8 encoded character ## equivalents when strings are constructed using a mixture of strings and ## numbers in matrix notation. For example, ## @@ -344,8 +345,8 @@ ## ## @item Octave:str-to-num ## If the @code{Octave:str-to-num} warning is enabled, a warning is printed -## for implicit conversions of strings to their numeric ASCII equivalents. -## For example, +## for implicit conversions of strings to their numeric UTF-8 encoded byte +## sequences. For example, ## ## @example ## @group diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/miscellaneous/mkdir.m --- a/scripts/miscellaneous/mkdir.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/miscellaneous/mkdir.m Tue Jan 22 08:07:55 2019 -0500 @@ -24,15 +24,16 @@ ## Create a directory named @var{dirname} in the directory @var{parent}, ## creating any intermediate directories if necessary. ## -## If @var{dir} is a relative path, and no @var{parent} directory is specified, -## then the present working directory is used. +## If @var{dirname} is a relative path, and no @var{parent} directory is +## specified, then the present working directory is used. ## ## If successful, @var{status} is 1, and @var{msg} and @var{msgid} are empty ## strings (""). Otherwise, @var{status} is 0, @var{msg} contains a ## system-dependent error message, and @var{msgid} contains a unique message ## identifier. ## -## When creating a directory permissions will be set to @code{0777 - UMASK}. +## When creating a directory permissions will be set to +## @w{@code{0777 - UMASK}}. ## ## @seealso{rmdir, pwd, cd, umask} ## @end deftypefn @@ -71,6 +72,10 @@ status = 1; + if (isempty (parent)) + error ("mkdir: invalid PARENT"); + endif + if (! isfolder (parent)) [grandparent, name, ext] = fileparts (parent); [status, msg, msgid] = mkdir_recur (grandparent, [name, ext]); @@ -115,6 +120,9 @@ %! endif %! end_unwind_protect +%!test <*55540> +%! fail ('mkdir ("__%hello%__", "world")', "invalid PARENT"); + ## Test input validation %!error mkdir () %!error mkdir ("a", "b", "c") diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/pkg/pkg.m Tue Jan 22 08:07:55 2019 -0500 @@ -186,7 +186,8 @@ ## Display can be limited to a set of packages: ## ## @example -## pkg describe control signal # describe control and signal packages +## ## describe control and signal packages +## pkg describe control signal ## @end example ## ## If one output is requested a cell of structure containing the diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/plot/util/allchild.m --- a/scripts/plot/util/allchild.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/plot/util/allchild.m Tue Jan 22 08:07:55 2019 -0500 @@ -48,7 +48,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/plot/util/findall.m --- a/scripts/plot/util/findall.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/plot/util/findall.m Tue Jan 22 08:07:55 2019 -0500 @@ -50,7 +50,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/plot/util/graphics_toolkit.m --- a/scripts/plot/util/graphics_toolkit.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/plot/util/graphics_toolkit.m Tue Jan 22 08:07:55 2019 -0500 @@ -103,7 +103,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! unwind_protect %! hf = figure ("visible", "off"); %! toolkit = graphics_toolkit (); @@ -114,7 +114,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) && any (strcmp ("fltk", available_graphics_toolkits ())) %! old_toolkit = graphics_toolkit (); %! switch (old_toolkit) %! case {"gnuplot"} diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/statistics/movmin.m --- a/scripts/statistics/movmin.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/statistics/movmin.m Tue Jan 22 08:07:55 2019 -0500 @@ -1,4 +1,4 @@ -## Copyright (C) 2018-2019 Rik Wehbring +## Copyright (C) 2018-2019 Juan Pablo Carbajal ## ## This file is part of Octave. ## diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/strings/erase.m --- a/scripts/strings/erase.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/strings/erase.m Tue Jan 22 08:07:55 2019 -0500 @@ -36,11 +36,13 @@ ## @result{} @{"Hello", "!"@} ## ## ## string, multiple patterns -## erase ("The Octave interpreter is fabulous", @{"interpreter ", "The "@}) +## erase ("The Octave interpreter is fabulous", ... +## @{"interpreter ", "The "@}) ## @result{} "Octave is fabulous" ## ## ## cellstr, multiple patterns -## erase (@{"The ", "Octave interpreter ", "is fabulous"@}, @{"interpreter ", "The "@}) +## erase (@{"The ", "Octave interpreter ", "is fabulous"@}, ... +## @{"interpreter ", "The "@}) ## @result{} @{"", "Octave ", "is fabulous"@} ## @end group ## @end example diff -r ec3c4f31823b -r a7d56e0a5c8c scripts/strings/strsplit.m --- a/scripts/strings/strsplit.m Tue Jan 22 07:27:03 2019 +0100 +++ b/scripts/strings/strsplit.m Tue Jan 22 08:07:55 2019 -0500 @@ -87,7 +87,8 @@ ## Examples with @nospell{regularexpression} delimiters: ## ## @smallexample -## strsplit ("a foo b,bar c", ',|\s|foo|bar', "delimitertype", "regularexpression") +## strsplit ("a foo b,bar c", ',|\s|foo|bar', ... +## "delimitertype", "regularexpression") ## @result{} ## @{ ## [1,1] = a @@ -95,7 +96,8 @@ ## [1,3] = c ## @} ## -## strsplit ("a,,b, c", '[, ]', "collapsedelimiters", false, "delimitertype", "regularexpression") +## strsplit ("a,,b, c", '[, ]', "collapsedelimiters", false, ... +## "delimitertype", "regularexpression") ## @result{} ## @{ ## [1,1] = a