Changeset 8de37df in git for Singular/fehelp.cc


Ignore:
Timestamp:
Jul 25, 2013, 12:41:16 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
c3066da943ed65e5390f6c04d9a69f7710bfc835
Parents:
0ab2b929de2eb4a16c8561981bbcef044441f40184be8311db7b7c6d637ef65e96f4fca1ad9e06e8
Message:
Merge pull request #343 from mmklee/various_sw

Various sw
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/fehelp.cc

    r84be83 r8de37df  
    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.