comparison src/emacs.c @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 1ccc32a20af4
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
383 383
384 /* Nonzero means print debug information about path searching */ 384 /* Nonzero means print debug information about path searching */
385 int debug_paths; 385 int debug_paths;
386 386
387 /* Save argv and argc. */ 387 /* Save argv and argc. */
388 static Extbyte **initial_argv; 388 static Extbyte **initial_argv; /* #### currently unused */
389 static int initial_argc; 389 static int initial_argc; /* #### currently unused */
390 390
391 static void sort_args (int argc, char **argv); 391 static void sort_args (int argc, char **argv);
392 392
393 Lisp_Object Qkill_emacs_hook; 393 Lisp_Object Qkill_emacs_hook;
394 Lisp_Object Qsave_buffers_kill_emacs; 394 Lisp_Object Qsave_buffers_kill_emacs;
1676 1676
1677 vars_of_events (); 1677 vars_of_events ();
1678 vars_of_extents (); 1678 vars_of_extents ();
1679 vars_of_faces (); 1679 vars_of_faces ();
1680 vars_of_fileio (); 1680 vars_of_fileio ();
1681 #ifdef CLASH_DETECTION
1682 vars_of_filelock ();
1683 #endif
1681 vars_of_floatfns (); 1684 vars_of_floatfns ();
1682 vars_of_font_lock (); 1685 vars_of_font_lock ();
1683 vars_of_frame (); 1686 vars_of_frame ();
1684 vars_of_glyphs (); 1687 vars_of_glyphs ();
1685 vars_of_glyphs_eimage (); 1688 vars_of_glyphs_eimage ();
2910 2913
2911 Remember to set `command-line-processed' to nil before dumping 2914 Remember to set `command-line-processed' to nil before dumping
2912 if you want the dumped XEmacs to process its command line 2915 if you want the dumped XEmacs to process its command line
2913 and announce itself normally when it is run. 2916 and announce itself normally when it is run.
2914 */ 2917 */
2915 (intoname, symname)) 2918 (filename, symfile))
2916 { 2919 {
2917 /* This function can GC */ 2920 /* This function can GC */
2918 struct gcpro gcpro1, gcpro2; 2921 struct gcpro gcpro1, gcpro2;
2919 int opurify; 2922 int opurify;
2920 2923
2921 GCPRO2 (intoname, symname); 2924 GCPRO2 (filename, symfile);
2922 2925
2923 #ifdef FREE_CHECKING 2926 #ifdef FREE_CHECKING
2924 Freally_free (Qnil); 2927 Freally_free (Qnil);
2925 2928
2926 /* When we're dumping, we can't use the debugging free() */ 2929 /* When we're dumping, we can't use the debugging free() */
2927 disable_free_hook (); 2930 disable_free_hook ();
2928 #endif 2931 #endif
2929 2932
2930 CHECK_STRING (intoname); 2933 CHECK_STRING (filename);
2931 intoname = Fexpand_file_name (intoname, Qnil); 2934 filename = Fexpand_file_name (filename, Qnil);
2932 if (!NILP (symname)) 2935 if (!NILP (symfile))
2933 { 2936 {
2934 CHECK_STRING (symname); 2937 CHECK_STRING (symfile);
2935 if (XSTRING_LENGTH (symname) > 0) 2938 if (XSTRING_LENGTH (symfile) > 0)
2936 symname = Fexpand_file_name (symname, Qnil); 2939 symfile = Fexpand_file_name (symfile, Qnil);
2937 else 2940 else
2938 symname = Qnil; 2941 symfile = Qnil;
2939 } 2942 }
2940 2943
2941 opurify = purify_flag; 2944 opurify = purify_flag;
2942 purify_flag = 0; 2945 purify_flag = 0;
2943 2946
2960 #endif 2963 #endif
2961 2964
2962 UNGCPRO; 2965 UNGCPRO;
2963 2966
2964 { 2967 {
2965 char *intoname_ext; 2968 char *filename_ext;
2966 char *symname_ext; 2969 char *symfile_ext;
2967 2970
2968 LISP_STRING_TO_EXTERNAL (intoname, intoname_ext, Qfile_name); 2971 LISP_STRING_TO_EXTERNAL (filename, filename_ext, Qfile_name);
2969 2972
2970 if (STRINGP (symname)) 2973 if (STRINGP (symfile))
2971 LISP_STRING_TO_EXTERNAL (symname, symname_ext, Qfile_name); 2974 LISP_STRING_TO_EXTERNAL (symfile, symfile_ext, Qfile_name);
2972 else 2975 else
2973 symname_ext = 0; 2976 symfile_ext = 0;
2974 2977
2975 garbage_collect_1 (); 2978 garbage_collect_1 ();
2976 2979
2977 #ifdef PDUMP 2980 #ifdef PDUMP
2978 pdump (); 2981 pdump ();
2985 be performed at the actual time that the system call is made. 2988 be performed at the actual time that the system call is made.
2986 It's a whole lot easier to do the conversion here than to 2989 It's a whole lot easier to do the conversion here than to
2987 modify all the unexec routines to ensure that filename 2990 modify all the unexec routines to ensure that filename
2988 conversion is applied everywhere. Don't worry about memory 2991 conversion is applied everywhere. Don't worry about memory
2989 leakage because this call only happens once. */ 2992 leakage because this call only happens once. */
2990 unexec (intoname_ext, symname_ext, (uintptr_t) my_edata, 0, 0); 2993 unexec (filename_ext, symfile_ext, (uintptr_t) my_edata, 0, 0);
2991 #ifdef DOUG_LEA_MALLOC 2994 #ifdef DOUG_LEA_MALLOC
2992 free (malloc_state_ptr); 2995 free (malloc_state_ptr);
2993 #endif 2996 #endif
2994 #endif /* not PDUMP */ 2997 #endif /* not PDUMP */
2995 } 2998 }
3519 */ ); 3522 */ );
3520 Vemacs_program_name = build_string ((char *) PATH_PROGNAME); 3523 Vemacs_program_name = build_string ((char *) PATH_PROGNAME);
3521 3524
3522 DEFVAR_LISP ("emacs-program-version", &Vemacs_program_version /* 3525 DEFVAR_LISP ("emacs-program-version", &Vemacs_program_version /*
3523 *Version of the Emacs variant. 3526 *Version of the Emacs variant.
3524 This typically has the form XX.XX[-bXX]. 3527 This typically has the form NN.NN-bNN.
3525 This is mainly meant for use in path searching. 3528 This is mainly meant for use in path searching.
3526 */ ); 3529 */ );
3527 Vemacs_program_version = build_string ((char *) PATH_VERSION); 3530 Vemacs_program_version = build_string ((char *) PATH_VERSION);
3528 3531
3529 DEFVAR_LISP ("exec-path", &Vexec_path /* 3532 DEFVAR_LISP ("exec-path", &Vexec_path /*
3538 */ ); 3541 */ );
3539 Vexec_directory = Qnil; 3542 Vexec_directory = Qnil;
3540 3543
3541 DEFVAR_LISP ("configure-exec-directory", &Vconfigure_exec_directory /* 3544 DEFVAR_LISP ("configure-exec-directory", &Vconfigure_exec_directory /*
3542 For internal use by the build procedure only. 3545 For internal use by the build procedure only.
3543 configure's idea of what EXEC-DIRECTORY will be. 3546 configure's idea of what `exec-directory' will be.
3544 */ ); 3547 */ );
3545 #ifdef PATH_EXEC 3548 #ifdef PATH_EXEC
3546 Vconfigure_exec_directory = Ffile_name_as_directory 3549 Vconfigure_exec_directory = Ffile_name_as_directory
3547 (build_string ((char *) PATH_EXEC)); 3550 (build_string ((char *) PATH_EXEC));
3548 #else 3551 #else
3554 */ ); 3557 */ );
3555 Vlisp_directory = Qnil; 3558 Vlisp_directory = Qnil;
3556 3559
3557 DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /* 3560 DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /*
3558 For internal use by the build procedure only. 3561 For internal use by the build procedure only.
3559 configure's idea of what LISP-DIRECTORY will be. 3562 configure's idea of what `lisp-directory' will be.
3560 */ ); 3563 */ );
3561 #ifdef PATH_LOADSEARCH 3564 #ifdef PATH_LOADSEARCH
3562 Vconfigure_lisp_directory = Ffile_name_as_directory 3565 Vconfigure_lisp_directory = Ffile_name_as_directory
3563 (build_string ((char *) PATH_LOADSEARCH)); 3566 (build_string ((char *) PATH_LOADSEARCH));
3564 #else 3567 #else
3570 */ ); 3573 */ );
3571 Vmodule_directory = Qnil; 3574 Vmodule_directory = Qnil;
3572 3575
3573 DEFVAR_LISP ("configure-module-directory", &Vconfigure_module_directory /* 3576 DEFVAR_LISP ("configure-module-directory", &Vconfigure_module_directory /*
3574 For internal use by the build procedure only. 3577 For internal use by the build procedure only.
3575 configure's idea of what MODULE-DIRECTORY will be. 3578 configure's idea of what `module-directory' will be.
3576 */ ); 3579 */ );
3577 #ifdef PATH_MODULESEARCH 3580 #ifdef PATH_MODULESEARCH
3578 Vconfigure_module_directory = Ffile_name_as_directory 3581 Vconfigure_module_directory = Ffile_name_as_directory
3579 (build_string ((char *) PATH_MODULESEARCH)); 3582 (build_string ((char *) PATH_MODULESEARCH));
3580 #else 3583 #else
3600 */ ); 3603 */ );
3601 Vdata_directory = Qnil; 3604 Vdata_directory = Qnil;
3602 3605
3603 DEFVAR_LISP ("configure-data-directory", &Vconfigure_data_directory /* 3606 DEFVAR_LISP ("configure-data-directory", &Vconfigure_data_directory /*
3604 For internal use by the build procedure only. 3607 For internal use by the build procedure only.
3605 configure's idea of what DATA-DIRECTORY will be. 3608 configure's idea of what `data-directory' will be.
3606 */ ); 3609 */ );
3607 #ifdef PATH_DATA 3610 #ifdef PATH_DATA
3608 Vconfigure_data_directory = Ffile_name_as_directory 3611 Vconfigure_data_directory = Ffile_name_as_directory
3609 (build_string ((char *) PATH_DATA)); 3612 (build_string ((char *) PATH_DATA));
3610 #else 3613 #else
3622 */ ); 3625 */ );
3623 Vsite_directory = Qnil; 3626 Vsite_directory = Qnil;
3624 3627
3625 DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /* 3628 DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /*
3626 For internal use by the build procedure only. 3629 For internal use by the build procedure only.
3627 configure's idea of what SITE-DIRECTORY will be. 3630 configure's idea of what `site-directory' will be.
3628 */ ); 3631 */ );
3629 #ifdef PATH_SITE 3632 #ifdef PATH_SITE
3630 Vconfigure_site_directory = Ffile_name_as_directory 3633 Vconfigure_site_directory = Ffile_name_as_directory
3631 (build_string ((char *) PATH_SITE)); 3634 (build_string ((char *) PATH_SITE));
3632 #else 3635 #else
3638 */ ); 3641 */ );
3639 Vsite_module_directory = Qnil; 3642 Vsite_module_directory = Qnil;
3640 3643
3641 DEFVAR_LISP ("configure-site-module-directory", &Vconfigure_site_module_directory /* 3644 DEFVAR_LISP ("configure-site-module-directory", &Vconfigure_site_module_directory /*
3642 For internal use by the build procedure only. 3645 For internal use by the build procedure only.
3643 configure's idea of what SITE-DIRECTORY will be. 3646 configure's idea of what `site-directory' will be.
3644 */ ); 3647 */ );
3645 #ifdef PATH_SITE_MODULES 3648 #ifdef PATH_SITE_MODULES
3646 Vconfigure_site_module_directory = Ffile_name_as_directory 3649 Vconfigure_site_module_directory = Ffile_name_as_directory
3647 (build_string ((char *) PATH_SITE_MODULES)); 3650 (build_string ((char *) PATH_SITE_MODULES));
3648 #else 3651 #else
3649 Vconfigure_site_module_directory = Qnil; 3652 Vconfigure_site_module_directory = Qnil;
3650 #endif 3653 #endif
3651 3654
3652 DEFVAR_LISP ("doc-directory", &Vdoc_directory /* 3655 DEFVAR_LISP ("doc-directory", &Vdoc_directory /*
3653 *Directory containing the DOC file that comes with XEmacs. 3656 *Directory containing the DOC file that comes with XEmacs.
3654 This is usually the same as exec-directory. 3657 This is usually the same as `exec-directory'.
3655 */ ); 3658 */ );
3656 Vdoc_directory = Qnil; 3659 Vdoc_directory = Qnil;
3657 3660
3658 DEFVAR_LISP ("configure-doc-directory", &Vconfigure_doc_directory /* 3661 DEFVAR_LISP ("configure-doc-directory", &Vconfigure_doc_directory /*
3659 For internal use by the build procedure only. 3662 For internal use by the build procedure only.
3660 configure's idea of what DOC-DIRECTORY will be. 3663 configure's idea of what `doc-directory' will be.
3661 */ ); 3664 */ );
3662 #ifdef PATH_DOC 3665 #ifdef PATH_DOC
3663 Vconfigure_doc_directory = Ffile_name_as_directory 3666 Vconfigure_doc_directory = Ffile_name_as_directory
3664 (build_string ((char *) PATH_DOC)); 3667 (build_string ((char *) PATH_DOC));
3665 #else 3668 #else
3666 Vconfigure_doc_directory = Qnil; 3669 Vconfigure_doc_directory = Qnil;
3667 #endif 3670 #endif
3668 3671
3669 DEFVAR_LISP ("configure-exec-prefix-directory", &Vconfigure_exec_prefix_directory /* 3672 DEFVAR_LISP ("configure-exec-prefix-directory", &Vconfigure_exec_prefix_directory /*
3670 For internal use by the build procedure only. 3673 For internal use by the build procedure only.
3671 configure's idea of what EXEC-PREFIX-DIRECTORY will be. 3674 configure's idea of what `exec-prefix-directory' will be.
3672 */ ); 3675 */ );
3673 #ifdef PATH_EXEC_PREFIX 3676 #ifdef PATH_EXEC_PREFIX
3674 Vconfigure_exec_prefix_directory = Ffile_name_as_directory 3677 Vconfigure_exec_prefix_directory = Ffile_name_as_directory
3675 (build_string ((char *) PATH_EXEC_PREFIX)); 3678 (build_string ((char *) PATH_EXEC_PREFIX));
3676 #else 3679 #else
3677 Vconfigure_exec_prefix_directory = Qnil; 3680 Vconfigure_exec_prefix_directory = Qnil;
3678 #endif 3681 #endif
3679 3682
3680 DEFVAR_LISP ("configure-prefix-directory", &Vconfigure_prefix_directory /* 3683 DEFVAR_LISP ("configure-prefix-directory", &Vconfigure_prefix_directory /*
3681 For internal use by the build procedure only. 3684 For internal use by the build procedure only.
3682 configure's idea of what PREFIX-DIRECTORY will be. 3685 configure's idea of what `prefix-directory' will be.
3683 */ ); 3686 */ );
3684 #ifdef PATH_PREFIX 3687 #ifdef PATH_PREFIX
3685 Vconfigure_prefix_directory = Ffile_name_as_directory 3688 Vconfigure_prefix_directory = Ffile_name_as_directory
3686 (build_string ((char *) PATH_PREFIX)); 3689 (build_string ((char *) PATH_PREFIX));
3687 #else 3690 #else