Changeset c06a32 in git for Singular/fehelp.cc
- Timestamp:
- Sep 20, 1999, 8:03:51 PM (25 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 70883173be34d0af981d9af508ccbb1e77912676
- Parents:
- aef7ccb547c93eee9ab75ef2c46ce9149f6dd9ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fehelp.cc
raef7ccb rc06a32 21 21 #include "ipshell.h" 22 22 #include "libparse.h" 23 #include "feOpt.h" 23 24 24 25 /***************************************************************** … … 149 150 Warn("No help for topic '%s' (not even for '*%s*')", str, str); 150 151 WarnS("Try '?;' for general help"); 151 WarnS("or '?Index;' for all available help topics ");152 WarnS("or '?Index;' for all available help topics."); 152 153 return; 153 154 } … … 182 183 { 183 184 int i = 0; 184 extern void mainSetSingOptionValue(const char* name, char* value);185 char* mainGetSingOptionValue(const char* name);186 187 // if no argument, see what we have as value to the option188 if (which == NULL || *which == '\0')189 which = mainGetSingOptionValue("browser");190 185 191 186 // if no argument, choose first available help browser 192 187 if (which == NULL || *which == '\0') 193 188 { 194 // unles one is already set 195 if (heCurrentHelpBrowser != NULL) goto Finish; 196 189 // return, if already set 190 if (heCurrentHelpBrowser != NULL) 191 return heCurrentHelpBrowser->browser; 192 193 // First, try emacs, if emacs-option is set 194 if (feOptValue(FE_OPT_EMACS) != NULL) 195 { 196 while (heHelpBrowsers[i].browser != NULL) 197 { 198 if (strcmp(heHelpBrowsers[i].browser, "emacs") == 0 && 199 (heHelpBrowsers[i].init_proc(0))) 200 { 201 heCurrentHelpBrowser = &(heHelpBrowsers[i]); 202 goto Finish; 203 } 204 i++; 205 } 206 i=0; 207 } 197 208 while (heHelpBrowsers[i].browser != NULL) 198 209 { … … 200 211 { 201 212 heCurrentHelpBrowser = &(heHelpBrowsers[i]); 202 return heCurrentHelpBrowser->browser;213 goto Finish; 203 214 } 204 215 i++; … … 215 226 if (heHelpBrowsers[i].browser == NULL) 216 227 { 217 if (warn) Warn("No help browser '%s' available ", which);228 if (warn) Warn("No help browser '%s' available.", which); 218 229 } 219 230 else … … 230 241 if (heCurrentHelpBrowser == NULL) 231 242 { 232 // choose first available help browser233 mainSetSingOptionValue("browser", "");234 243 feHelpBrowser(); 235 244 assume(heCurrentHelpBrowser != NULL); 236 245 if (warn) 237 Warn("Setting help browser to '%s' ", heCurrentHelpBrowser->browser);246 Warn("Setting help browser to '%s'.", heCurrentHelpBrowser->browser); 238 247 return heCurrentHelpBrowser->browser; 239 248 } … … 242 251 // or, leave as is 243 252 if (warn) 244 Warn("Help browser stays at '%s'", heCurrentHelpBrowser->browser); 253 Warn("Help browser stays at '%s'.", heCurrentHelpBrowser->browser); 254 return heCurrentHelpBrowser->browser; 245 255 } 246 256 247 257 Finish: 248 mainSetSingOptionValue("browser", heCurrentHelpBrowser->browser); 258 // update value of Browser Option 259 if (feOptSpec[FE_OPT_BROWSER].value == NULL || 260 strcmp((char*) feOptSpec[FE_OPT_BROWSER].value, 261 heCurrentHelpBrowser->browser) != 0) 262 { 263 if (feOptSpec[FE_OPT_BROWSER].value == NULL) 264 FreeL(feOptSpec[FE_OPT_BROWSER].value); 265 feOptSpec[FE_OPT_BROWSER].value 266 = (void*) mstrdup(heCurrentHelpBrowser->browser); 267 } 249 268 return heCurrentHelpBrowser->browser; 250 269 } … … 642 661 return; 643 662 644 if (heCurrentHelpBrowser == NULL) feHelpBrowser( );663 if (heCurrentHelpBrowser == NULL) feHelpBrowser(NULL, 0); 645 664 assume(heCurrentHelpBrowser != NULL); 646 665 if (! feHelpCalled) … … 722 741 { 723 742 if (warn) WarnS("no local HtmlDir found"); 724 if (warn) Warn("using %s instead", feResource('u' /*"ManualUrl"*/, warn)); 743 return FALSE; 744 // if (warn) Warn("using %s instead", feResource('u' /*"ManualUrl"*/, warn)); 725 745 } 726 746 return TRUE;
Note: See TracChangeset
for help on using the changeset viewer.