Changeset abcc453 in git


Ignore:
Timestamp:
Aug 25, 1999, 5:55:32 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
f413ec5a37bc71763011d1bf16abdf568577f1c3
Parents:
e08f696383073f7b970b3d9d0fe8268e271b795d
Message:
* small changes


git-svn-id: file:///usr/local/Singular/svn/trunk@3548 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/emacs.cc

    re08f69 rabcc453  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: emacs.cc,v 1.1 1999-08-25 15:26:01 obachman Exp $ */
     4/* $Id: emacs.cc,v 1.2 1999-08-25 15:55:32 obachman Exp $ */
    55/*
    66* ABSTRACT: Esingular main file
     
    7070  char* emacs_load = NULL;
    7171  int no_emacs_call = 0;
     72  char cwd[MAXPATHLEN];
    7273 
    7374  // parse-cmdline options
     
    126127  if (emacs == NULL)
    127128  {
    128     fprintf(stderr, "Error: Can't find emacs executable. \nExpected it at %s\n. Specify alternative with --emacs option, or set EMACS environment variable.\n",
     129    fprintf(stderr, "Error: Can't find emacs executable. \nExpected it at %s\n. Specify alternative with --emacs option,\n or set EMACS environment variable.\n",
    129130            feResourceDefault("emacs"));
    130131    mainUsage(argv[0]);
     
    135136  if (singular == NULL)
    136137  {
    137     fprintf(stderr, "Error: Can't find singular executable.\nExpected it at %s\nSpecify with --singular option, or set SINGULAR_EMACS environment variable.\n",
     138    fprintf(stderr, "Error: Can't find singular executable.\nExpected it at %s\nSpecify with --singular option,\n or set SINGULAR_EMACS environment variable.\n",
    138139            feResourceDefault("SingularEmacs"));
    139140    mainUsage(argv[0]);
     
    144145  if (emacs_dir == NULL)
    145146  {
    146     fprintf(stderr, "Error: Can't find emacs directory for Singular lisp files. \nExpected it at %s\nSpecify with --emacs_dir option, or set SINGULAR_EMACS_DIR environment variable.\n",
     147    fprintf(stderr, "Error: Can't find emacs directory for Singular lisp files. \nExpected it at %s\nSpecify with --emacs_dir option,\n or set SINGULAR_EMACS_DIR environment variable.\n",
    147148            feResourceDefault("EmacsDir"));
    148149    mainUsage(argv[0]);
     
    150151  }
    151152
    152   if (emacs_load == NULL) emacs_load = feResource("EmacsLoad", 0);
    153   if (emacs_load == NULL)
    154   {
    155     fprintf(stderr, "Error: Can't find emacs load file for Singular mode. \nExpected it at %s\nSpecify with --emacs_load option, or set SINGULAR_EMACS_LOAD environment variable.\n",
    156             feResourceDefault("EmacsLoad"));
    157     mainUsage(argv[0]);
    158     exit(1);
    159   }
    160  
     153  if (emacs_load == NULL)
     154  {
     155    // look into env variable
     156    emacs_load = getenv("SINGULAR_EMACS_LOAD");
     157    if (access(emacs_load, R_OK))
     158    {
     159      // look in home-dir
     160      emacs_load = getenv("HOME");
     161      sprintf(cwd, "%s/.emacs-singular", emacs_load);
     162      if (! access(cwd, R_OK))
     163      {
     164        emacs_load = mstrdup(cwd);
     165      }
     166      else
     167      {
     168        // try witrh resources
     169        emacs_load = feResource("EmacsLoad", 0);
     170        if (emacs_load == NULL)
     171        {
     172          fprintf(stderr, "Error: Can't find emacs load file for Singular mode. \nExpected it at %s\nSpecify with --emacs_load option,\n or set SINGULAR_EMACS_LOAD environment variable,\n or put file '.emacs-singular' in your home directory.\n",
     173                  feResourceDefault("EmacsLoad")); 
     174          mainUsage(argv[0]);
     175          exit(1);
     176        }
     177      }
     178    }
     179  }
    161180 
    162181  // construct options
     
    182201  if (strstr(emacs, "xemacs") || strstr(emacs, "Xemacs") || strstr(emacs, "XEMACS"))
    183202    prefix = "-";
    184   char cwd[MAXPATHLEN];
    185203  getcwd(cwd, MAXPATHLEN);
    186204
  • Singular/feResource.cc

    re08f69 rabcc453  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feResource.cc,v 1.8 1999-08-25 15:26:02 obachman Exp $ */
     4/* $Id: feResource.cc,v 1.9 1999-08-25 15:55:32 obachman Exp $ */
    55/*
    66* ABSTRACT: management of resources
     
    8686#ifdef ESINGULAR
    8787  {"emacs",    'E',    feResBinary, "EMACS",               "%b/emacs",              ""},
    88   {"SingularEmacs", 'M',    feResBinary, "SINGULAR_EMACS",  "%b/Singular",           ""},
    89   {"EmacsLoad",'l',    feResFile,   "SINGULAR_EMACS_LOAD", "%e/.singular-emacs",             ""},
     88  {"SingularEmacs",'M',feResBinary, "SINGULAR",             "%b/Singular",           ""},
     89  {"EmacsLoad",'l',    feResFile,   "SINGULAR_EMACS_LOAD",  "%e/.emacs-singular",             ""},
    9090#endif
    9191  {NULL, 0, feResUndef, NULL, NULL, NULL}, // must be the last record
Note: See TracChangeset for help on using the changeset viewer.