* Bug 14585: editvar(close) replaces closeEditvar() 46/20946/7
Samuel GOUGEON [Mon, 15 Apr 2019 18:47:22 +0000 (20:47 +0200)]
  http://bugzilla.scilab.org/14585
  closeEditvar removal: https://codereview.scilab.org/20946

Change-Id: I6941329981f2a096c02197cd7b5dfbcbc681dc27

scilab/CHANGES.md
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp
scilab/modules/ui_data/help/en_US/closeEditvar.xml
scilab/modules/ui_data/help/en_US/editvar.xml
scilab/modules/ui_data/help/ja_JP/closeEditvar.xml
scilab/modules/ui_data/help/ja_JP/editvar.xml [deleted file]
scilab/modules/ui_data/sci_gateway/cpp/sci_editvar.cpp

index 9050b40..7ca0da7 100644 (file)
@@ -316,6 +316,7 @@ Bug Fixes
 * [#14498](https://bugzilla.scilab.org/14498): `size([],3)` returned 1 instead of 0.
 * [#14487](https://bugzilla.scilab.org/14487): matrix indexing was not coherent with MATLAB. 
 * [#14502](https://bugzilla.scilab.org/14502): `Demo > GUI > Uicontrols 2` could not be exported to a file.
+* [#14585](https://bugzilla.scilab.org/14585): `closeEditvar()` had to be replaced with `editvar("close")`.
 * [#14604](https://bugzilla.scilab.org/14604): `emptystr` is 40x slower with 6.0.0 wrt 5.5.2
 * [#14605](https://bugzilla.scilab.org/14605): fixed - `bench_run` was too strict about the specification of tests names.
 * [#14606](https://bugzilla.scilab.org/14606): Memory used by variables returned by `[names,mem]=who()` was always zero.
index 09631c3..7f64ed7 100644 (file)
@@ -95,16 +95,17 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     // Scilab 6.1.0 => 6.1.x
 
     // Scilab 6.0.x => 6.1.0
-    map.emplace(L"get_figure_handle", L"findobj(\'figure_id\',n)");
-    map.emplace(L"champ1", L"champ.colored");
     map.emplace(L"%sn", L"ellipj");
+    map.emplace(L"champ1", L"champ.colored");
+    map.emplace(L"closeEditvar", L"editvar");
     map.emplace(L"dirname", L"fileparts");
     map.emplace(L"_d", L"_");
     map.emplace(L"dgettext", L"gettext");
     map.emplace(L"datatipToggle", L"datatipManagerMode");
     map.emplace(L"denom", L".den");
-    map.emplace(L"frexp", L"log2");
     map.emplace(L"eval", L"evstr");
+    map.emplace(L"frexp", L"log2");
+    map.emplace(L"get_figure_handle", L"findobj(\'figure_id\',n)");
     map.emplace(L"getPreferencesValue", L"xmlGetValues");
     map.emplace(L"hypermat", L"zeros|matrix");
     map.emplace(L"lstsize", L"size");
@@ -114,13 +115,13 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     map.emplace(L"numer", L".num");
     map.emplace(L"ric_desc", L"riccati");
     map.emplace(L"saveafterncommands", L"");
+    map.emplace(L"scatter3", L"scatter3d");
     map.emplace(L"setPreferencesValue", L"xmlSetValues");
     map.emplace(L"square", L"replot");
     map.emplace(L"sysdiag", L"blockdiag");
     map.emplace(L"with_tk", L"with_module('tclsci')");
     map.emplace(L"xgetech", L"gca");
     map.emplace(L"xinfo", L"gcf().info_message");
-    map.emplace(L"scatter3", L"scatter3d");
 
     // Scilab 5.5.2 => 6.0.0
     map.emplace(L"fort", L"call");
index 4c197d0..d2d2de3 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="closeEditvar">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="closeEditvar">
     <refnamediv>
         <refname>closeEditvar</refname>
-        <refpurpose>Close the variable editor</refpurpose>
+        <refpurpose>Close the variable editor <emphasis role="bold">(obsolete)</emphasis></refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
     </refsynopsisdiv>
     <refsection>
         <title>Description</title>
+        <warning>
+            <para>
+                <literal>closeEditvar()</literal> will be removed in Scilab 6.1.x Please use
+                <literal>editvar("close")</literal> instead.
+            </para>
+        </warning>
         <para>
             <literal>closeEditvar</literal> closes the variable editor.
         </para>
@@ -53,6 +62,12 @@ closeEditvar();
                     Function <literal>closeEditvar()</literal> introduced
                 </revremark>
             </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    Function tagged obsolete.
+                </revremark>
+            </revision>
         </revhistory>
     </refsection>
 
index 4b3e63d..6e82128 100644 (file)
@@ -4,8 +4,8 @@
  * Copyright (C) Jaime Urzua
  * Copyright (C) Allan CORNET - DIGITEO - 2010
  * Copyright (C) Sylvestre Ledru - Scilab Enterprises - 2011
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="editvar">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="editvar">
     <refnamediv>
         <refname>editvar</refname>
         <refpurpose>Scilab variable editor</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>editvar varname</synopsis>
+        <synopsis>
+            editvar("close")
+            editvar(varname)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
             <varlistentry>
                 <term>varname</term>
                 <listitem>
-                    <para>variable name. The variable must exist in the current Scilab environment.</para>
+                    <para>
+                        name (single string) of the variable name to edit. The variable must exist
+                        in the current Scilab environment. It must refer to a scalar, vector or
+                        matrix of
+                        <itemizedlist>
+                            <listitem>booleans (dense or sparse)
+                            </listitem>
+                            <listitem>encoded integers (int8, uint8, int16, uint16, int32, uint32)
+                            </listitem>
+                            <listitem>real or complex numbers (dense or sparse)
+                            </listitem>
+                            <listitem>strings
+                            </listitem>
+                        </itemizedlist>
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Description</title>
         <para>
-            <literal>editvar</literal> is the Scilab variable editor.
+            <literal>editvar(varname)</literal> interactively edits the variable whose name
+            is provided by <varname>varname</varname>.
         </para>
         <para>
-            <literal>editvar</literal> can be started by calling it on the name of the variable or by double-clicking on the name of the variable from the <link linkend="browsevar">browsevar component</link>.
+            Several variables can be edited in the same time. <literal>editvar(varname)</literal>
+            must be called once for each of them. In the editor, a new tab is opened for each
+            edited variable.
         </para>
+        <note>
+            <para>
+                Predefined protected constants of supported types can't be edited:
+                <literal>%pi</literal>, <literal>%e</literal>, <literal>%eps</literal>,
+                <literal>%i</literal>, <literal>%inf</literal>, <literal>%nan</literal>,
+                <literal>%f</literal>, <literal>%F</literal>, <literal>%t</literal>, <literal>%T</literal>,
+                <literal>home</literal>, <literal>SCIHOME</literal>, <literal>SCI</literal>,
+                <literal>WSCI</literal>, <literal>TMPDIR</literal>.
+            </para>
+        </note>
         <para>
-            <literal>editvar</literal> has numerous features:
-            <itemizedlist>
-                <listitem><para>
-                        Matrix visualisation
-                        <para/>
+            <literal>editvar("close")</literal> or <literal>editvar close</literal>
+            closes the open variables editor.
+        </para>
+        <refsect3>
+            <title>Editor's features</title>
+            <para>
+                <literal>editvar</literal> has numerous features:
+                <itemizedlist>
+                    <listitem>
                         <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_default.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                            Matrix visualisation
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_default.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
                         </para>
-                        <para/>
-
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Undo/redo capabilities
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Cell editing
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Expression evaluation. Please note that editvar will not store the expression. Only the value.
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_modify.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Undo/redo capabilities
                         </para>
-                        <para/>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Advanced selection of elements (available with the CTRL key)
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_adv_selection.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Cell editing
                         </para>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Plotting
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_plot.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Expression evaluation. Please note that editvar will not store the
+                            expression. Only the value.
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_modify.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
+                            <para/>
                         </para>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Plotting of a subset
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_subplot.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Advanced selection of elements (available with the CTRL key)
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_adv_selection.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
                         </para>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Variable format (short, shortE, long or longE formats)
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_format.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Plotting
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_plot.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
                         </para>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Column / lines management (insert, delete, copy and paste, ... )
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_column.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Plotting of a subset
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_subplot.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
                         </para>
-                        <para/>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Full copy and paste between <ulink url="http://www.libreoffice.org/">Libreoffice</ulink>/Openoffice or Microsoft Excel and Scilab (both ways)
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_libreoffice.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Variable format (short, shortE, long or longE formats)
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_format.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
                         </para>
-                        <para/>
-                        <para/>
-                    </para>
-                </listitem>
-                <listitem><para>
-                        Renaming or copy of a variable
-                        <para/>
-                        <para>
-                            <inlinemediaobject>
-                                <imageobject>
-                                    <imagedata fileref="../images/editvar_variable_selection.png"/>
-                                </imageobject>
-                            </inlinemediaobject>
+                    </listitem>
+                    <listitem><para>
+                            Column / lines management (insert, delete, copy and paste, ... )
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_column.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
+                            <para/>
                         </para>
-                        <para/>
-                    </para>
-                </listitem>
-            </itemizedlist>
-        </para>
-        <para>
-            <literal>editvar</literal> can edit the following variable types:
-
-            <itemizedlist>
-                <listitem><para>
-                        Real or complex constant matrix (type 1)
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <link linkend="matrices">Boolean matrix</link> (type 4)
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <link linkend="sparse">Sparse matrix</link> (type 5)
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <link linkend="sparse">Boolean sparse matrix</link> (type 6)
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <link linkend="int8">Integer matrix</link>: 8, 16 &amp; 32 bytes (type 8)
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <link linkend="strings">Matrix of strings</link> (type 10)
-                    </para>
-                </listitem>
-            </itemizedlist>
-        </para>
+                    </listitem>
+                    <listitem><para>
+                            Full copy and paste between
+                            <ulink url="http://www.libreoffice.org/">Libreoffice</ulink>/Openoffice
+                            or Microsoft Excel and Scilab (both ways).
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_libreoffice.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
+                            <para/>
+                        </para>
+                    </listitem>
+                    <listitem><para>
+                            Renaming or copy of a variable
+                            <para/>
+                            <para>
+                                <inlinemediaobject>
+                                    <imageobject>
+                                        <imagedata fileref="../images/editvar_variable_selection.png"/>
+                                    </imageobject>
+                                </inlinemediaobject>
+                            </para>
+                            <para/>
+                        </para>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
     </refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-a=rand(10,10);
+a = rand(10,10);
 editvar a;
-b=['hello';'good bye'];
+b = ['hello';'good bye'];
 editvar b;
-sp=sparse([1,2;4,5;3,10],[1,2,3])
+sp = sparse([1,2;4,5;3,10],[1,2,3])
 editvar("sp");
  ]]></programlisting>
     </refsection>
@@ -228,8 +236,31 @@ editvar("sp");
         <title>See also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="closeEditvar">closeEditvar</link>
+                <link linkend="browsevar">browsevar</link>
+            </member>
+            <member>
+                <link linkend="whos">whos</link>
+            </member>
+            <member>
+                <link linkend="edit">edit</link>
+            </member>
+            <member>
+                <link linkend="ged">ged</link>
+            </member>
+            <member>
+                <link linkend="tree_show">tree_show</link>
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    editvar("close") added
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 40d7580..2013119 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="closeEditvar">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="ja" xml:id="closeEditvar">
     <refnamediv>
         <refname>closeEditvar</refname>
-        <refpurpose>変数エディタを閉じる</refpurpose>
+        <refpurpose>変数エディタを閉じる  <emphasis role="bold">(obsolete)</emphasis></refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>呼び出し手順</title>
     </refsynopsisdiv>
     <refsection>
         <title>説明</title>
+        <warning>
+            <para>
+                <literal>closeEditvar()</literal> will be removed in Scilab 6.1.x Please use
+                <literal>editvar("close")</literal> instead.
+            </para>
+        </warning>
         <para>
             <literal>closeEditvar</literal> は変数エディタを閉じます.
         </para>
@@ -53,6 +62,12 @@ closeEditvar();
                     関数 <literal>closeEditvar()</literal>が導入されました.
                 </revremark>
             </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    Function tagged obsolete.
+                </revremark>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
diff --git a/scilab/modules/ui_data/help/ja_JP/editvar.xml b/scilab/modules/ui_data/help/ja_JP/editvar.xml
deleted file mode 100644 (file)
index e4fc8fb..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) Jaime Urzua
- * Copyright (C) Allan CORNET - DIGITEO - 2010
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="editvar">
-    <refnamediv>
-        <refname>editvar</refname>
-        <refpurpose>Scilab変数エディタ</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>呼び出し手順</title>
-        <synopsis>editvar varname</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>引数</title>
-        <variablelist>
-            <varlistentry>
-                <term>varname</term>
-                <listitem>
-                    <para>変数名. 変数はScilab上に存在する必要があります.</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>説明</title>
-        <para>
-            <literal>editvar</literal> は標準のScilab変数エディタです.
-        </para>
-        <para>
-            <literal>editvar</literal> は以下の変数型を編集できます: 実数または複素数定数行列 (type 1),
-            論理値行列 (type 4) 文字列の行列 (type 10).
-        </para>
-    </refsection>
-    <refsection>
-        <title>例</title>
-        <programlisting role="example"><![CDATA[
-a=rand(10,10);
-editvar a;
-b=['hello';'good bye'];
-editvar b;
- ]]></programlisting>
-    </refsection>
-</refentry>
index 9bfc4c1..0c1878a 100644 (file)
@@ -197,58 +197,60 @@ int sci_editvar(char * fname, void* pvApiCtx)
         return 0;
     }
 
-    /* get address of the variable*/
-    sciErr = getVarAddressFromName(pvApiCtx, pStVarOne, &piAddr);
-    if (sciErr.iErr)
+    /* Workaround to check for permanent variable.*/
+
+    if (strcmp(pStVarOne, "$")              == 0 ||
+            strcmp(pStVarOne, "%e")         == 0 ||
+            strcmp(pStVarOne, "%eps")       == 0 ||
+            strcmp(pStVarOne, "%fftw")      == 0 ||
+            strcmp(pStVarOne, "%f")         == 0 ||
+            strcmp(pStVarOne, "%F")         == 0 ||
+            strcmp(pStVarOne, "%gui")       == 0 ||
+            strcmp(pStVarOne, "%i")         == 0 ||
+            strcmp(pStVarOne, "%io")        == 0 ||
+            strcmp(pStVarOne, "%inf")       == 0 ||
+            strcmp(pStVarOne, "%nan")       == 0 ||
+            strcmp(pStVarOne, "%pi")        == 0 ||
+            strcmp(pStVarOne, "%s")         == 0 ||
+            strcmp(pStVarOne, "%tk")        == 0 ||
+            strcmp(pStVarOne, "%t")         == 0 ||
+            strcmp(pStVarOne, "%T")         == 0 ||
+            strcmp(pStVarOne, "%z")         == 0 ||
+            strcmp(pStVarOne, "evoid")      == 0 ||
+            strcmp(pStVarOne, "home")       == 0 ||
+            strcmp(pStVarOne, "PWD")        == 0 ||
+            strcmp(pStVarOne, "SCI")        == 0 ||
+            strcmp(pStVarOne, "SCIHOME")    == 0 ||
+            strcmp(pStVarOne, "TMPDIR")     == 0 )
     {
-        Scierror(4, _("%s: Undefined variable: %s.\n"), fname, pStVarOne);
+        Scierror(13, _("Redefining permanent variable.\n"), fname);
         freeAllocatedSingleString(pStVarOne);
         return 0;
     }
 
-    /* Workaround to check for permanent variable.*/
-
-    if (strcmp(pStVarOne, "$")                     == 0 ||
-            strcmp(pStVarOne, "%e")                == 0 ||
-            strcmp(pStVarOne, "%eps")          == 0 ||
-            strcmp(pStVarOne, "%fftw")         == 0 ||
-            strcmp(pStVarOne, "%f")                == 0 ||
-            strcmp(pStVarOne, "%F")                == 0 ||
-            strcmp(pStVarOne, "%gui")          == 0 ||
-            strcmp(pStVarOne, "%i")                == 0 ||
-            strcmp(pStVarOne, "%io")           == 0 ||
-            strcmp(pStVarOne, "%inf")          == 0 ||
-            strcmp(pStVarOne, "%nan")          == 0 ||
-            strcmp(pStVarOne, "%pi")           == 0 ||
-            strcmp(pStVarOne, "%s")            == 0 ||
-            strcmp(pStVarOne, "%tk")           == 0 ||
-            strcmp(pStVarOne, "%t")            == 0 ||
-            strcmp(pStVarOne, "%T")            == 0 ||
-            strcmp(pStVarOne, "%z")            == 0 ||
-            strcmp(pStVarOne, "evoid")     == 0 ||
-            strcmp(pStVarOne, "home")          == 0 ||
-            strcmp(pStVarOne, "PWD")           == 0 ||
-            strcmp(pStVarOne, "SCI")           == 0 ||
-            strcmp(pStVarOne, "SCIHOME")       == 0 ||
-            strcmp(pStVarOne, "TMPDIR")        == 0 )
+    /* Closing the editor
+       ------------------
+    */
+    if (strcmp(pStVarOne, "close") == 0)
     {
-        Scierror(13, _("Redefining permanent variable.\n"), fname);
+        EditVar::closeVariableEditor(getScilabJavaVM());
         freeAllocatedSingleString(pStVarOne);
         return 0;
     }
+    /* Otherwise : go on editing */
+
 
-    if (Rhs == 1)
+    /* get address of the variable*/
+    sciErr = getVarAddressFromName(pvApiCtx, pStVarOne, &piAddr);
+    if (sciErr.iErr)
     {
-        /* get address of the variable*/
-        sciErr = getVarAddressFromName(pvApiCtx, pStVarOne, &piAddr);
-        if (sciErr.iErr)
-        {
-            Scierror(4, _("%s: Undefined variable: %s.\n"), fname, pStVarOne);
-            freeAllocatedSingleString(pStVarOne);
-            return 0;
-        }
+        Scierror(4, _("%s: Undefined variable: %s.\n"), fname, pStVarOne);
+        freeAllocatedSingleString(pStVarOne);
+        return 0;
     }
-    else
+
+
+    if (Rhs > 1)
     {
         sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr);
         if (sciErr.iErr)