aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 4455e6b4d9f..052f22ea622 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -141,7 +141,7 @@ Lisp_Object Qfile_name_handler_alist;
141 141
142Lisp_Object Qrisky_local_variable; 142Lisp_Object Qrisky_local_variable;
143 143
144/* If non-zero, emacs should not attempt to use a window-specific code, 144/* If non-zero, Emacs should not attempt to use a window-specific code,
145 but instead should use the virtual terminal under which it was started. */ 145 but instead should use the virtual terminal under which it was started. */
146int inhibit_window_system; 146int inhibit_window_system;
147 147
@@ -169,7 +169,6 @@ static unsigned long heap_bss_diff;
169#define MAX_HEAP_BSS_DIFF (1024*1024) 169#define MAX_HEAP_BSS_DIFF (1024*1024)
170 170
171/* Nonzero means running Emacs without interactive terminal. */ 171/* Nonzero means running Emacs without interactive terminal. */
172
173int noninteractive; 172int noninteractive;
174 173
175/* Nonzero means remove site-lisp directories from load-path. */ 174/* Nonzero means remove site-lisp directories from load-path. */
@@ -249,14 +248,14 @@ Display options:\n\
249--border-color, -bd COLOR main border color\n\ 248--border-color, -bd COLOR main border color\n\
250--border-width, -bw WIDTH width of main border\n\ 249--border-width, -bw WIDTH width of main border\n\
251--color, --color=MODE override color mode for character terminals;\n\ 250--color, --color=MODE override color mode for character terminals;\n\
252 MODE defaults to `auto', and can also\n\ 251 MODE defaults to `auto', and\n\
253 be `never', `auto', `always',\n\ 252 can also be `never', `always',\n\
254 or a mode name like `ansi8'\n\ 253 or a mode name like `ansi8'\n\
255--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\ 254--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\
256--font, -fn FONT default font; must be fixed-width\n\ 255--font, -fn FONT default font; must be fixed-width\n\
257--foreground-color, -fg COLOR window foreground color\n\ 256--foreground-color, -fg COLOR window foreground color\n\
258--fullheight, -fh make the first frame high as the screen\n\ 257--fullheight, -fh make the first frame high as the screen\n\
259--fullscreen, -fs make first frame fullscreen\n\ 258--fullscreen, -fs make the first frame fullscreen\n\
260--fullwidth, -fw make the first frame wide as the screen\n\ 259--fullwidth, -fw make the first frame wide as the screen\n\
261--maximized, -mm make the first frame maximized\n\ 260--maximized, -mm make the first frame maximized\n\
262--geometry, -g GEOMETRY window geometry\n\ 261--geometry, -g GEOMETRY window geometry\n\
@@ -382,7 +381,7 @@ static void
382init_cmdargs (int argc, char **argv, int skip_args) 381init_cmdargs (int argc, char **argv, int skip_args)
383{ 382{
384 register int i; 383 register int i;
385 Lisp_Object name, dir, tem; 384 Lisp_Object name, dir, handler;
386 int count = SPECPDL_INDEX (); 385 int count = SPECPDL_INDEX ();
387 Lisp_Object raw_name; 386 Lisp_Object raw_name;
388 387
@@ -393,8 +392,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
393 392
394 /* Add /: to the front of the name 393 /* Add /: to the front of the name
395 if it would otherwise be treated as magic. */ 394 if it would otherwise be treated as magic. */
396 tem = Ffind_file_name_handler (raw_name, Qt); 395 handler = Ffind_file_name_handler (raw_name, Qt);
397 if (! NILP (tem)) 396 if (! NILP (handler))
398 raw_name = concat2 (build_string ("/:"), raw_name); 397 raw_name = concat2 (build_string ("/:"), raw_name);
399 398
400 Vinvocation_name = Ffile_name_nondirectory (raw_name); 399 Vinvocation_name = Ffile_name_nondirectory (raw_name);
@@ -411,8 +410,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
411 { 410 {
412 /* Add /: to the front of the name 411 /* Add /: to the front of the name
413 if it would otherwise be treated as magic. */ 412 if it would otherwise be treated as magic. */
414 tem = Ffind_file_name_handler (found, Qt); 413 handler = Ffind_file_name_handler (found, Qt);
415 if (! NILP (tem)) 414 if (! NILP (handler))
416 found = concat2 (build_string ("/:"), found); 415 found = concat2 (build_string ("/:"), found);
417 Vinvocation_directory = Ffile_name_directory (found); 416 Vinvocation_directory = Ffile_name_directory (found);
418 } 417 }
@@ -547,21 +546,22 @@ static char dump_tz[] = "UtC0";
547 Provide dummy definitions to avoid error. 546 Provide dummy definitions to avoid error.
548 (We don't have any real constructors or destructors.) */ 547 (We don't have any real constructors or destructors.) */
549#ifdef __GNUC__ 548#ifdef __GNUC__
549
550/* Define a dummy function F. Declare F too, to pacify gcc
551 -Wmissing-prototypes. */
552#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {}
553
550#ifndef GCC_CTORS_IN_LIBC 554#ifndef GCC_CTORS_IN_LIBC
551void __do_global_ctors (void) 555DEFINE_DUMMY_FUNCTION (__do_global_ctors)
552{} 556DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
553void __do_global_ctors_aux (void) 557DEFINE_DUMMY_FUNCTION (__do_global_dtors)
554{}
555void __do_global_dtors (void)
556{}
557/* GNU/Linux has a bug in its library; avoid an error. */ 558/* GNU/Linux has a bug in its library; avoid an error. */
558#ifndef GNU_LINUX 559#ifndef GNU_LINUX
559char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; 560char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
560#endif 561#endif
561char * __DTOR_LIST__[2] = { (char *) (-1), 0 }; 562char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
562#endif /* GCC_CTORS_IN_LIBC */ 563#endif /* GCC_CTORS_IN_LIBC */
563void __main (void) 564DEFINE_DUMMY_FUNCTION (__main)
564{}
565#endif /* __GNUC__ */ 565#endif /* __GNUC__ */
566#endif /* ORDINARY_LINK */ 566#endif /* ORDINARY_LINK */
567 567
@@ -576,7 +576,8 @@ void __main (void)
576 enough information to do it right. */ 576 enough information to do it right. */
577 577
578static int 578static int
579argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) 579argmatch (char **argv, int argc, const char *sstr, const char *lstr,
580 int minlen, char **valptr, int *skipptr)
580{ 581{
581 char *p = NULL; 582 char *p = NULL;
582 int arglen; 583 int arglen;
@@ -948,7 +949,7 @@ main (int argc, char **argv)
948 /* Convert --script to -scriptload, un-skip it, and sort again 949 /* Convert --script to -scriptload, un-skip it, and sort again
949 so that it will be handled in proper sequence. */ 950 so that it will be handled in proper sequence. */
950 /* FIXME broken for --script=FILE - is that supposed to work? */ 951 /* FIXME broken for --script=FILE - is that supposed to work? */
951 argv[skip_args - 1] = "-scriptload"; 952 argv[skip_args - 1] = (char *) "-scriptload";
952 skip_args -= 2; 953 skip_args -= 2;
953 sort_args (argc, argv); 954 sort_args (argc, argv);
954 } 955 }
@@ -1347,7 +1348,7 @@ main (int argc, char **argv)
1347 1348
1348 for (j = 0; j < count_before + 1; j++) 1349 for (j = 0; j < count_before + 1; j++)
1349 new[j] = argv[j]; 1350 new[j] = argv[j];
1350 new[count_before + 1] = "-d"; 1351 new[count_before + 1] = (char *) "-d";
1351 new[count_before + 2] = displayname; 1352 new[count_before + 2] = displayname;
1352 for (j = count_before + 2; j <argc; j++) 1353 for (j = count_before + 2; j <argc; j++)
1353 new[j + 1] = argv[j]; 1354 new[j + 1] = argv[j];
@@ -1357,7 +1358,7 @@ main (int argc, char **argv)
1357 /* Change --display to -d, when its arg is separate. */ 1358 /* Change --display to -d, when its arg is separate. */
1358 else if (displayname != 0 && skip_args > count_before 1359 else if (displayname != 0 && skip_args > count_before
1359 && argv[count_before + 1][1] == '-') 1360 && argv[count_before + 1][1] == '-')
1360 argv[count_before + 1] = "-d"; 1361 argv[count_before + 1] = (char *) "-d";
1361 1362
1362 if (! no_site_lisp) 1363 if (! no_site_lisp)
1363 { 1364 {
@@ -2084,9 +2085,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
2084 2085
2085#ifndef CANNOT_DUMP 2086#ifndef CANNOT_DUMP
2086 2087
2087/* FIXME: maybe this should go into header file, config.h seems the 2088#include "unexec.h"
2088 only one appropriate. */
2089extern int unexec (const char *, const char *);
2090 2089
2091DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0, 2090DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
2092 doc: /* Dump current state of Emacs into executable file FILENAME. 2091 doc: /* Dump current state of Emacs into executable file FILENAME.
@@ -2380,7 +2379,7 @@ Special values:
2380Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix, 2379Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix,
2381hpux, irix, usg-unix-v) indicates some sort of Unix system. */); 2380hpux, irix, usg-unix-v) indicates some sort of Unix system. */);
2382 Vsystem_type = intern_c_string (SYSTEM_TYPE); 2381 Vsystem_type = intern_c_string (SYSTEM_TYPE);
2383 /* Above values are from SYSTEM_TYPE in src/s/*.h. */ 2382 /* The above values are from SYSTEM_TYPE in include files under src/s. */
2384 2383
2385 DEFVAR_LISP ("system-configuration", Vsystem_configuration, 2384 DEFVAR_LISP ("system-configuration", Vsystem_configuration,
2386 doc: /* Value is string indicating configuration Emacs was built for. 2385 doc: /* Value is string indicating configuration Emacs was built for.