comparison src/emacs.c @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 90d73dddcdc4
comparison
equal deleted inserted replaced
275:a68ae4439f57 276:6330739388db
124 /* The directory name in which to find subdirs such as lisp and etc. 124 /* The directory name in which to find subdirs such as lisp and etc.
125 nil means get them only from PATH_LOADSEARCH. */ 125 nil means get them only from PATH_LOADSEARCH. */
126 Lisp_Object Vinstallation_directory; 126 Lisp_Object Vinstallation_directory;
127 #endif 127 #endif
128 128
129 Lisp_Object Vexec_path, Vconfigure_exec_path; 129 Lisp_Object Vexec_path;
130 Lisp_Object Vexec_directory; 130 Lisp_Object Vexec_directory, Vconfigure_exec_directory;
131 Lisp_Object Vconfigure_lisp_directory; 131 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory;
132 Lisp_Object Vconfigure_package_path; 132 Lisp_Object Vconfigure_package_path;
133 Lisp_Object Vdata_directory, Vconfigure_data_directory; 133 Lisp_Object Vdata_directory, Vconfigure_data_directory;
134 Lisp_Object Vdoc_directory, Vconfigure_doc_directory; 134 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
135 Lisp_Object Vconfigure_lock_directory; 135 Lisp_Object Vconfigure_lock_directory;
136 Lisp_Object Vdata_directory_list; 136 Lisp_Object Vdata_directory_list;
137 Lisp_Object Vinfo_directory, Vconfigure_info_directory; 137 Lisp_Object Vinfo_directory, Vconfigure_info_directory;
138 Lisp_Object Vsite_directory, Vconfigure_site_directory; 138 Lisp_Object Vsite_directory, Vconfigure_site_directory;
139 Lisp_Object Vconfigure_info_path; 139 Lisp_Object Vconfigure_info_path;
140 Lisp_Object Vinternal_error_checking;
140 141
141 /* The default base directory XEmacs is installed under. */ 142 /* The default base directory XEmacs is installed under. */
142 Lisp_Object Vconfigure_prefix_directory; 143 Lisp_Object Vconfigure_prefix_directory;
143 144
144 /* If nonzero, set XEmacs to run at this priority. This is also used 145 /* If nonzero, set XEmacs to run at this priority. This is also used
187 int noninteractive1; 188 int noninteractive1;
188 189
189 /* Nonzero means don't perform site-lisp searches at startup */ 190 /* Nonzero means don't perform site-lisp searches at startup */
190 int inhibit_site_lisp; 191 int inhibit_site_lisp;
191 192
192 /* Nonzero means don't perform package searches at startup */ 193 /* Nonzero means don't respect early packages at startup */
193 int inhibit_package_init; 194 int inhibit_early_packages;
194 195
195 /* Nonzero means don't reload changed dumped lisp files at startup */ 196 /* Nonzero means don't load package autoloads at startup */
196 int inhibit_update_dumped_lisp; 197 int inhibit_autoloads;
197 198
198 /* Nonzero means don't reload changed or new auto-autoloads files at startup */ 199 /* Nonzero means print debug information about path searching */
199 int inhibit_update_autoloads; 200 int debug_paths;
200 201
201 /* Save argv and argc. */ 202 /* Save argv and argc. */
202 char **initial_argv; 203 char **initial_argv;
203 int initial_argc; 204 int initial_argc;
204 205
669 670
670 /* Handle the -batch switch, which means don't do interactive display. */ 671 /* Handle the -batch switch, which means don't do interactive display. */
671 if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) 672 if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args))
672 { 673 {
673 #if 0 /* I don't think this is correct. */ 674 #if 0 /* I don't think this is correct. */
674 inhibit_update_autoloads = 1; 675 inhibit_autoloads = 1;
675 inhibit_update_dumped_lisp = 1;
676 #endif 676 #endif
677 noninteractive = 1; 677 noninteractive = 1;
678 } 678 }
679 679
680 /* Partially handle -no-autoloads, -no-packages and -vanilla. Packages */ 680 if (argmatch (argv, argc, "-debug-paths", "--debug-paths",
681 11, NULL, &skip_args))
682 debug_paths = 1;
683
684 /* Partially handle -no-autoloads, -no-early-packages and -vanilla. Packages */
681 /* are searched prior to the rest of the command line being parsed in */ 685 /* are searched prior to the rest of the command line being parsed in */
682 /* startup.el */ 686 /* startup.el */
683 if (argmatch (argv, argc, "-no-packages", "--no-packages", 687 if (argmatch (argv, argc, "-no-early-packages", "--no-early-packages",
684 6, NULL, &skip_args)) 688 6, NULL, &skip_args))
685 { 689 {
686 inhibit_package_init = 1; 690 inhibit_early_packages = 1;
687 skip_args--; 691 skip_args--;
688 } 692 }
689 if (argmatch (argv, argc, "-vanilla", "--vanilla", 693 if (argmatch (argv, argc, "-vanilla", "--vanilla",
690 7, NULL, &skip_args)) 694 7, NULL, &skip_args))
691 { 695 {
692 inhibit_package_init = 1; 696 inhibit_early_packages = 1;
693 skip_args--; 697 skip_args--;
694 } 698 }
695 699
696 if (argmatch (argv, argc, "-no-autoloads", "--no-autoloads", 700 if (argmatch (argv, argc, "-no-autoloads", "--no-autoloads",
697 7, NULL, &skip_args)) 701 7, NULL, &skip_args))
698 { 702 {
699 /* Inhibit everything */ 703 /* Inhibit everything */
700 inhibit_package_init = 1; 704 inhibit_autoloads = 1;
701 inhibit_update_autoloads = 1; 705 skip_args--;
702 inhibit_update_dumped_lisp = 1; 706 }
707
708 if (argmatch (argv, argc, "-debug-paths", "--debug-paths",
709 6, NULL, &skip_args))
710 {
711 debug_paths = 1;
703 skip_args--; 712 skip_args--;
704 } 713 }
705 714
706 715
707 /* Partially handle the -version and -help switches: they imply -batch, 716 /* Partially handle the -version and -help switches: they imply -batch,
965 syms_of_select_mswindows (); 974 syms_of_select_mswindows ();
966 syms_of_glyphs_mswindows (); 975 syms_of_glyphs_mswindows ();
967 #ifdef HAVE_MENUBARS 976 #ifdef HAVE_MENUBARS
968 syms_of_menubar_mswindows (); 977 syms_of_menubar_mswindows ();
969 #endif 978 #endif
979 #ifdef HAVE_SCROLLBARS
980 syms_of_scrollbar_mswindows ();
981 #endif
970 #ifdef HAVE_MSW_C_DIRED 982 #ifdef HAVE_MSW_C_DIRED
971 syms_of_dired_mswindows (); 983 syms_of_dired_mswindows ();
972 #endif 984 #endif
973 #endif /* HAVE_MS_WINDOWS */ 985 #endif /* HAVE_MS_WINDOWS */
974 986
1078 console_type_create_scrollbar_mswindows (); 1090 console_type_create_scrollbar_mswindows ();
1079 # endif 1091 # endif
1080 #ifdef HAVE_MENUBARS 1092 #ifdef HAVE_MENUBARS
1081 console_type_create_menubar_mswindows (); 1093 console_type_create_menubar_mswindows ();
1082 #endif 1094 #endif
1095 #ifdef HAVE_TOOLBARS
1096 console_type_create_toolbar_mswindows ();
1097 #endif
1083 #endif 1098 #endif
1084 1099
1085 /* Now initialize the specifier types and associated symbols. 1100 /* Now initialize the specifier types and associated symbols.
1086 Other than the first function below, the functions may 1101 Other than the first function below, the functions may
1087 make exactly the following function/macro calls: 1102 make exactly the following function/macro calls:
1145 1160
1146 lstream_type_create (); 1161 lstream_type_create ();
1147 #ifdef FILE_CODING 1162 #ifdef FILE_CODING
1148 lstream_type_create_mule_coding (); 1163 lstream_type_create_mule_coding ();
1149 #endif 1164 #endif
1150 lstream_type_create_print ();
1151 #ifdef HAVE_MS_WINDOWS 1165 #ifdef HAVE_MS_WINDOWS
1152 lstream_type_create_mswindows_selectable (); 1166 lstream_type_create_mswindows_selectable ();
1153 #endif 1167 #endif
1154 1168
1155 /* Initialize processes implementation. 1169 /* Initialize processes implementation.
1670 /* Handled by main_1 above: */ 1684 /* Handled by main_1 above: */
1671 { "-nl", "--no-shared-memory", 100, 0 }, 1685 { "-nl", "--no-shared-memory", 100, 0 },
1672 { "-t", "--terminal", 95, 1 }, 1686 { "-t", "--terminal", 95, 1 },
1673 { "-nw", "--no-windows", 90, 0 }, 1687 { "-nw", "--no-windows", 90, 0 },
1674 { "-batch", "--batch", 85, 0 }, 1688 { "-batch", "--batch", 85, 0 },
1689 { "-debug-paths", "--debug-paths", 82, 0 },
1675 { "-help", "--help", 80, 0 }, 1690 { "-help", "--help", 80, 0 },
1676 { "-version", "--version", 75, 0 }, 1691 { "-version", "--version", 75, 0 },
1677 { "-V", 0, 75, 0 }, 1692 { "-V", 0, 75, 0 },
1678 { "-d", "--display", 80, 1 }, 1693 { "-d", "--display", 80, 1 },
1679 { "-display", 0, 80, 1 }, 1694 { "-display", 0, 80, 1 },
1685 { "-unmapped", 0, 50, 0 }, 1700 { "-unmapped", 0, 50, 0 },
1686 { "-no-init-file", 0, 50, 0 }, 1701 { "-no-init-file", 0, 50, 0 },
1687 { "-vanilla", "--vanilla", 50, 0 }, 1702 { "-vanilla", "--vanilla", 50, 0 },
1688 { "-no-autoloads", "--no-autoloads", 50, 0 }, 1703 { "-no-autoloads", "--no-autoloads", 50, 0 },
1689 { "-no-site-file", "--no-site-file", 40, 0 }, 1704 { "-no-site-file", "--no-site-file", 40, 0 },
1690 { "-no-packages", "--no-packages", 35, 0 }, 1705 { "-no-early-packages", "--no-early-packages", 35, 0 },
1691 { "-u", "--user", 30, 1 }, 1706 { "-u", "--user", 30, 1 },
1692 { "-user", 0, 30, 1 }, 1707 { "-user", 0, 30, 1 },
1693 { "-debug-init", "--debug-init", 20, 0 }, 1708 { "-debug-init", "--debug-init", 20, 0 },
1709 { "-debug-paths", "--debug-paths", 20, 0 },
1694 1710
1695 /* Xt options: */ 1711 /* Xt options: */
1696 { "-i", "--icon-type", 15, 0 }, 1712 { "-i", "--icon-type", 15, 0 },
1697 { "-itype", 0, 15, 0 }, 1713 { "-itype", 0, 15, 0 },
1698 { "-iconic", "--iconic", 15, 0 }, 1714 { "-iconic", "--iconic", 15, 0 },
2448 2464
2449 while (1) 2465 while (1)
2450 { 2466 {
2451 p = strchr (path, SEPCHAR); 2467 p = strchr (path, SEPCHAR);
2452 if (!p) p = path + strlen (path); 2468 if (!p) p = path + strlen (path);
2453 lpath = Fcons (Ffile_name_as_directory(make_string ((CONST Bufbyte *) path, 2469 lpath = Fcons (make_string ((CONST Bufbyte *) path, p - path),
2454 p - path)),
2455 lpath); 2470 lpath);
2456 if (*p) 2471 if (*p)
2457 path = p + 1; 2472 path = p + 1;
2458 else 2473 else
2459 break; 2474 break;
2663 2678
2664 DEFVAR_BOOL ("noninteractive", &noninteractive1 /* 2679 DEFVAR_BOOL ("noninteractive", &noninteractive1 /*
2665 Non-nil means XEmacs is running without interactive terminal. 2680 Non-nil means XEmacs is running without interactive terminal.
2666 */ ); 2681 */ );
2667 2682
2668 DEFVAR_BOOL ("inhibit-package-init", &inhibit_package_init /* 2683 DEFVAR_BOOL ("inhibit-early-packages", &inhibit_early_packages /*
2669 Set to non-nil when the package-path should not be searched at startup. 2684 Set to non-nil when the early packages should not be respected at startup.
2685 */ );
2686
2687 DEFVAR_BOOL ("inhibit-autoloads", &inhibit_autoloads /*
2688 Set to non-nil when autoloads should not be loaded at startup.
2689 */ );
2690
2691 DEFVAR_BOOL ("debug-paths", &debug_paths /*
2692 Set to non-nil when debug information about paths should be printed.
2670 */ ); 2693 */ );
2671 2694
2672 DEFVAR_BOOL ("inhibit-site-lisp", &inhibit_site_lisp /* 2695 DEFVAR_BOOL ("inhibit-site-lisp", &inhibit_site_lisp /*
2673 Set to non-nil when the site-lisp should not be searched at startup. 2696 Set to non-nil when the site-lisp should not be searched at startup.
2674 */ ); 2697 */ );
2675 #ifdef INHIBIT_SITE_LISP 2698 #ifdef INHIBIT_SITE_LISP
2676 inhibit_site_lisp = 1; 2699 inhibit_site_lisp = 1;
2677 #endif 2700 #endif
2678
2679 DEFVAR_BOOL ("inhibit-update-dumped-lisp", &inhibit_update_dumped_lisp /*
2680 Set to non-nil when modified dumped lisp should not be reloaded at startup.
2681 */ );
2682 inhibit_update_dumped_lisp = 1;
2683
2684 DEFVAR_BOOL ("inhibit-update-autoloads", &inhibit_update_autoloads /*
2685 Set to non-nil when modified or new autoloads files should not be reloaded.
2686 */ );
2687 inhibit_update_autoloads = 0;
2688 2701
2689 DEFVAR_INT ("emacs-priority", &emacs_priority /* 2702 DEFVAR_INT ("emacs-priority", &emacs_priority /*
2690 Priority for XEmacs to run at. 2703 Priority for XEmacs to run at.
2691 This value is effective only if set before XEmacs is dumped, 2704 This value is effective only if set before XEmacs is dumped,
2692 and only if the XEmacs executable is installed with setuid to permit 2705 and only if the XEmacs executable is installed with setuid to permit
2694 Currently, you need to define SET_EMACS_PRIORITY in `config.h' 2707 Currently, you need to define SET_EMACS_PRIORITY in `config.h'
2695 before you compile XEmacs, to enable the code for this feature. 2708 before you compile XEmacs, to enable the code for this feature.
2696 */ ); 2709 */ );
2697 emacs_priority = 0; 2710 emacs_priority = 0;
2698 2711
2712 DEFVAR_CONST_LISP ("internal-error-checking", &Vinternal_error_checking /*
2713 Internal error checking built-in into this instance of XEmacs.
2714 This is a list of symbols, initialized at build-time. Legal symbols
2715 are:
2716
2717 extents - check extents prior to each extent change;
2718 typecheck - check types strictly, aborting in case of error;
2719 malloc - check operation of malloc;
2720 gc - check garbage collection;
2721 bufpos - check buffer positions.
2722 */ );
2723 Vinternal_error_checking = Qnil;
2724 #ifdef ERROR_CHECK_EXTENTS
2725 Vinternal_error_checking = Fcons (intern ("extents"),
2726 Vinternal_error_checking);
2727 #endif
2728 #ifdef ERROR_CHECK_TYPECHECK
2729 Vinternal_error_checking = Fcons (intern ("typecheck"),
2730 Vinternal_error_checking);
2731 #endif
2732 #ifdef ERROR_CHECK_MALLOC
2733 Vinternal_error_checking = Fcons (intern ("malloc"),
2734 Vinternal_error_checking);
2735 #endif
2736 #ifdef ERROR_CHECK_GC
2737 Vinternal_error_checking = Fcons (intern ("gc"),
2738 Vinternal_error_checking);
2739 #endif
2740 #ifdef ERROR_CHECK_BUFPOS
2741 Vinternal_error_checking = Fcons (intern ("bufpos"),
2742 Vinternal_error_checking);
2743 #endif
2744 Vinternal_error_checking = Fpurecopy (Vinternal_error_checking);
2699 } 2745 }
2700 2746
2701 void 2747 void
2702 complex_vars_of_emacs (void) 2748 complex_vars_of_emacs (void)
2703 { 2749 {
2705 *List of directories to search programs to run in subprocesses. 2751 *List of directories to search programs to run in subprocesses.
2706 Each element is a string (directory name) or nil (try default directory). 2752 Each element is a string (directory name) or nil (try default directory).
2707 */ ); 2753 */ );
2708 Vexec_path = Qnil; 2754 Vexec_path = Qnil;
2709 2755
2710 DEFVAR_LISP ("configure-exec-path", &Vconfigure_exec_path /*
2711 For internal use by the build procedure only.
2712 configure's idea of what EXEC-PATH will be.
2713 */ );
2714 #ifdef PATH_EXEC
2715 Vconfigure_exec_path = decode_path (PATH_EXEC);
2716 #else
2717 Vconfigure_exec_path = Qnil;
2718 #endif
2719
2720 DEFVAR_LISP ("exec-directory", &Vexec_directory /* 2756 DEFVAR_LISP ("exec-directory", &Vexec_directory /*
2721 *Directory of architecture-dependent files that come with XEmacs, 2757 *Directory of architecture-dependent files that come with XEmacs,
2722 especially executable programs intended for XEmacs to invoke. 2758 especially executable programs intended for XEmacs to invoke.
2723 */ ); 2759 */ );
2724 Vexec_directory = Qnil; 2760 Vexec_directory = Qnil;
2725 2761
2762 DEFVAR_LISP ("configure-exec-directory", &Vconfigure_exec_directory /*
2763 For internal use by the build procedure only.
2764 configure's idea of what EXEC-DIRECTORY will be.
2765 */ );
2766 #ifdef PATH_EXEC
2767 Vconfigure_exec_directory = Ffile_name_as_directory
2768 (build_string ((char *) PATH_EXEC));
2769 #else
2770 Vconfigure_exec_directory = Qnil;
2771 #endif
2772
2773 DEFVAR_LISP ("lisp-directory", &Vlisp_directory /*
2774 *Directory of core Lisp files that come with XEmacs.
2775 */ );
2776 Vlisp_directory = Qnil;
2777
2726 DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /* 2778 DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /*
2727 Directory of core Lisp files that come with XEmacs. 2779 For internal use by the build procedure only.
2780 configure's idea of what LISP-DIRECTORY will be.
2728 */ ); 2781 */ );
2729 #ifdef PATH_LOADSEARCH 2782 #ifdef PATH_LOADSEARCH
2730 Vconfigure_lisp_directory = Ffile_name_as_directory 2783 Vconfigure_lisp_directory = Ffile_name_as_directory
2731 (build_string ((char *) PATH_LOADSEARCH)); 2784 (build_string ((char *) PATH_LOADSEARCH));
2732 #else 2785 #else
2779 #else 2832 #else
2780 Vconfigure_lock_directory = Qnil; 2833 Vconfigure_lock_directory = Qnil;
2781 #endif 2834 #endif
2782 #endif /* CLASH_DETECTION */ 2835 #endif /* CLASH_DETECTION */
2783 2836
2837 DEFVAR_LISP ("site-directory", &Vsite_directory /*
2838 *Directory of site-specific Lisp files that come with XEmacs.
2839 */ );
2840 Vsite_directory = Qnil;
2841
2784 DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /* 2842 DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /*
2785 For internal use by the build procedure only. 2843 For internal use by the build procedure only.
2786 configure's idea of what SITE-DIRECTORY will be. 2844 configure's idea of what SITE-DIRECTORY will be.
2787 */ ); 2845 */ );
2788 #ifdef PATH_SITE 2846 #ifdef PATH_SITE