Changeset e6af18 in git


Ignore:
Timestamp:
Jul 23, 2013, 11:01:38 AM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c1c65551e4b3a0de0b13ddf30446f6e9569681b5')
Children:
71a263848349882522f62f6c6369df2489d587d6
Parents:
f052a168e8609d4cc9eec8ff570e13cf79d60b7c
Message:
fix: help for dynamic modules/proc

mainly from master
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/fehelp.cc

    rf052a1 re6af18  
    9999 *
    100100 *****************************************************************/
    101 // order is improtant -- first possible help is choosen
     101// order is important -- first possible help is chosen
    102102// moved to LIB/help.cnf
    103103static heBrowser_s *heHelpBrowsers=NULL;
     
    117117
    118118  BOOLEAN key_is_regexp = (strchr(str, '*') != NULL);
     119
     120  // try proc help and library help
     121  if (! key_is_regexp && heOnlineHelp(str)) return;
     122
    119123  heEntry_s hentry;
    120124  memset(&hentry,0,sizeof(hentry));
     
    127131    return;
    128132  }
    129 
    130   // try proc help and library help
    131   if (! key_is_regexp && heOnlineHelp(str)) return;
    132133
    133134  // Try to match approximately with key in index file
     
    191192    char *matches=StringEndS();
    192193    PrintS(matches);
     194    omFree(matches);
    193195    PrintLn();
    194     omFree(matches);
    195196    return;
    196197  }
     
    687688static BOOLEAN heOnlineHelp(char* s)
    688689{
    689   idhdl h=IDROOT->get(s,myynest);
    690690  char *ss;
    691 
     691  idhdl h;
     692
     693  if ((ss=strstr(s,"::"))!=NULL)
     694  {
     695    *ss='\0';
     696    ss+=2;
     697    h=ggetid(s);
     698    if (h!=NULL)
     699    {
     700      Print("help for %s from package %s\n",ss,s);
     701      char s_help[200];
     702      strcpy(s_help,ss);
     703      strcat(s_help,"_help");
     704      idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0);
     705      hePrintHelpStr(hh,s_help,s);
     706      return TRUE;
     707    }
     708    else Print("package %s not found\n",s);
     709    return TRUE; /* do not search the manual */
     710  }
     711  h=IDROOT->get(s,myynest);
    692712  // try help for a procedure
    693713  if (h!=NULL)
     
    707727        return TRUE;
    708728      }
    709       else
    710       {
    711         char s_help[200];
    712         strcpy(s_help,s);
    713         strcat(s_help,"_help");
    714         idhdl hh=IDROOT->get(s_help,0);
    715         hePrintHelpStr(hh,s_help,"Top");
    716       }
    717729    }
    718730    else if (IDTYP(h)==PACKAGE_CMD)
     
    720732      idhdl hh=IDPACKAGE(h)->idroot->get("info",0);
    721733      hePrintHelpStr(hh,"info",s);
    722     }
    723     else if ((ss=strstr(s,"::"))!=NULL)
    724     {
    725       *ss='\0';
    726       ss+=2;
    727       h=ggetid(s);
    728       if (h!=NULL)
    729       {
    730         Print("help for %s from package %s\n",ss,s);
    731         char s_help[200];
    732         strcpy(s_help,ss);
    733         strcat(s_help,"_help");
    734         idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0);
    735         hePrintHelpStr(hh,s_help,s);
    736       }
    737       else Print("package %s not found\n",s);
     734      return TRUE;
    738735    }
    739736    return FALSE;
     
    892889               if (feResource(*p, warn) == NULL)
    893890               {
    894                  if (warn) Warn("ressource `%c` not found",*p);
     891                 if (warn) Warn("resource `%c` not found",*p);
    895892                 return FALSE;
    896893               }
     
    899896               if (getenv("DISPLAY") == NULL)
    900897               {
    901                  if (warn) WarnS("ressource `D` not found");
     898                 if (warn) WarnS("resource `D` not found");
    902899                 return FALSE;
    903900               }
     
    984981{
    985982  char sys[MAX_SYSCMD_LEN];
    986   // char url[MAXPATHLEN];
    987983  const char *p=heHelpBrowsers[br].action;
    988984  if (p==NULL) {PrintS("no action ?\n"); return;}
     
    10671063  }
    10681064  Print("running `%s`\n",sys);
    1069   /*int dummy=*/ (void) system(sys);
     1065  (void) system(sys);
    10701066}
    10711067
Note: See TracChangeset for help on using the changeset viewer.