summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2021-04-02 23:01:07 +0200
committerClement DAVID <clement.david@esi-group.com>2021-04-09 14:37:55 +0200
commit7efe1ce40d3bc08d29036ea36d6e352e1835e0e6 (patch)
treedf9cfe7051fda45acf0ecb913bd99cfb4a4a6940 /scilab
parent01100bb8542b0790fb1cd64212514f5632937e55 (diff)
downloadscilab-7efe1ce40d3bc08d29036ea36d6e352e1835e0e6.zip
scilab-7efe1ce40d3bc08d29036ea36d6e352e1835e0e6.tar.gz
* Bug 16665 fixed: help('echo') can redirect to help('mode') on preferences
http://bugzilla.scilab.org/16665 Interactive test: // Preference unchecked (default): help echo // => list of possible matching pages displayed on the left preferences // General/Documentation : check "Redirect Matlab terms to closest Scilab equivalent" // validate and quit help echo // => display the mode() page help cot // => display the cotg() page. etc Change-Id: I5129c130592fefb99180eb44d8abe245a00db7c0
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md11
-rw-r--r--scilab/modules/console/etc/XConfiguration-general.xml5
-rw-r--r--scilab/modules/console/etc/XConfiguration-general.xsl18
-rw-r--r--scilab/modules/demo_tools/macros/demo_gui.sci2
-rw-r--r--scilab/modules/helptools/data/external2scilab_equiv.csv257
-rw-r--r--scilab/modules/helptools/macros/help.sci21
6 files changed, 302 insertions, 12 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 3bbcefe..33ef5e9 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -264,6 +264,7 @@ User Interface improvements
264 - The menu "Issues" allows to display bugzilla entries related to the feature of the current page 264 - The menu "Issues" allows to display bugzilla entries related to the feature of the current page
265 - ATOMS chapters are automatically loaded in the browser. 265 - ATOMS chapters are automatically loaded in the browser.
266 - The page left at exit is restored at next startup. 266 - The page left at exit is restored at next startup.
267 - On Preferences option, querring some Matlab term can now redirect and display the documentation of the Scilab equivalent feature.
267* `x_matrix` can now edit matrices of booleans, integers, or text. Matrices of real or complex numbers are better displayed. 268* `x_matrix` can now edit matrices of booleans, integers, or text. Matrices of real or complex numbers are better displayed.
268 269
269 270
@@ -411,7 +412,6 @@ Bug Fixes
411* [#16458](https://bugzilla.scilab.org/16458): `mean()` did not handle sparse numerical matrices. 412* [#16458](https://bugzilla.scilab.org/16458): `mean()` did not handle sparse numerical matrices.
412* [#16465](https://bugzilla.scilab.org/16465): Scinotes OpenRecent menu was not updated when it should. 413* [#16465](https://bugzilla.scilab.org/16465): Scinotes OpenRecent menu was not updated when it should.
413* [#16473](https://bugzilla.scilab.org/16473): Deleting rows in a sparse squared the matrix with padding zeros (Scilab 6 regression). 414* [#16473](https://bugzilla.scilab.org/16473): Deleting rows in a sparse squared the matrix with padding zeros (Scilab 6 regression).
414<<<<<<< HEAD
415* [#16474](https://bugzilla.scilab.org/16474): `imult(%z)` crashed Scilab. 415* [#16474](https://bugzilla.scilab.org/16474): `imult(%z)` crashed Scilab.
416* [#16476](https://bugzilla.scilab.org/16476): `issquare` was not overloaded. 416* [#16476](https://bugzilla.scilab.org/16476): `issquare` was not overloaded.
417* [#16488](https://bugzilla.scilab.org/16488): Concatenations mixing boolean and double with at least one operand being sparse were not supported. 417* [#16488](https://bugzilla.scilab.org/16488): Concatenations mixing boolean and double with at least one operand being sparse were not supported.
@@ -422,13 +422,13 @@ Bug Fixes
422* [#16517](https://bugzilla.scilab.org/16517): `getdate("s")` truncated the actual time to integer seconds. `getdate(u)(10)` returned fractional seconds instead of milliseconds as `getdate()`. 422* [#16517](https://bugzilla.scilab.org/16517): `getdate("s")` truncated the actual time to integer seconds. `getdate(u)(10)` returned fractional seconds instead of milliseconds as `getdate()`.
423* [#16522](https://bugzilla.scilab.org/16522): `bitget(x,pos)` and `bitset(x,pos)` results could be wrong when `pos` is an encoded integer. 423* [#16522](https://bugzilla.scilab.org/16522): `bitget(x,pos)` and `bitset(x,pos)` results could be wrong when `pos` is an encoded integer.
424* [#16525](https://bugzilla.scilab.org/16525): `soundsec(t,freq)` has the trivial equivalence `0 : 1/freq : t*(1-%eps)` and should be removed. 424* [#16525](https://bugzilla.scilab.org/16525): `soundsec(t,freq)` has the trivial equivalence `0 : 1/freq : t*(1-%eps)` and should be removed.
425* [#16529](https://bugzilla.scilab.org/16529): `deff` could not return the created function as output argument, preventing to cretae and use anonymous functions. The function's headline and body had to be provided separately. For Simple functions, a one-string input (possibly console-oriented) definition was not supported.
425* [#16530](https://bugzilla.scilab.org/16530): `mapsound` needed to be reforged. 426* [#16530](https://bugzilla.scilab.org/16530): `mapsound` needed to be reforged.
426* [#16549](https://bugzilla.scilab.org/16549): simple script crashed Scilab in GUI mode. 427* [#16549](https://bugzilla.scilab.org/16549): simple script crashed Scilab in GUI mode.
427* [#16551](https://bugzilla.scilab.org/16551): `num2cell` returned {} for any input array of empty strings. 428* [#16551](https://bugzilla.scilab.org/16551): `num2cell` returned {} for any input array of empty strings.
428* [#16552](https://bugzilla.scilab.org/16552): `mfile2sci`: conversion of `ispc` and `isunix` still used `MSDOS` removed far ago. Conversion of `ismac` was missing. Conversion of `exist` missed using `mtlb_exist`. Conversion of `dos` yielded some "operation +" warnings. Unit tests for the conversion of `cd`, `dir` and `ferror` overwrote some Scilab reserved keywords. Conversion of `return` yielded `mtlb(resume)`. 429* [#16552](https://bugzilla.scilab.org/16552): `mfile2sci`: conversion of `ispc` and `isunix` still used `MSDOS` removed far ago. Conversion of `ismac` was missing. Conversion of `exist` missed using `mtlb_exist`. Conversion of `dos` yielded some "operation +" warnings. Unit tests for the conversion of `cd`, `dir` and `ferror` overwrote some Scilab reserved keywords. Conversion of `return` yielded `mtlb(resume)`.
429* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`. 430* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`.
430* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`. 431* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`.
431<<<<<<< HEAD
432* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger. 432* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger.
433* [#16561](https://bugzilla.scilab.org/16561): `histplot(-10:0.2:10, 2)` yielded a warning from `histc` and an error. 433* [#16561](https://bugzilla.scilab.org/16561): `histplot(-10:0.2:10, 2)` yielded a warning from `histc` and an error.
434* [#16565](https://bugzilla.scilab.org/16565): `edit(user_defined_function)` corrupted the original code. 434* [#16565](https://bugzilla.scilab.org/16565): `edit(user_defined_function)` corrupted the original code.
@@ -458,13 +458,8 @@ Bug Fixes
458* [#16639](https://bugzilla.scilab.org/16639): `atomsInstall` and `atomsRemove` did not update the Toolboxes menu. 458* [#16639](https://bugzilla.scilab.org/16639): `atomsInstall` and `atomsRemove` did not update the Toolboxes menu.
459* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input. 459* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
460* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory. 460* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory.
461* [#16665](https://bugzilla.scilab.org/16665): `help echo` could not redirect to `help mode` when preferred, for new users coming from Octave.
461 462
462=======
463>>>>>>> afb92ac5368 (* Bug 16614 fixed: replot() could fail out of gcf())
464=======
465* [#16529](https://bugzilla.scilab.org/16529): `deff` could not return the created function as output argument, preventing to cretae and use anonymous functions. The function's headline and body had to be provided separately. For Simple functions, a one-string input (possibly console-oriented) definition was not supported.
466
467>>>>>>> 75a0ccd0638 (* Bug 16529 fixed: deff() upgraded: output arg added, one-string def, etc)
468 463
469### Bugs fixed in 6.1.0: 464### Bugs fixed in 6.1.0:
470* [#2694](https://bugzilla.scilab.org/2694): `bitget` did not accept positive integers of types int8, int16 or int32. 465* [#2694](https://bugzilla.scilab.org/2694): `bitget` did not accept positive integers of types int8, int16 or int32.
diff --git a/scilab/modules/console/etc/XConfiguration-general.xml b/scilab/modules/console/etc/XConfiguration-general.xml
index fd8a732..ae4912b 100644
--- a/scilab/modules/console/etc/XConfiguration-general.xml
+++ b/scilab/modules/console/etc/XConfiguration-general.xml
@@ -259,9 +259,10 @@
259 </actions> 259 </actions>
260 </body> 260 </body>
261 </shortcuts> 261 </shortcuts>
262 <demonstrations title="_(Demos)"> 262 <documentation title="_(Help and demos)">
263 <body> 263 <body>
264 <demos demoGUIisDockable="checked"/> 264 <demos demoGUIisDockable="checked"/>
265 <help redirectMatlab2Scilab="unchecked"/>
265 </body> 266 </body>
266 </demonstrations> 267 </documentation>
267</general> 268</general>
diff --git a/scilab/modules/console/etc/XConfiguration-general.xsl b/scilab/modules/console/etc/XConfiguration-general.xsl
index 6896a2e..e3b0f7b 100644
--- a/scilab/modules/console/etc/XConfiguration-general.xsl
+++ b/scilab/modules/console/etc/XConfiguration-general.xsl
@@ -332,4 +332,22 @@
332 </Grid> 332 </Grid>
333 </Title> 333 </Title>
334 </xsl:template> 334 </xsl:template>
335 <xsl:template match="help">
336 <Title text="help()">
337 <Grid>
338 <Checkbox
339 gridx="1"
340 gridy="2"
341 listener="ActionListener"
342 checked="{@redirectMatlab2Scilab}"
343 text="_(Redirect Matlab terms to Scilab closest equivalent)"
344 >
345 <actionPerformed choose="redirectMatlab2Scilab">
346 <xsl:call-template name="context"/>
347 </actionPerformed>
348 </Checkbox>
349 </Grid>
350 </Title>
351 </xsl:template>
352
335</xsl:stylesheet> 353</xsl:stylesheet>
diff --git a/scilab/modules/demo_tools/macros/demo_gui.sci b/scilab/modules/demo_tools/macros/demo_gui.sci
index 0e65bc7..380a9fa 100644
--- a/scilab/modules/demo_tools/macros/demo_gui.sci
+++ b/scilab/modules/demo_tools/macros/demo_gui.sci
@@ -48,7 +48,7 @@ function demo_gui()
48 // ========================================================================= 48 // =========================================================================
49 // We get the user Preferences for the GUI: dockable / not dockable 49 // We get the user Preferences for the GUI: dockable / not dockable
50 File = SCIHOME + "/XConfiguration.xml"; 50 File = SCIHOME + "/XConfiguration.xml";
51 r = xmlGetValues("//general/demonstrations/body/demos","demoGUIisDockable", File); 51 r = xmlGetValues("//general/documentation/body/demos","demoGUIisDockable", File);
52 52
53 // We tune accordingly the predefined demo GUI 53 // We tune accordingly the predefined demo GUI
54 File = SCI + "/modules/demo_tools/gui/demo_gui.xml"; 54 File = SCI + "/modules/demo_tools/gui/demo_gui.xml";
diff --git a/scilab/modules/helptools/data/external2scilab_equiv.csv b/scilab/modules/helptools/data/external2scilab_equiv.csv
new file mode 100644
index 0000000..10562a8
--- /dev/null
+++ b/scilab/modules/helptools/data/external2scilab_equiv.csv
@@ -0,0 +1,257 @@
1all;and;
2angle;atan;
3any;or;
4argv;sciargs;// Octave
5arrayfun;feval;
6atan2;atan;
7axes;newaxes;
8axis;replot;
9balance;balanc;
10bicg;conjgrad;
11bicgstab;conjgrad;
12blkdiag;blockdiag;
13box;gca;
14caxis;colorbar;
15celldisp;disp;
16cgs;conjgrad;
17charpoly;poly;
18chebwin;window;
19cla;delete;
20class;typeof;
21clear global;clearglobal;
22closereq;xdel;
23colormap;jetcolormap;
24columns;size;// Octave
25commandhistory;browsehistory;
26compan;companion;
27completion_matches;completion;// Octave
28computer;getos;
29contains;grep;
30contourc;contour2di;
31contour3;contour;
32cot;cotg;
33copyobj;copy;
34cputime;timer;
35csvread;csvRead;
36dbclear;debug;
37dbcont;resume;
38dbquit;abort;
39dbstack;where;
40dbstatus;debug;
41dbstop;debug;
42dbup;return;
43deal;brackets;
44deblank;stripblanks;
45demo;demo_gui;
46dlmwrite;fprintfMat;
47echo;mode;
48eig;eigs;
49ellipj;amell;
50ellipke;percentk;
51endsWith;grep;
52eps;percenteps;
53erase;strsubst;
54errorbar;errbar;
55errordlg;messagebox;
56exist;exists;
57extractAfter;regexp;
58extractBefore;regexp;
59false;percentf;
60fclose;mclose;
61feof;meof;
62fftn;fft;
63fgetl;mgetl;
64fgets;mgetl;
65fill;xfpolys;
66flintmax;number_properties;
67flip;flipdim;
68flipud;flipdim;
69fliplr;flipdim;
70fopen;mopen;
71fplot;plot;
72fputs;mputstr;// Octave
73fread;mget;
74frewind;mseek;
75func2str;macr2tree;
76fwrite;mput;
77fzero;fsolve;
78gallery;testmatrix;
79gammainc;cdfgam;
80get_home_directory;home;// Octave
81getpref;xmlGetValues;
82ginput;locate;
83grid;xgrid;
84gtext;legends;
85help;uman;// Octave
86helpdlg;messagebox;
87helpwin;help;
88hggroup;glue;
89hgload;load;
90hgsave;save;
91hist;histplot;
92histcounts;histc;
93hold;axes_properties;
94housh;householder;// Octave
95horzcat;cat;
96i;percenti;
97ifft2;ifft;
98ifftn;ifft;
99image;Matplot;
100imagesc;Matplot1;
101index;strindex;// Octave
102inf;percentinf;
103int2str;string;
104intmin;int8;
105intmax;int8;
106invfeqz;frfit;
107is_absolute_filename;is_absolute_path;// Octave
108isa;m2sci_isa;
109isalnum;isalphanum;// Octave
110iscell;typeof;
111iscellstr;typeof;
112isfolder;isdir;
113isgraphics;is_handle_valid;// Octave
114isguirunning;getscilabmode;// Octave
115ishghandle;is_handle_valid;
116isinteger;type;
117isjava;typeof;
118iskeyword;getscilabkeywords;
119ismac;getos;
120ismember;members;
121ispc;getos;
122isunix;getos;
123is_valid_file_id;file;// Octave
124j;percenti;
125join;strcat;
126kaiser;window;
127keyboard;pause;
128listdlg;x_choose;
129loglog;plot;
130lookfor;apropos;
131lower;convstr;
132lstat;fileinfo;// Octave
133magic;testmatrix;
134mat2str;sci2exp;
135matlabroot;SCI;
136msgbox;messagebox;
137mfilename;get_absolute_file_path;
138mod;pmodulo;
139more;lines;
140nan;percentnan;
141nanmin;min;
142nanmax;max;
143nargin;argn;
144nargout;argn;
145newline;ascii;
146nonzeros;spget;
147num2str;string;
148numel;size;
149OCTAVE_HOME;SCIHOME;// Octave
150ode23;ode;
151ode45;ode;
152ode113;ode;
153ode15s;ode;
154odeget;odeoptions;
155openvar;editvar;
156paddarray;resize_matrix;
157patch;xfpolys;
158pcg;conjgrad;
159pi;percentpi;
160pkg;atoms;// Octave
161planerot;givens;
162plot3;param3d;
163plottools;ged;
164polar;polarplot;
165polyarea;polygonmetrics;
166polyder;derivat;
167polygcd;gcd;// Octave
168polyval;horner;
169prctile;perctl;
170printdlg;toprint;
171psi;dlgamma;
172puts;mprintf;
173questdlg;messagebox;
174quiver;champ;
175rande;grand;// Octave
176randg;grand;
177randi;grand;
178randn;rand;
179randp;grand;// Octave
180randperm;grand;
181range;strange;
182residue;pfss;
183rbbox;rubberbox;
184realmax;number_properties;
185realmin;number_properties;
186regexprep;strsubst;
187rem;modulo;
188replace;strsubst;
189reshape;matrix;
190reverse;strrev;
191rmfield;null;
192rot90;flipdim;
193rows;size;// Octave
194run;exec;
195semilogx;plot;
196semilogy;plot;
197shg;show_window;
198skrewness;cmoment;// Octave
199sort;gsort;
200sortrows;gsort;
201source;exec;// Octave
202spalloc;spzeros;
203spdiags;diag;
204splitlines;strsplit;
205sprandn;sprand;
206sprandsym;sprand;
207spy;PlotSparse;
208stairs;plot2d2;
209startsWith;grep;
210stat;fileinfo;// Octave
211std;stdev;
212stdin;percentio;// Octave
213stdout;percentio;// Octave
214stderr;percentio;// Octave
215stem;plot2d3;
216str2func;execstr;
217strfind;strindex;
218strings;emptystr;
219strjoin;strcat;
220strjust;justify;
221strlength;length;
222strread;msscanf;
223strrep;strsubst;
224strtrim;stripblanks;
225strtrunc;strncpy;// Octave
226surf2patch;genfac3d;
227switch;select;
228tempdir;TMPDIR;
229terminal_size;lines;// Octave
230texlabel;math_rendering_features_in_graphic;
231text;xstring;
232textscan;msprintf;
233time;getdate;// Octave
234tolower;convstr;// Octave
235toupper;convstr;// Octave
236trapz;inttrap;
237true;percentt;
238tukeywin;window;
239typeinfo;typeof;// Octave
240uisetcolor;uigetcolor;
241uitable;uicontrol;
242unix;unix_g;
243upper;convstr;
244urlread;getURL;
245var;variance;
246version;getversion;
247vertcat;cat;
248waitforbuttonpress;xclick;
249warndlg;messagebox;
250webread;getURL;
251which;get_function_path;
252whos -file;listvarinfile;
253xlim;axes_properties;
254ylim;axes_properties;
255yyaxis;newaxes;
256zlim;axes_properties;
257zoom;zoom_rect;
diff --git a/scilab/modules/helptools/macros/help.sci b/scilab/modules/helptools/macros/help.sci
index c5fbc07..961ab1d 100644
--- a/scilab/modules/helptools/macros/help.sci
+++ b/scilab/modules/helptools/macros/help.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2008 - INRIA - Vincent COUVERT 2// Copyright (C) 2008 - INRIA - Vincent COUVERT
3// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2020 - Samuel GOUGEON 4// Copyright (C) 2020 - 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -53,8 +53,27 @@ function help(varargin)
53 if part(key,1)=="$" & (exists(key)==0 | length(key)==1) then 53 if part(key,1)=="$" & (exists(key)==0 | length(key)==1) then
54 key = "symbols"; 54 key = "symbols";
55 end 55 end
56 // Possible key redirection to Scilab's closest equivalent
57 key = helpRedirectExternal2Scilab(key)
58
56 // Calling the browser 59 // Calling the browser
57 helpbrowser(%helps(:,1), key, lang, %f); 60 helpbrowser(%helps(:,1), key, lang, %f);
58 // If the key is not a xml:id, then full-text search is done (See Java code) 61 // If the key is not a xml:id, then full-text search is done (See Java code)
59 62
60endfunction 63endfunction
64
65// ============================================================================
66
67function sciterm = helpRedirectExternal2Scilab(exterm)
68 sciterm = exterm
69 filename = SCIHOME + filesep() + "XConfiguration.xml"
70 res = xmlGetValues("//general/documentation/body/help", "redirectMatlab2Scilab", filename);
71 if res=="checked" then
72 filename = SCI + "/modules/helptools/data/external2scilab_equiv.csv"
73 tmp = csvRead(filename,";",[],"string",[]);
74 k = find(tmp(:,1)==exterm)
75 if k <> []
76 sciterm = tmp(k(1),2)
77 end
78 end
79endfunction