/[emacs]/emacs/src/emacs.c
ViewVC logotype

Diff of /emacs/src/emacs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.309 by walters, Tue May 28 16:25:37 2002 UTC revision 1.309.2.1 by miles, Fri Apr 4 06:20:58 2003 UTC
# Line 87  EMACS_INT gdb_emacs_intbits = sizeof (EM Line 87  EMACS_INT gdb_emacs_intbits = sizeof (EM
87  #ifdef DATA_SEG_BITS  #ifdef DATA_SEG_BITS
88  EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS;  EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS;
89  #else  #else
90  EMACS_INT  gdb_data_seg_bits = 0;  EMACS_INT gdb_data_seg_bits = 0;
91  #endif  #endif
92  EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;  EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;
93    
# Line 158  Lisp_Object Vprevious_system_messages_lo Line 158  Lisp_Object Vprevious_system_messages_lo
158  Lisp_Object Vsystem_time_locale;  Lisp_Object Vsystem_time_locale;
159  Lisp_Object Vprevious_system_time_locale;  Lisp_Object Vprevious_system_time_locale;
160    
161  /* If non-zero, emacs should not attempt to use an window-specific code,  /* If non-zero, emacs should not attempt to use a window-specific code,
162     but instead should use the virtual terminal under which it was started.  */     but instead should use the virtual terminal under which it was started.  */
163  int inhibit_window_system;  int inhibit_window_system;
164    
# Line 228  read the main documentation for these co Line 228  read the main documentation for these co
228  Initialization options:\n\  Initialization options:\n\
229  \n\  \n\
230  --batch                 do not do interactive display; implies -q\n\  --batch                 do not do interactive display; implies -q\n\
231    --script FILE           run FILE as an Emacs Lisp script.\n\
232  --debug-init            enable Emacs Lisp debugger during init file\n\  --debug-init            enable Emacs Lisp debugger during init file\n\
233  --help                  display this help message and exit\n\  --help                  display this help message and exit\n\
234  --multibyte, --no-unibyte   run Emacs in multibyte mode\n\  --multibyte, --no-unibyte   run Emacs in multibyte mode\n\
# Line 425  init_cmdargs (argc, argv, skip_args) Line 426  init_cmdargs (argc, argv, skip_args)
426  {  {
427    register int i;    register int i;
428    Lisp_Object name, dir, tem;    Lisp_Object name, dir, tem;
429    int count = specpdl_ptr - specpdl;    int count = SPECPDL_INDEX ();
430    Lisp_Object raw_name;    Lisp_Object raw_name;
431    
432    initial_argv = argv;    initial_argv = argv;
# Line 743  bug_reporting_address () Line 744  bug_reporting_address ()
744    if (!STRINGP(temp))    if (!STRINGP(temp))
745      return REPORT_EMACS_BUG_ADDRESS;      return REPORT_EMACS_BUG_ADDRESS;
746    
747    string = XSTRING (temp)->data;    string = SDATA (temp);
748    
749    /* Count dots in `emacs-version'.  */    /* Count dots in `emacs-version'.  */
750    while (*string)    while (*string)
# Line 761  bug_reporting_address () Line 762  bug_reporting_address ()
762    
763  /* ARGSUSED */  /* ARGSUSED */
764  int  int
765  main (argc, argv, envp)  main (argc, argv
766    #ifdef VMS
767    , envp
768    #endif
769    )
770       int argc;       int argc;
771       char **argv;       char **argv;
772    #ifdef VMS
773       char **envp;       char **envp;
774    #endif
775  {  {
776  #if GC_MARK_STACK  #if GC_MARK_STACK
777    Lisp_Object dummy;    Lisp_Object dummy;
# Line 779  main (argc, argv, envp) Line 786  main (argc, argv, envp)
786    struct rlimit rlim;    struct rlimit rlim;
787  #endif  #endif
788    int no_loadup = 0;    int no_loadup = 0;
789      char *junk = 0;
790    
791  #if GC_MARK_STACK  #if GC_MARK_STACK
792    extern Lisp_Object *stack_base;    extern Lisp_Object *stack_base;
# Line 817  main (argc, argv, envp) Line 825  main (argc, argv, envp)
825          }          }
826        else        else
827          {          {
828            printf ("GNU Emacs %s\n", XSTRING (tem)->data);            printf ("GNU Emacs %s\n", SDATA (tem));
829            printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");            printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
830            printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");            printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
831            printf ("You may redistribute copies of Emacs\n");            printf ("You may redistribute copies of Emacs\n");
# Line 1033  main (argc, argv, envp) Line 1041  main (argc, argv, envp)
1041    noninteractive = 0;    noninteractive = 0;
1042    if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args))    if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args))
1043      noninteractive = 1;      noninteractive = 1;
1044      if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args))
1045        {
1046          noninteractive = 1;       /* Set batch mode.  */
1047          /* Convert --script to -l, un-skip it, and sort again so that -l will be
1048             handled in proper sequence.  */
1049          argv[skip_args - 1] = "-l";
1050          skip_args -= 2;
1051          sort_args (argc, argv);
1052        }
1053    
1054    /* Handle the --help option, which gives a usage message.  */    /* Handle the --help option, which gives a usage message.  */
1055    if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args))    if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args))
# Line 1358  main (argc, argv, envp) Line 1375  main (argc, argv, envp)
1375  #endif /* MSDOS */  #endif /* MSDOS */
1376    
1377  #ifdef WINDOWSNT  #ifdef WINDOWSNT
1378      globals_of_w32 ();
1379    /* Initialize environment from registry settings.  */    /* Initialize environment from registry settings.  */
1380    init_environment (argv);    init_environment (argv);
1381    init_ntproc ();       /* must precede init_editfns.  */    init_ntproc ();       /* must precede init_editfns.  */
1382  #endif  #endif
1383    
1384    #ifdef HAVE_CARBON
1385      if (initialized)
1386        init_mac_osx_environment ();
1387    #endif
1388    
1389    /* egetenv is a pretty low-level facility, which may get called in    /* egetenv is a pretty low-level facility, which may get called in
1390       many circumstances; it seems flimsy to put off initializing it       many circumstances; it seems flimsy to put off initializing it
1391       until calling init_callproc.  */       until calling init_callproc.  */
# Line 1519  main (argc, argv, envp) Line 1542  main (argc, argv, envp)
1542        keys_of_minibuf ();        keys_of_minibuf ();
1543        keys_of_window ();        keys_of_window ();
1544      }      }
1545            else
1546        {
1547          /*
1548            Initialization that must be done even if the global variable
1549            initialized is non zero
1550          */
1551    #ifdef HAVE_NTGUI
1552          globals_of_w32fns ();
1553          globals_of_w32menu ();
1554    #endif  /* end #ifdef HAVE_NTGUI */
1555        }
1556    
1557    if (!noninteractive)    if (!noninteractive)
1558      {      {
# Line 1653  struct standard_args standard_args[] = Line 1687  struct standard_args standard_args[] =
1687    { "-nw", "--no-window-system", 110, 0 },    { "-nw", "--no-window-system", 110, 0 },
1688    { "-nw", "--no-windows", 110, 0 },    { "-nw", "--no-windows", 110, 0 },
1689    { "-batch", "--batch", 100, 0 },    { "-batch", "--batch", 100, 0 },
1690      { "-script", "--script", 100, 1 },
1691    { "-help", "--help", 90, 0 },    { "-help", "--help", 90, 0 },
1692    { "-no-unibyte", "--no-unibyte", 83, 0 },    { "-no-unibyte", "--no-unibyte", 83, 0 },
1693    { "-multibyte", "--multibyte", 82, 0 },    { "-multibyte", "--multibyte", 82, 0 },
# Line 1908  all of which are called before Emacs is Line 1943  all of which are called before Emacs is
1943       kill it because we are exiting Emacs deliberately (not crashing).       kill it because we are exiting Emacs deliberately (not crashing).
1944       Do it after shut_down_emacs, which does an auto-save.  */       Do it after shut_down_emacs, which does an auto-save.  */
1945    if (STRINGP (Vauto_save_list_file_name))    if (STRINGP (Vauto_save_list_file_name))
1946      unlink (XSTRING (Vauto_save_list_file_name)->data);      unlink (SDATA (Vauto_save_list_file_name));
1947    
1948    exit (INTEGERP (arg) ? XINT (arg)    exit (INTEGERP (arg) ? XINT (arg)
1949  #ifdef VMS  #ifdef VMS
# Line 1977  shut_down_emacs (sig, no_x, stuff) Line 2012  shut_down_emacs (sig, no_x, stuff)
2012  #ifdef HAVE_X_WINDOWS  #ifdef HAVE_X_WINDOWS
2013    /* It's not safe to call intern here.  Maybe we are crashing.  */    /* It's not safe to call intern here.  Maybe we are crashing.  */
2014    if (!noninteractive && SYMBOLP (Vwindow_system)    if (!noninteractive && SYMBOLP (Vwindow_system)
2015        && XSTRING (SYMBOL_NAME (Vwindow_system))->size == 1        && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1
2016        && XSTRING (SYMBOL_NAME (Vwindow_system))->data[0] == 'x'        && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x'
2017        && ! no_x)        && ! no_x)
2018      Fx_close_current_connection ();      Fx_close_current_connection ();
2019  #endif /* HAVE_X_WINDOWS */  #endif /* HAVE_X_WINDOWS */
# Line 2036  This function exists on systems that use Line 2071  This function exists on systems that use
2071  #ifndef SYSTEM_MALLOC  #ifndef SYSTEM_MALLOC
2072    memory_warnings (my_edata, malloc_warning);    memory_warnings (my_edata, malloc_warning);
2073  #endif  #endif
2074    map_out_data (XSTRING (filename)->data);    map_out_data (SDATA (filename));
2075    
2076    Vpurify_flag = tem;    Vpurify_flag = tem;
2077    
# Line 2057  You must run Emacs in batch mode in orde Line 2092  You must run Emacs in batch mode in orde
2092    extern char my_edata[];    extern char my_edata[];
2093    Lisp_Object tem;    Lisp_Object tem;
2094    Lisp_Object symbol;    Lisp_Object symbol;
2095    int count = BINDING_STACK_SIZE ();    int count = SPECPDL_INDEX ();
2096    
2097    check_pure_size ();    check_pure_size ();
2098    
# Line 2075  You must run Emacs in batch mode in orde Line 2110  You must run Emacs in batch mode in orde
2110    if (!NILP (symfile))    if (!NILP (symfile))
2111      {      {
2112        CHECK_STRING (symfile);        CHECK_STRING (symfile);
2113        if (XSTRING (symfile)->size)        if (SCHARS (symfile))
2114          symfile = Fexpand_file_name (symfile, Qnil);          symfile = Fexpand_file_name (symfile, Qnil);
2115      }      }
2116    
# Line 2092  You must run Emacs in batch mode in orde Line 2127  You must run Emacs in batch mode in orde
2127    
2128    fflush (stdout);    fflush (stdout);
2129  #ifdef VMS  #ifdef VMS
2130    mapout_data (XSTRING (filename)->data);    mapout_data (SDATA (filename));
2131  #else  #else
2132    /* Tell malloc where start of impure now is.  */    /* Tell malloc where start of impure now is.  */
2133    /* Also arrange for warnings when nearly out of space.  */    /* Also arrange for warnings when nearly out of space.  */
# Line 2110  You must run Emacs in batch mode in orde Line 2145  You must run Emacs in batch mode in orde
2145  #ifdef USE_MMAP_FOR_BUFFERS  #ifdef USE_MMAP_FOR_BUFFERS
2146    mmap_set_vars (0);    mmap_set_vars (0);
2147  #endif  #endif
2148    unexec (XSTRING (filename)->data,    unexec (SDATA (filename),
2149            !NILP (symfile) ? XSTRING (symfile)->data : 0, my_edata, 0, 0);            !NILP (symfile) ? SDATA (symfile) : 0, my_edata, 0, 0);
2150  #ifdef USE_MMAP_FOR_BUFFERS  #ifdef USE_MMAP_FOR_BUFFERS
2151    mmap_set_vars (1);    mmap_set_vars (1);
2152  #endif  #endif
# Line 2151  synchronize_locale (category, plocale, d Line 2186  synchronize_locale (category, plocale, d
2186      {      {
2187        *plocale = desired_locale;        *plocale = desired_locale;
2188        setlocale (category, (STRINGP (desired_locale)        setlocale (category, (STRINGP (desired_locale)
2189                              ? (char *)(XSTRING (desired_locale)->data)                              ? (char *)(SDATA (desired_locale))
2190                              : ""));                              : ""));
2191      }      }
2192  }  }
# Line 2221  decode_env_path (evarname, defalt) Line 2256  decode_env_path (evarname, defalt)
2256        /* Add /: to the front of the name        /* Add /: to the front of the name
2257           if it would otherwise be treated as magic.  */           if it would otherwise be treated as magic.  */
2258        tem = Ffind_file_name_handler (element, Qt);        tem = Ffind_file_name_handler (element, Qt);
2259    
2260          /* However, if the handler says "I'm safe",
2261             don't bother adding /:.  */
2262          if (SYMBOLP (tem))
2263            {
2264              Lisp_Object prop;
2265              prop = Fget (tem, intern ("safe-magic"));
2266              if (! NILP (prop))
2267                tem = Qnil;
2268            }
2269    
2270        if (! NILP (tem))        if (! NILP (tem))
2271          element = concat2 (build_string ("/:"), element);          element = concat2 (build_string ("/:"), element);
2272    
# Line 2253  syms_of_emacs () Line 2299  syms_of_emacs ()
2299    defsubr (&Sinvocation_directory);    defsubr (&Sinvocation_directory);
2300    
2301    DEFVAR_LISP ("command-line-args", &Vcommand_line_args,    DEFVAR_LISP ("command-line-args", &Vcommand_line_args,
2302                 doc: /* Args passed by shell to Emacs, as a list of strings.  */);                 doc: /* Args passed by shell to Emacs, as a list of strings.
2303    Many arguments are deleted from the list as they are processed.  */);
2304    
2305    DEFVAR_LISP ("system-type", &Vsystem_type,    DEFVAR_LISP ("system-type", &Vsystem_type,
2306                 doc: /* Value is symbol indicating type of operating system you are using.  */);                 doc: /* Value is symbol indicating type of operating system you are using.  */);
# Line 2273  Emacs is running.  */); Line 2320  Emacs is running.  */);
2320                 doc: /* Non-nil means Emacs is running without interactive terminal.  */);                 doc: /* Non-nil means Emacs is running without interactive terminal.  */);
2321    
2322    DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook,    DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook,
2323                 doc: /* Hook to be run whenever kill-emacs is called.                 doc: /* Hook to be run when kill-emacs is called.
2324  Since kill-emacs may be invoked when the terminal is disconnected (or  Since `kill-emacs' may be invoked when the terminal is disconnected (or
2325  in other similar situations), functions placed on this hook should not  in other similar situations), functions placed on this hook should not
2326  expect to be able to interact with the user.  To ask for confirmation,  expect to be able to interact with the user.  To ask for confirmation,
2327  see `kill-emacs-query-functions' instead.  */);  see `kill-emacs-query-functions' instead.
2328    
2329    The hook is not run in batch mode, i.e., if `noninteractive' is non-nil.  */);
2330    Vkill_emacs_hook = Qnil;    Vkill_emacs_hook = Qnil;
2331    
2332    empty_string = build_string ("");    empty_string = build_string ("");

Legend:
Removed from v.1.309  
changed lines
  Added in v.1.309.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26