Changeset a3bc95e in git for Singular/emacs.cc


Ignore:
Timestamp:
Oct 9, 2001, 6:36:27 PM (23 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7497ef3773fc1afff892546445b1d82b1cf0fb05
Parents:
e58c4abd91b68d128331a23f3f9dd76dff924048
Message:
*hannes: namespaces ->ns


git-svn-id: file:///usr/local/Singular/svn/trunk@5651 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/emacs.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: emacs.cc,v 1.20 2001-08-27 14:46:56 Singular Exp $ */
     4/* $Id: emacs.cc,v 1.21 2001-10-09 16:35:57 Singular Exp $ */
    55/*
    66* ABSTRACT: Esingular main file
     
    7575void fePrintReportBug(char* msg, char* file, int line)
    7676{
    77   error("YOU HAVE FOUND A BUG IN SINGULAR. 
     77  error("YOU HAVE FOUND A BUG IN SINGULAR.
    7878Please, email the following output to singular@mathematik.uni-kl.de
    79 Bug occured at %s:%d 
    80 Message: %s 
     79Bug occured at %s:%d
     80Message: %s
    8181Version: " S_UNAME S_VERSION1 " (%lu) " __DATE__ __TIME__,
    8282        file, line, msg, feVersionId);
     
    100100  int no_emacs_call = 0;
    101101  char cwd[MAXPATHLEN];
    102  
     102
    103103  // parse-cmdline options
    104  
     104
    105105  feInitResources(argv[0]);
    106106  feResource('S');
    107107  feResource('b');
    108108  feResource('r');
    109  
     109
    110110  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,
    113113                                feOptSpec, &option_index))
    114114        != EOF)
     
    119119          feOptHelp(feArgv0);
    120120          exit(0);
    121          
     121
    122122        case '?':
    123123        case ':':
     
    134134                emacs = fe_optarg;
    135135              break;
    136 #else             
     136#else
    137137              case FE_OPT_EMACS:
    138138                emacs = fe_optarg;
    139139                break;
    140                
     140
    141141              case FE_OPT_EMACS_DIR:
    142142                emacs_dir = fe_optarg;
    143143                break;
    144                
     144
    145145              case FE_OPT_EMACS_LOAD:
    146146                emacs_load = fe_optarg;
    147147                break;
    148 #endif               
     148#endif
    149149              case FE_OPT_SINGULAR:
    150150                singular = fe_optarg;
     
    154154                no_emacs_call = 1;
    155155                break;
    156                
     156
    157157              default:
    158158                goto NEXT;
    159159          }
    160160          // delete options from option-list
    161           if (fe_optind > 2 && *argv[fe_optind-1] != '-' && 
     161          if (fe_optind > 2 && *argv[fe_optind-1] != '-' &&
    162162              fe_optarg != NULL && feOptSpec[option_index].has_arg)
    163163          {
     
    181181  if (emacs == NULL)
    182182  {
    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",
    184184           feResourceDefault('X'));
    185185    mainUsage();
    186186    exit(1);
    187187  }
    188  
     188
    189189  if (singular == NULL) singular = feResource("SingularXterm", 0);
    190190  if (singular == NULL)
    191191  {
    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",
    193193            feResourceDefault("SingularXterm"));
    194194    mainUsage();
     
    196196  }
    197197
    198 #ifdef WINNT 
     198#ifdef WINNT
    199199#define EXTRA_XTERM_ARGS "+vb -sl 2000 -fb Courier-bold-13 -tn linux -cr Red3"
    200200#else
     
    202202#endif
    203203
    204   syscall = (char*) omAlloc(strlen(emacs) + 
    205                                  strlen(singular) + 
     204  syscall = (char*) omAlloc(strlen(emacs) +
     205                                 strlen(singular) +
    206206                                 length + 300);
    207207  sprintf(syscall, "%s %s -e %s ", emacs, EXTRA_XTERM_ARGS, singular);
     
    215215    }
    216216  }
    217 #else 
     217#else
    218218  // make sure  emacs, singular, emacs_dir, emacs_load are set
    219219  if (emacs == NULL) emacs = feResource("xemacs", 0);
     
    221221  if (emacs == NULL)
    222222  {
    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",
    224224            feResourceDefault("emacs"), feResourceDefault("xemacs"));
    225225    mainUsage();
    226226    exit(1);
    227227  }
    228            
     228
    229229  if (singular == NULL) singular = feResource("SingularEmacs", 0);
    230230  if (singular == NULL)
    231231  {
    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",
    233233            feResourceDefault("SingularEmacs"));
    234234    mainUsage();
    235235    exit(1);
    236236  }
    237    
     237
    238238  if (emacs_dir == NULL) emacs_dir = feResource("EmacsDir", 0);
    239239  if (emacs_dir == NULL)
    240240  {
    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",
    242242            feResourceDefault("EmacsDir"));
    243243    mainUsage();
     
    245245  }
    246246
    247   if (emacs_load == NULL) 
     247  if (emacs_load == NULL)
    248248  {
    249249    // look into env variable
     
    268268        if (emacs_load == NULL)
    269269        {
    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"));
    272272          mainUsage();
    273273          exit(1);
     
    276276    }
    277277  }
    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) +
    282282                           strlen(emacs_load) +
    283283                           length + 300);
     
    288288  // append / at the end of cwd
    289289  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,
    292292  // xemacs-20.4 sometimes crashed on startup when using -q. DonŽt know why.
    293293  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,
    295295          singular, cwd);
    296296
Note: See TracChangeset for help on using the changeset viewer.