* Bug 16328 fixed: typos exists => exist
[scilab.git] / scilab / modules / helptools / macros / help.sci
index 8c81c99..efd7068 100644 (file)
@@ -9,7 +9,6 @@
 // and continues to be available under such terms.
 // For more information, see the COPYING file which you should have received
 // along with this program.
-// === LICENSE_END ===
 
 function help(varargin)
 
@@ -33,13 +32,16 @@ function help(varargin)
             end
 
             if type(key) <> 10 then
-                error(999,msprintf(_("%s: Wrong type for input argument #%d: string expected.\n"),"help",1));
+                error(msprintf(_("%s: Wrong type for input argument #%d: string expected.\n"),"help",1));
             end
 
             // Search a function name
             key=stripblanks(key)
 
-            if or(part(key,1)==["(",")","[","]","{","}","%","''","""",":","*","/","\",".","<",">","&","^","|","~","+","-"]) & exists(key)==0 then
+            global %helps
+            symbols = strsplit("()[]{}%''"":*/\.<>&^|~+-")';
+            exceptions = ["%t" "%T" "%f" "%F" "%onprompt"]; // http://bugzilla.scilab.org/15356
+            if or(part(key,1)==symbols) & exists(key)==0 & and(key~=exceptions) then
                 key="symbols";
             end
 
@@ -48,10 +50,9 @@ function help(varargin)
                 key="symbols";
             end
 
-            global %helps
             helpbrowser(%helps(:,1), key, getlanguage(), %f);
 
-            // If the function name does not exists then full-text search is done (See Java code)
+            // If the function name does not exist, then full-text search is done (See Java code)
 
         else
             error(msprintf(gettext("%s: The help browser is disabled in %s mode.\n"), "help", getscilabmode()));