Mercurial > emacs
comparison src/emacs.c @ 90068:eac554634bfa
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-79
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-747
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 25 Dec 2004 02:00:25 +0000 |
parents | fb79180b618d 51027cf26edc |
children | 95879cc1ed20 |
comparison
equal
deleted
inserted
replaced
90067:b481c5870e10 | 90068:eac554634bfa |
---|---|
340 /* If non-null, call this function from fatal_error_signal before | 340 /* If non-null, call this function from fatal_error_signal before |
341 committing suicide. */ | 341 committing suicide. */ |
342 | 342 |
343 void (*fatal_error_signal_hook) P_ ((void)); | 343 void (*fatal_error_signal_hook) P_ ((void)); |
344 | 344 |
345 #ifdef HAVE_GTK_AND_PTHREAD | |
346 /* When compiled with GTK and running under Gnome, multiple threads meay be | |
347 created. Keep track of our main thread to make sure signals are delivered | |
348 to it (see syssignal.h). */ | |
349 | |
350 pthread_t main_thread; | |
351 #endif | |
352 | |
345 | 353 |
346 #ifdef SIGUSR1 | 354 #ifdef SIGUSR1 |
347 SIGTYPE | 355 SIGTYPE |
348 handle_USR1_signal (sig) | 356 handle_USR1_signal (sig) |
349 int sig; | 357 int sig; |
350 { | 358 { |
351 struct input_event buf; | 359 struct input_event buf; |
352 | 360 |
361 SIGNAL_THREAD_CHECK (sig); | |
353 bzero (&buf, sizeof buf); | 362 bzero (&buf, sizeof buf); |
354 buf.kind = USER_SIGNAL_EVENT; | 363 buf.kind = USER_SIGNAL_EVENT; |
355 buf.frame_or_window = selected_frame; | 364 buf.frame_or_window = selected_frame; |
356 | 365 |
357 kbd_buffer_store_event (&buf); | 366 kbd_buffer_store_event (&buf); |
363 handle_USR2_signal (sig) | 372 handle_USR2_signal (sig) |
364 int sig; | 373 int sig; |
365 { | 374 { |
366 struct input_event buf; | 375 struct input_event buf; |
367 | 376 |
377 SIGNAL_THREAD_CHECK (sig); | |
368 bzero (&buf, sizeof buf); | 378 bzero (&buf, sizeof buf); |
369 buf.kind = USER_SIGNAL_EVENT; | 379 buf.kind = USER_SIGNAL_EVENT; |
370 buf.code = 1; | 380 buf.code = 1; |
371 buf.frame_or_window = selected_frame; | 381 buf.frame_or_window = selected_frame; |
372 | 382 |
377 /* Handle bus errors, invalid instruction, etc. */ | 387 /* Handle bus errors, invalid instruction, etc. */ |
378 SIGTYPE | 388 SIGTYPE |
379 fatal_error_signal (sig) | 389 fatal_error_signal (sig) |
380 int sig; | 390 int sig; |
381 { | 391 { |
392 SIGNAL_THREAD_CHECK (sig); | |
382 fatal_error_code = sig; | 393 fatal_error_code = sig; |
383 signal (sig, SIG_DFL); | 394 signal (sig, SIG_DFL); |
384 | 395 |
385 TOTALLY_UNBLOCK_INPUT; | 396 TOTALLY_UNBLOCK_INPUT; |
386 | 397 |
416 SIGTYPE | 427 SIGTYPE |
417 memory_warning_signal (sig) | 428 memory_warning_signal (sig) |
418 int sig; | 429 int sig; |
419 { | 430 { |
420 signal (sig, memory_warning_signal); | 431 signal (sig, memory_warning_signal); |
432 SIGNAL_THREAD_CHECK (sig); | |
421 | 433 |
422 malloc_warning ("Operating system warns that virtual memory is running low.\n"); | 434 malloc_warning ("Operating system warns that virtual memory is running low.\n"); |
423 | 435 |
424 /* It might be unsafe to call do_auto_save now. */ | 436 /* It might be unsafe to call do_auto_save now. */ |
425 force_auto_save_soon (); | 437 force_auto_save_soon (); |
1026 # ifndef SYNC_INPUT | 1038 # ifndef SYNC_INPUT |
1027 /* Arrange to disable interrupt input inside malloc etc. */ | 1039 /* Arrange to disable interrupt input inside malloc etc. */ |
1028 uninterrupt_malloc (); | 1040 uninterrupt_malloc (); |
1029 # endif /* not SYNC_INPUT */ | 1041 # endif /* not SYNC_INPUT */ |
1030 #endif /* not SYSTEM_MALLOC */ | 1042 #endif /* not SYSTEM_MALLOC */ |
1043 | |
1044 #ifdef HAVE_GTK_AND_PTHREAD | |
1045 main_thread = pthread_self (); | |
1046 #endif /* HAVE_GTK_AND_PTHREAD */ | |
1031 | 1047 |
1032 #if defined (MSDOS) || defined (WINDOWSNT) | 1048 #if defined (MSDOS) || defined (WINDOWSNT) |
1033 /* We do all file input/output as binary files. When we need to translate | 1049 /* We do all file input/output as binary files. When we need to translate |
1034 newlines, we do that manually. */ | 1050 newlines, we do that manually. */ |
1035 _fmode = O_BINARY; | 1051 _fmode = O_BINARY; |
1115 inhibit_window_system = 1; | 1131 inhibit_window_system = 1; |
1116 | 1132 |
1117 /* Handle the -batch switch, which means don't do interactive display. */ | 1133 /* Handle the -batch switch, which means don't do interactive display. */ |
1118 noninteractive = 0; | 1134 noninteractive = 0; |
1119 if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) | 1135 if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) |
1120 noninteractive = 1; | 1136 { |
1137 noninteractive = 1; | |
1138 Vundo_outer_limit = Qnil; | |
1139 } | |
1121 if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) | 1140 if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) |
1122 { | 1141 { |
1123 noninteractive = 1; /* Set batch mode. */ | 1142 noninteractive = 1; /* Set batch mode. */ |
1124 /* Convert --script to -l, un-skip it, and sort again so that -l will be | 1143 /* Convert --script to -l, un-skip it, and sort again so that -l will be |
1125 handled in proper sequence. */ | 1144 handled in proper sequence. */ |