Changeset a3bc95e in git for Singular/emacs.cc
- Timestamp:
- Oct 9, 2001, 6:36:27 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7497ef3773fc1afff892546445b1d82b1cf0fb05
- Parents:
- e58c4abd91b68d128331a23f3f9dd76dff924048
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/emacs.cc
re58c4a ra3bc95e 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: emacs.cc,v 1.2 0 2001-08-27 14:46:56Singular Exp $ */4 /* $Id: emacs.cc,v 1.21 2001-10-09 16:35:57 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: Esingular main file … … 75 75 void fePrintReportBug(char* msg, char* file, int line) 76 76 { 77 error("YOU HAVE FOUND A BUG IN SINGULAR. 77 error("YOU HAVE FOUND A BUG IN SINGULAR. 78 78 Please, email the following output to singular@mathematik.uni-kl.de 79 Bug occured at %s:%d 80 Message: %s 79 Bug occured at %s:%d 80 Message: %s 81 81 Version: " S_UNAME S_VERSION1 " (%lu) " __DATE__ __TIME__, 82 82 file, line, msg, feVersionId); … … 100 100 int no_emacs_call = 0; 101 101 char cwd[MAXPATHLEN]; 102 102 103 103 // parse-cmdline options 104 104 105 105 feInitResources(argv[0]); 106 106 feResource('S'); 107 107 feResource('b'); 108 108 feResource('r'); 109 109 110 110 int optc, option_index; 111 112 while ((optc = fe_getopt_long(argc, argv, SHORT_OPTS_STRING, 111 112 while ((optc = fe_getopt_long(argc, argv, SHORT_OPTS_STRING, 113 113 feOptSpec, &option_index)) 114 114 != EOF) … … 119 119 feOptHelp(feArgv0); 120 120 exit(0); 121 121 122 122 case '?': 123 123 case ':': … … 134 134 emacs = fe_optarg; 135 135 break; 136 #else 136 #else 137 137 case FE_OPT_EMACS: 138 138 emacs = fe_optarg; 139 139 break; 140 140 141 141 case FE_OPT_EMACS_DIR: 142 142 emacs_dir = fe_optarg; 143 143 break; 144 144 145 145 case FE_OPT_EMACS_LOAD: 146 146 emacs_load = fe_optarg; 147 147 break; 148 #endif 148 #endif 149 149 case FE_OPT_SINGULAR: 150 150 singular = fe_optarg; … … 154 154 no_emacs_call = 1; 155 155 break; 156 156 157 157 default: 158 158 goto NEXT; 159 159 } 160 160 // delete options from option-list 161 if (fe_optind > 2 && *argv[fe_optind-1] != '-' && 161 if (fe_optind > 2 && *argv[fe_optind-1] != '-' && 162 162 fe_optarg != NULL && feOptSpec[option_index].has_arg) 163 163 { … … 181 181 if (emacs == NULL) 182 182 { 183 error( "Error: Can't find emacs xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set ESINGULAR_EMACS environment variable to the name of the program to use as xterm.\n", 183 error( "Error: Can't find emacs xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set ESINGULAR_EMACS environment variable to the name of the program to use as xterm.\n", 184 184 feResourceDefault('X')); 185 185 mainUsage(); 186 186 exit(1); 187 187 } 188 188 189 189 if (singular == NULL) singular = feResource("SingularXterm", 0); 190 190 if (singular == NULL) 191 191 { 192 error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set TSINGULAR_SINGULAR environment variable.\n", 192 error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set TSINGULAR_SINGULAR environment variable.\n", 193 193 feResourceDefault("SingularXterm")); 194 194 mainUsage(); … … 196 196 } 197 197 198 #ifdef WINNT 198 #ifdef WINNT 199 199 #define EXTRA_XTERM_ARGS "+vb -sl 2000 -fb Courier-bold-13 -tn linux -cr Red3" 200 200 #else … … 202 202 #endif 203 203 204 syscall = (char*) omAlloc(strlen(emacs) + 205 strlen(singular) + 204 syscall = (char*) omAlloc(strlen(emacs) + 205 strlen(singular) + 206 206 length + 300); 207 207 sprintf(syscall, "%s %s -e %s ", emacs, EXTRA_XTERM_ARGS, singular); … … 215 215 } 216 216 } 217 #else 217 #else 218 218 // make sure emacs, singular, emacs_dir, emacs_load are set 219 219 if (emacs == NULL) emacs = feResource("xemacs", 0); … … 221 221 if (emacs == NULL) 222 222 { 223 error( "Error: Can't find emacs or xemacs executable. \n Expected it at %s or %s\n Specify alternative with --emacs option,\n or set ESINGULAR_EMACS environment variable.\n", 223 error( "Error: Can't find emacs or xemacs executable. \n Expected it at %s or %s\n Specify alternative with --emacs option,\n or set ESINGULAR_EMACS environment variable.\n", 224 224 feResourceDefault("emacs"), feResourceDefault("xemacs")); 225 225 mainUsage(); 226 226 exit(1); 227 227 } 228 228 229 229 if (singular == NULL) singular = feResource("SingularEmacs", 0); 230 230 if (singular == NULL) 231 231 { 232 error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set ESINGULAR_SINGULAR environment variable.\n", 232 error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set ESINGULAR_SINGULAR environment variable.\n", 233 233 feResourceDefault("SingularEmacs")); 234 234 mainUsage(); 235 235 exit(1); 236 236 } 237 237 238 238 if (emacs_dir == NULL) emacs_dir = feResource("EmacsDir", 0); 239 239 if (emacs_dir == NULL) 240 240 { 241 error( "Error: Can't find emacs directory for Singular lisp files. \n Expected it at %s\n Specify with --emacs_dir option,\n or set ESINGULAR_EMACS_DIR environment variable.\n", 241 error( "Error: Can't find emacs directory for Singular lisp files. \n Expected it at %s\n Specify with --emacs_dir option,\n or set ESINGULAR_EMACS_DIR environment variable.\n", 242 242 feResourceDefault("EmacsDir")); 243 243 mainUsage(); … … 245 245 } 246 246 247 if (emacs_load == NULL) 247 if (emacs_load == NULL) 248 248 { 249 249 // look into env variable … … 268 268 if (emacs_load == NULL) 269 269 { 270 error( "Error: Can't find emacs load file for Singular mode. \n Expected it at %s\n Specify with --emacs_load option,\n or set ESINGULAR_EMACS_LOAD environment variable,\n or put file '.emacs-singular' in your home directory.\n", 271 feResourceDefault("EmacsLoad")); 270 error( "Error: Can't find emacs load file for Singular mode. \n Expected it at %s\n Specify with --emacs_load option,\n or set ESINGULAR_EMACS_LOAD environment variable,\n or put file '.emacs-singular' in your home directory.\n", 271 feResourceDefault("EmacsLoad")); 272 272 mainUsage(); 273 273 exit(1); … … 276 276 } 277 277 } 278 279 syscall = (char*) omAlloc(strlen(emacs) + 280 strlen(singular) + 281 strlen(emacs_dir) + 278 279 syscall = (char*) omAlloc(strlen(emacs) + 280 strlen(singular) + 281 strlen(emacs_dir) + 282 282 strlen(emacs_load) + 283 283 length + 300); … … 288 288 // append / at the end of cwd 289 289 if (cwd[strlen(cwd)-1] != '/') strcat(cwd, "/"); 290 291 // Note: option -no-init-file should be equivalent to -q. Anyhow, 290 291 // Note: option -no-init-file should be equivalent to -q. Anyhow, 292 292 // xemacs-20.4 sometimes crashed on startup when using -q. DonŽt know why. 293 293 sprintf(syscall, "%s %seval '(setq singular-emacs-home-directory \"%s\")' %sno-init-file %sl %s %seval '(singular-other \"%s\" \"%s\" (list ", 294 emacs, prefix, emacs_dir, prefix, prefix, emacs_load, prefix, 294 emacs, prefix, emacs_dir, prefix, prefix, emacs_load, prefix, 295 295 singular, cwd); 296 296
Note: See TracChangeset
for help on using the changeset viewer.