aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-09-02 10:10:35 -0700
committerPaul Eggert2012-09-02 10:10:35 -0700
commit1882aa387874f0ac0965fa7bec1c5760dc37e48f (patch)
tree27cfcfb9f16c55a0bf84a5c91a5efd20f495ef55 /src
parenta411ac43d3667d042fa36361275eccbe9aca80af (diff)
downloademacs-1882aa387874f0ac0965fa7bec1c5760dc37e48f.tar.gz
emacs-1882aa387874f0ac0965fa7bec1c5760dc37e48f.zip
* emacs.c, eval.c: Use bool for boolean.
* emacs.c (initialized, inhibit_window_system, running_asynch_code): (malloc_using_checking) [DOUG_LEA_MALLOC]: (display_arg) [HAVE_X_WINDOWS || HAVE_NS]: (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch) (main, decode_env_path, Fdaemon_initialized): * eval.c (call_debugger, Finteractive_p, interactive_p): (unwind_to_catch, Fsignal, wants_debugger, skip_debugger) (maybe_call_debugger, Fbacktrace): * process.c (read_process_output, exec_sentinel): Use bool for booleans. * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X. All callers changed. * eval.c (interactive_p): Omit always-true boolean argument EXCLUDE_SUBRS_P. All callers changed. * dispextern.h, lisp.h: Reflect above API changes. * firstfile.c (dummy): Use the address of 'main', whose signature won't change, instead of the address of 'initialize', whose signature just changed from int to bool. * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ... * msdos.c (fatal_error_in_progress): ... from here. * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead of incrementing it. (redisplay_internal, unwind_redisplay): Simply clear REDISPLAYING_P when unwinding, instead of saving its previous, always-false value and then restoring it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/dispextern.h2
-rw-r--r--src/emacs.c63
-rw-r--r--src/eval.c58
-rw-r--r--src/firstfile.c5
-rw-r--r--src/lisp.h28
-rw-r--r--src/msdos.c1
-rw-r--r--src/process.c6
-rw-r--r--src/w32.c2
-rw-r--r--src/xdisp.c25
-rw-r--r--src/xterm.c2
11 files changed, 114 insertions, 105 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a5978e6456b..2053c258df4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,32 @@
12012-09-02 Paul Eggert <eggert@cs.ucla.edu> 12012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * emacs.c, eval.c: Use bool for boolean.
4 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8 (main, decode_env_path, Fdaemon_initialized):
9 * eval.c (call_debugger, Finteractive_p, interactive_p):
10 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
11 (maybe_call_debugger, Fbacktrace):
12 * process.c (read_process_output, exec_sentinel):
13 Use bool for booleans.
14 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
15 All callers changed.
16 * eval.c (interactive_p): Omit always-true boolean argument
17 EXCLUDE_SUBRS_P. All callers changed.
18 * dispextern.h, lisp.h: Reflect above API changes.
19 * firstfile.c (dummy): Use the address of 'main', whose signature
20 won't change, instead of the address of 'initialize', whose
21 signature just changed from int to bool.
22 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
23 * msdos.c (fatal_error_in_progress): ... from here.
24 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
25 of incrementing it.
26 (redisplay_internal, unwind_redisplay): Simply clear
27 REDISPLAYING_P when unwinding, instead of saving its previous,
28 always-false value and then restoring it.
29
3 Clean up some extern decls. 30 Clean up some extern decls.
4 Mostly, this hoists extern decls out of .c files and into .h files. 31 Mostly, this hoists extern decls out of .c files and into .h files.
5 That way, we're more likely to catch errors if the interfaces change. 32 That way, we're more likely to catch errors if the interfaces change.
diff --git a/src/dispextern.h b/src/dispextern.h
index e74e7deb591..73f3350713f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3055,7 +3055,7 @@ void move_it_in_display_line (struct it *it,
3055int in_display_vector_p (struct it *); 3055int in_display_vector_p (struct it *);
3056int frame_mode_line_height (struct frame *); 3056int frame_mode_line_height (struct frame *);
3057extern Lisp_Object Qtool_bar; 3057extern Lisp_Object Qtool_bar;
3058extern int redisplaying_p; 3058extern bool redisplaying_p;
3059extern int help_echo_showing_p; 3059extern int help_echo_showing_p;
3060extern int current_mode_line_height, current_header_line_height; 3060extern int current_mode_line_height, current_header_line_height;
3061extern Lisp_Object help_echo_string, help_echo_window; 3061extern Lisp_Object help_echo_string, help_echo_window;
diff --git a/src/emacs.c b/src/emacs.c
index adfff6ff3ed..dac5edd544f 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -95,10 +95,10 @@ static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundati
95/* Empty lisp strings. To avoid having to build any others. */ 95/* Empty lisp strings. To avoid having to build any others. */
96Lisp_Object empty_unibyte_string, empty_multibyte_string; 96Lisp_Object empty_unibyte_string, empty_multibyte_string;
97 97
98/* Set nonzero after Emacs has started up the first time. 98/* Set after Emacs has started up the first time.
99 Prevents reinitialization of the Lisp world and keymaps 99 Prevents reinitialization of the Lisp world and keymaps
100 on subsequent starts. */ 100 on subsequent starts. */
101int initialized; 101bool initialized;
102 102
103#ifdef DARWIN_OS 103#ifdef DARWIN_OS
104extern void unexec_init_emacs_zone (void); 104extern void unexec_init_emacs_zone (void);
@@ -112,9 +112,9 @@ static void *malloc_state_ptr;
112extern void *malloc_get_state (void); 112extern void *malloc_get_state (void);
113/* From glibc, a routine that overwrites the malloc internal state. */ 113/* From glibc, a routine that overwrites the malloc internal state. */
114extern int malloc_set_state (void*); 114extern int malloc_set_state (void*);
115/* Non-zero if the MALLOC_CHECK_ environment variable was set while 115/* True if the MALLOC_CHECK_ environment variable was set while
116 dumping. Used to work around a bug in glibc's malloc. */ 116 dumping. Used to work around a bug in glibc's malloc. */
117static int malloc_using_checking; 117static bool malloc_using_checking;
118#endif 118#endif
119 119
120Lisp_Object Qfile_name_handler_alist; 120Lisp_Object Qfile_name_handler_alist;
@@ -123,17 +123,17 @@ Lisp_Object Qrisky_local_variable;
123 123
124Lisp_Object Qkill_emacs; 124Lisp_Object Qkill_emacs;
125 125
126/* If non-zero, Emacs should not attempt to use a window-specific code, 126/* If true, Emacs should not attempt to use a window-specific code,
127 but instead should use the virtual terminal under which it was started. */ 127 but instead should use the virtual terminal under which it was started. */
128int inhibit_window_system; 128bool inhibit_window_system;
129 129
130/* If non-zero, a filter or a sentinel is running. Tested to save the match 130/* If true, a filter or a sentinel is running. Tested to save the match
131 data on the first attempt to change it inside asynchronous code. */ 131 data on the first attempt to change it inside asynchronous code. */
132int running_asynch_code; 132bool running_asynch_code;
133 133
134#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 134#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
135/* If non-zero, -d was specified, meaning we're using some window system. */ 135/* If true, -d was specified, meaning we're using some window system. */
136int display_arg; 136bool display_arg;
137#endif 137#endif
138 138
139/* An address near the bottom of the stack. 139/* An address near the bottom of the stack.
@@ -150,11 +150,11 @@ static void *my_heap_start;
150static uprintmax_t heap_bss_diff; 150static uprintmax_t heap_bss_diff;
151#endif 151#endif
152 152
153/* Nonzero means running Emacs without interactive terminal. */ 153/* True means running Emacs without interactive terminal. */
154int noninteractive; 154bool noninteractive;
155 155
156/* Nonzero means remove site-lisp directories from load-path. */ 156/* True means remove site-lisp directories from load-path. */
157int no_site_lisp; 157bool no_site_lisp;
158 158
159/* Name for the server started by the daemon.*/ 159/* Name for the server started by the daemon.*/
160static char *daemon_name; 160static char *daemon_name;
@@ -272,8 +272,8 @@ section of the Emacs manual or the file BUGS.\n"
272/* Signal code for the fatal signal that was received. */ 272/* Signal code for the fatal signal that was received. */
273static int fatal_error_code; 273static int fatal_error_code;
274 274
275/* Nonzero if handling a fatal error already. */ 275/* True if handling a fatal error already. */
276int fatal_error_in_progress; 276bool fatal_error_in_progress;
277 277
278#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD 278#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
279/* When compiled with GTK and running under Gnome, 279/* When compiled with GTK and running under Gnome,
@@ -311,7 +311,7 @@ fatal_error_signal (int sig)
311 if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) 311 if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
312 Fkill_emacs (make_number (sig)); 312 Fkill_emacs (make_number (sig));
313 313
314 shut_down_emacs (sig, 0, Qnil); 314 shut_down_emacs (sig, Qnil);
315 } 315 }
316 316
317 /* Signal the same code; this time it will really be fatal. 317 /* Signal the same code; this time it will really be fatal.
@@ -568,7 +568,7 @@ DEFINE_DUMMY_FUNCTION (__main)
568 Too bad we can't just use getopt for all of this, but we don't have 568 Too bad we can't just use getopt for all of this, but we don't have
569 enough information to do it right. */ 569 enough information to do it right. */
570 570
571static int 571static bool
572argmatch (char **argv, int argc, const char *sstr, const char *lstr, 572argmatch (char **argv, int argc, const char *sstr, const char *lstr,
573 int minlen, char **valptr, int *skipptr) 573 int minlen, char **valptr, int *skipptr)
574{ 574{
@@ -675,12 +675,12 @@ main (int argc, char **argv)
675 Lisp_Object dummy; 675 Lisp_Object dummy;
676#endif 676#endif
677 char stack_bottom_variable; 677 char stack_bottom_variable;
678 int do_initial_setlocale; 678 bool do_initial_setlocale;
679 int skip_args = 0; 679 int skip_args = 0;
680#ifdef HAVE_SETRLIMIT 680#ifdef HAVE_SETRLIMIT
681 struct rlimit rlim; 681 struct rlimit rlim;
682#endif 682#endif
683 int no_loadup = 0; 683 bool no_loadup = 0;
684 char *junk = 0; 684 char *junk = 0;
685 char *dname_arg = 0; 685 char *dname_arg = 0;
686#ifdef NS_IMPL_COCOA 686#ifdef NS_IMPL_COCOA
@@ -1955,7 +1955,7 @@ all of which are called before Emacs is actually killed. */)
1955 x_clipboard_manager_save_all (); 1955 x_clipboard_manager_save_all ();
1956#endif 1956#endif
1957 1957
1958 shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); 1958 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil);
1959 1959
1960#ifdef HAVE_NS 1960#ifdef HAVE_NS
1961 ns_release_autorelease_pool (ns_pool); 1961 ns_release_autorelease_pool (ns_pool);
@@ -1991,7 +1991,7 @@ all of which are called before Emacs is actually killed. */)
1991 and Fkill_emacs. */ 1991 and Fkill_emacs. */
1992 1992
1993void 1993void
1994shut_down_emacs (int sig, int no_x, Lisp_Object stuff) 1994shut_down_emacs (int sig, Lisp_Object stuff)
1995{ 1995{
1996 /* Prevent running of hooks from now on. */ 1996 /* Prevent running of hooks from now on. */
1997 Vrun_hooks = Qnil; 1997 Vrun_hooks = Qnil;
@@ -2026,17 +2026,6 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
2026 unlock_all_files (); 2026 unlock_all_files ();
2027#endif 2027#endif
2028 2028
2029#if 0 /* This triggers a bug in XCloseDisplay and is not needed. */
2030#ifdef HAVE_X_WINDOWS
2031 /* It's not safe to call intern here. Maybe we are crashing. */
2032 if (!noninteractive && SYMBOLP (Vinitial_window_system)
2033 && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1
2034 && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x'
2035 && ! no_x)
2036 Fx_close_current_connection ();
2037#endif /* HAVE_X_WINDOWS */
2038#endif
2039
2040#ifdef SIGIO 2029#ifdef SIGIO
2041 /* There is a tendency for a SIGIO signal to arrive within exit, 2030 /* There is a tendency for a SIGIO signal to arrive within exit,
2042 and cause a SIGHUP because the input descriptor is already closed. */ 2031 and cause a SIGHUP because the input descriptor is already closed. */
@@ -2228,7 +2217,7 @@ decode_env_path (const char *evarname, const char *defalt)
2228 const char *path, *p; 2217 const char *path, *p;
2229 Lisp_Object lpath, element, tem; 2218 Lisp_Object lpath, element, tem;
2230#ifdef WINDOWSNT 2219#ifdef WINDOWSNT
2231 int defaulted = 0; 2220 bool defaulted = 0;
2232 const char *emacs_dir = egetenv ("emacs_dir"); 2221 const char *emacs_dir = egetenv ("emacs_dir");
2233 static const char *emacs_dir_env = "%emacs_dir%/"; 2222 static const char *emacs_dir_env = "%emacs_dir%/";
2234 const size_t emacs_dir_len = strlen (emacs_dir_env); 2223 const size_t emacs_dir_len = strlen (emacs_dir_env);
@@ -2324,7 +2313,7 @@ from the parent process and its tty file descriptors. */)
2324 (void) 2313 (void)
2325{ 2314{
2326 int nfd; 2315 int nfd;
2327 int err = 0; 2316 bool err = 0;
2328 2317
2329 if (!IS_DAEMON) 2318 if (!IS_DAEMON)
2330 error ("This function can only be called if emacs is run as a daemon"); 2319 error ("This function can only be called if emacs is run as a daemon");
diff --git a/src/eval.c b/src/eval.c
index ad1daf721b8..3a4953665e3 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -131,7 +131,7 @@ int handling_signal;
131Lisp_Object inhibit_lisp_code; 131Lisp_Object inhibit_lisp_code;
132 132
133static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); 133static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
134static int interactive_p (int); 134static bool interactive_p (void);
135static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); 135static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
136 136
137/* Functions to set Lisp_Object slots of struct specbinding. */ 137/* Functions to set Lisp_Object slots of struct specbinding. */
@@ -194,7 +194,7 @@ restore_stack_limits (Lisp_Object data)
194static Lisp_Object 194static Lisp_Object
195call_debugger (Lisp_Object arg) 195call_debugger (Lisp_Object arg)
196{ 196{
197 int debug_while_redisplaying; 197 bool debug_while_redisplaying;
198 ptrdiff_t count = SPECPDL_INDEX (); 198 ptrdiff_t count = SPECPDL_INDEX ();
199 Lisp_Object val; 199 Lisp_Object val;
200 EMACS_INT old_max = max_specpdl_size; 200 EMACS_INT old_max = max_specpdl_size;
@@ -525,7 +525,7 @@ spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
525use `called-interactively-p'. */) 525use `called-interactively-p'. */)
526 (void) 526 (void)
527{ 527{
528 return interactive_p (1) ? Qt : Qnil; 528 return interactive_p () ? Qt : Qnil;
529} 529}
530 530
531 531
@@ -550,19 +550,17 @@ non-nil unconditionally (\"p\" is a good way to do this), or via
550\(not (or executing-kbd-macro noninteractive)). */) 550\(not (or executing-kbd-macro noninteractive)). */)
551 (Lisp_Object kind) 551 (Lisp_Object kind)
552{ 552{
553 return ((INTERACTIVE || !EQ (kind, intern ("interactive"))) 553 return (((INTERACTIVE || !EQ (kind, intern ("interactive")))
554 && interactive_p (1)) ? Qt : Qnil; 554 && interactive_p ())
555 ? Qt : Qnil);
555} 556}
556 557
557 558
558/* Return 1 if function in which this appears was called using 559/* Return true if function in which this appears was called using
559 call-interactively. 560 call-interactively and is not a built-in. */
560 561
561 EXCLUDE_SUBRS_P non-zero means always return 0 if the function 562static bool
562 called is a built-in. */ 563interactive_p (void)
563
564static int
565interactive_p (int exclude_subrs_p)
566{ 564{
567 struct backtrace *btp; 565 struct backtrace *btp;
568 Lisp_Object fun; 566 Lisp_Object fun;
@@ -591,9 +589,9 @@ interactive_p (int exclude_subrs_p)
591 /* `btp' now points at the frame of the innermost function that isn't 589 /* `btp' now points at the frame of the innermost function that isn't
592 a special form, ignoring frames for Finteractive_p and/or 590 a special form, ignoring frames for Finteractive_p and/or
593 Fbytecode at the top. If this frame is for a built-in function 591 Fbytecode at the top. If this frame is for a built-in function
594 (such as load or eval-region) return nil. */ 592 (such as load or eval-region) return false. */
595 fun = Findirect_function (*btp->function, Qnil); 593 fun = Findirect_function (*btp->function, Qnil);
596 if (exclude_subrs_p && SUBRP (fun)) 594 if (SUBRP (fun))
597 return 0; 595 return 0;
598 596
599 /* `btp' points to the frame of a Lisp function that called interactive-p. 597 /* `btp' points to the frame of a Lisp function that called interactive-p.
@@ -1101,7 +1099,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object
1101static _Noreturn void 1099static _Noreturn void
1102unwind_to_catch (struct catchtag *catch, Lisp_Object value) 1100unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1103{ 1101{
1104 int last_time; 1102 bool last_time;
1105 1103
1106 /* Save the value in the tag. */ 1104 /* Save the value in the tag. */
1107 catch->val = value; 1105 catch->val = value;
@@ -1450,8 +1448,8 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
1450 1448
1451 1449
1452static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object); 1450static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object);
1453static int maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, 1451static bool maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig,
1454 Lisp_Object data); 1452 Lisp_Object data);
1455 1453
1456void 1454void
1457process_quit_flag (void) 1455process_quit_flag (void)
@@ -1556,7 +1554,7 @@ See also the function `condition-case'. */)
1556 if requested". */ 1554 if requested". */
1557 || EQ (h->handler, Qerror))) 1555 || EQ (h->handler, Qerror)))
1558 { 1556 {
1559 int debugger_called 1557 bool debugger_called
1560 = maybe_call_debugger (conditions, error_symbol, data); 1558 = maybe_call_debugger (conditions, error_symbol, data);
1561 /* We can't return values to code which signaled an error, but we 1559 /* We can't return values to code which signaled an error, but we
1562 can continue code which has signaled a quit. */ 1560 can continue code which has signaled a quit. */
@@ -1650,10 +1648,10 @@ signal_error (const char *s, Lisp_Object arg)
1650} 1648}
1651 1649
1652 1650
1653/* Return nonzero if LIST is a non-nil atom or 1651/* Return true if LIST is a non-nil atom or
1654 a list containing one of CONDITIONS. */ 1652 a list containing one of CONDITIONS. */
1655 1653
1656static int 1654static bool
1657wants_debugger (Lisp_Object list, Lisp_Object conditions) 1655wants_debugger (Lisp_Object list, Lisp_Object conditions)
1658{ 1656{
1659 if (NILP (list)) 1657 if (NILP (list))
@@ -1673,15 +1671,15 @@ wants_debugger (Lisp_Object list, Lisp_Object conditions)
1673 return 0; 1671 return 0;
1674} 1672}
1675 1673
1676/* Return 1 if an error with condition-symbols CONDITIONS, 1674/* Return true if an error with condition-symbols CONDITIONS,
1677 and described by SIGNAL-DATA, should skip the debugger 1675 and described by SIGNAL-DATA, should skip the debugger
1678 according to debugger-ignored-errors. */ 1676 according to debugger-ignored-errors. */
1679 1677
1680static int 1678static bool
1681skip_debugger (Lisp_Object conditions, Lisp_Object data) 1679skip_debugger (Lisp_Object conditions, Lisp_Object data)
1682{ 1680{
1683 Lisp_Object tail; 1681 Lisp_Object tail;
1684 int first_string = 1; 1682 bool first_string = 1;
1685 Lisp_Object error_message; 1683 Lisp_Object error_message;
1686 1684
1687 error_message = Qnil; 1685 error_message = Qnil;
@@ -1716,7 +1714,7 @@ skip_debugger (Lisp_Object conditions, Lisp_Object data)
1716 = SIG is the error symbol, and DATA is the rest of the data. 1714 = SIG is the error symbol, and DATA is the rest of the data.
1717 = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA). 1715 = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA).
1718 This is for memory-full errors only. */ 1716 This is for memory-full errors only. */
1719static int 1717static bool
1720maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) 1718maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data)
1721{ 1719{
1722 Lisp_Object combined_data; 1720 Lisp_Object combined_data;
@@ -2939,7 +2937,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs,
2939 Lisp_Object val, syms_left, next, lexenv; 2937 Lisp_Object val, syms_left, next, lexenv;
2940 ptrdiff_t count = SPECPDL_INDEX (); 2938 ptrdiff_t count = SPECPDL_INDEX ();
2941 ptrdiff_t i; 2939 ptrdiff_t i;
2942 int optional, rest; 2940 bool optional, rest;
2943 2941
2944 if (CONSP (fun)) 2942 if (CONSP (fun))
2945 { 2943 {
@@ -3342,13 +3340,13 @@ Output stream used is value of `standard-output'. */)
3342 write_string ("(", -1); 3340 write_string ("(", -1);
3343 if (backlist->nargs == MANY) 3341 if (backlist->nargs == MANY)
3344 { /* FIXME: Can this happen? */ 3342 { /* FIXME: Can this happen? */
3345 int i; 3343 bool later_arg = 0;
3346 for (tail = *backlist->args, i = 0; 3344 for (tail = *backlist->args; !NILP (tail); tail = Fcdr (tail))
3347 !NILP (tail);
3348 tail = Fcdr (tail), i = 1)
3349 { 3345 {
3350 if (i) write_string (" ", -1); 3346 if (later_arg)
3347 write_string (" ", -1);
3351 Fprin1 (Fcar (tail), Qnil); 3348 Fprin1 (Fcar (tail), Qnil);
3349 later_arg = 1;
3352 } 3350 }
3353 } 3351 }
3354 else 3352 else
diff --git a/src/firstfile.c b/src/firstfile.c
index 84511cfe0ad..444fb71b55d 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -27,7 +27,6 @@ static char _my_begbss[1];
27char * my_begbss_static = _my_begbss; 27char * my_begbss_static = _my_begbss;
28 28
29/* Add a dummy reference to ensure emacs.obj is linked in. */ 29/* Add a dummy reference to ensure emacs.obj is linked in. */
30extern int initialized; 30extern int main (int, char **);
31static int * dummy = &initialized; 31static int (*dummy) (int, char **) = main;
32#endif 32#endif
33
diff --git a/src/lisp.h b/src/lisp.h
index 75f1b5e802d..35a07c838fb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3258,7 +3258,7 @@ extern void syms_of_frame (void);
3258extern char **initial_argv; 3258extern char **initial_argv;
3259extern int initial_argc; 3259extern int initial_argc;
3260#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 3260#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
3261extern int display_arg; 3261extern bool display_arg;
3262#endif 3262#endif
3263extern Lisp_Object decode_env_path (const char *, const char *); 3263extern Lisp_Object decode_env_path (const char *, const char *);
3264extern Lisp_Object empty_unibyte_string, empty_multibyte_string; 3264extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
@@ -3277,22 +3277,26 @@ void synchronize_system_time_locale (void);
3277#define synchronize_system_messages_locale() 3277#define synchronize_system_messages_locale()
3278#define synchronize_system_time_locale() 3278#define synchronize_system_time_locale()
3279#endif 3279#endif
3280void shut_down_emacs (int, int, Lisp_Object); 3280extern void shut_down_emacs (int, Lisp_Object);
3281/* Nonzero means don't do interactive redisplay and don't change tty modes. */
3282extern int noninteractive;
3283 3281
3284/* Nonzero means remove site-lisp directories from load-path. */ 3282/* True means don't do interactive redisplay and don't change tty modes. */
3285extern int no_site_lisp; 3283extern bool noninteractive;
3284
3285/* True means remove site-lisp directories from load-path. */
3286extern bool no_site_lisp;
3286 3287
3287/* Pipe used to send exit notification to the daemon parent at 3288/* Pipe used to send exit notification to the daemon parent at
3288 startup. */ 3289 startup. */
3289extern int daemon_pipe[2]; 3290extern int daemon_pipe[2];
3290#define IS_DAEMON (daemon_pipe[1] != 0) 3291#define IS_DAEMON (daemon_pipe[1] != 0)
3291 3292
3292/* Nonzero means don't do use window-system-specific display code. */ 3293/* True if handling a fatal error already. */
3293extern int inhibit_window_system; 3294extern bool fatal_error_in_progress;
3294/* Nonzero means that a filter or a sentinel is running. */ 3295
3295extern int running_asynch_code; 3296/* True means don't do use window-system-specific display code. */
3297extern bool inhibit_window_system;
3298/* True means that a filter or a sentinel is running. */
3299extern bool running_asynch_code;
3296 3300
3297/* Defined in process.c. */ 3301/* Defined in process.c. */
3298extern Lisp_Object QCtype, Qlocal; 3302extern Lisp_Object QCtype, Qlocal;
@@ -3514,9 +3518,9 @@ void syms_of_dbusbind (void);
3514extern char *emacs_root_dir (void); 3518extern char *emacs_root_dir (void);
3515#endif /* DOS_NT */ 3519#endif /* DOS_NT */
3516 3520
3517/* Nonzero means Emacs has already been initialized. 3521/* True means Emacs has already been initialized.
3518 Used during startup to detect startup of dumped Emacs. */ 3522 Used during startup to detect startup of dumped Emacs. */
3519extern int initialized; 3523extern bool initialized;
3520 3524
3521extern int immediate_quit; /* Nonzero means ^G can quit instantly */ 3525extern int immediate_quit; /* Nonzero means ^G can quit instantly */
3522 3526
diff --git a/src/msdos.c b/src/msdos.c
index a214456d104..ac348e94375 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1029,7 +1029,6 @@ IT_clear_end_of_line (struct frame *f, int first_unused)
1029{ 1029{
1030 char *spaces, *sp; 1030 char *spaces, *sp;
1031 int i, j, offset = 2 * (new_pos_X + screen_size_X * new_pos_Y); 1031 int i, j, offset = 2 * (new_pos_X + screen_size_X * new_pos_Y);
1032 extern int fatal_error_in_progress;
1033 struct tty_display_info *tty = FRAME_TTY (f); 1032 struct tty_display_info *tty = FRAME_TTY (f);
1034 1033
1035 if (new_pos_X >= first_unused || fatal_error_in_progress) 1034 if (new_pos_X >= first_unused || fatal_error_in_progress)
diff --git a/src/process.c b/src/process.c
index 81fa98a028d..04b6abe50a7 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5194,7 +5194,7 @@ read_process_output (Lisp_Object proc, register int channel)
5194 if (!NILP (outstream)) 5194 if (!NILP (outstream))
5195 { 5195 {
5196 Lisp_Object text; 5196 Lisp_Object text;
5197 int outer_running_asynch_code = running_asynch_code; 5197 bool outer_running_asynch_code = running_asynch_code;
5198 int waiting = waiting_for_user_input_p; 5198 int waiting = waiting_for_user_input_p;
5199 5199
5200 /* No need to gcpro these, because all we do with them later 5200 /* No need to gcpro these, because all we do with them later
@@ -6558,9 +6558,9 @@ static void
6558exec_sentinel (Lisp_Object proc, Lisp_Object reason) 6558exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6559{ 6559{
6560 Lisp_Object sentinel, odeactivate; 6560 Lisp_Object sentinel, odeactivate;
6561 register struct Lisp_Process *p = XPROCESS (proc); 6561 struct Lisp_Process *p = XPROCESS (proc);
6562 ptrdiff_t count = SPECPDL_INDEX (); 6562 ptrdiff_t count = SPECPDL_INDEX ();
6563 int outer_running_asynch_code = running_asynch_code; 6563 bool outer_running_asynch_code = running_asynch_code;
6564 int waiting = waiting_for_user_input_p; 6564 int waiting = waiting_for_user_input_p;
6565 6565
6566 if (inhibit_sentinels) 6566 if (inhibit_sentinels)
diff --git a/src/w32.c b/src/w32.c
index 84a46e522bb..fe612687f48 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6773,7 +6773,7 @@ shutdown_handler (DWORD type)
6773 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */ 6773 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */
6774 { 6774 {
6775 /* Shut down cleanly, making sure autosave files are up to date. */ 6775 /* Shut down cleanly, making sure autosave files are up to date. */
6776 shut_down_emacs (0, 0, Qnil); 6776 shut_down_emacs (0, Qnil);
6777 } 6777 }
6778 6778
6779 /* Allow other handlers to handle this signal. */ 6779 /* Allow other handlers to handle this signal. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 13b03736bde..86f041dea4d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -768,9 +768,9 @@ static int clear_image_cache_count;
768static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; 768static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 };
769#endif 769#endif
770 770
771/* Non-zero while redisplay_internal is in progress. */ 771/* True while redisplay_internal is in progress. */
772 772
773int redisplaying_p; 773bool redisplaying_p;
774 774
775static Lisp_Object Qinhibit_free_realized_faces; 775static Lisp_Object Qinhibit_free_realized_faces;
776static Lisp_Object Qmode_line_default_help_echo; 776static Lisp_Object Qmode_line_default_help_echo;
@@ -12966,12 +12966,11 @@ redisplay_internal (void)
12966 if (redisplaying_p) 12966 if (redisplaying_p)
12967 return; 12967 return;
12968 12968
12969 /* Record a function that resets redisplaying_p to its old value 12969 /* Record a function that clears redisplaying_p
12970 when we leave this function. */ 12970 when we leave this function. */
12971 count = SPECPDL_INDEX (); 12971 count = SPECPDL_INDEX ();
12972 record_unwind_protect (unwind_redisplay, 12972 record_unwind_protect (unwind_redisplay, selected_frame);
12973 Fcons (make_number (redisplaying_p), selected_frame)); 12973 redisplaying_p = 1;
12974 ++redisplaying_p;
12975 specbind (Qinhibit_free_realized_faces, Qnil); 12974 specbind (Qinhibit_free_realized_faces, Qnil);
12976 12975
12977 { 12976 {
@@ -13709,21 +13708,15 @@ redisplay_preserve_echo_area (int from_where)
13709} 13708}
13710 13709
13711 13710
13712/* Function registered with record_unwind_protect in 13711/* Function registered with record_unwind_protect in redisplay_internal.
13713 redisplay_internal. Reset redisplaying_p to the value it had 13712 Clear redisplaying_p. Also, select the previously
13714 before redisplay_internal was called, and clear
13715 prevent_freeing_realized_faces_p. It also selects the previously
13716 selected frame, unless it has been deleted (by an X connection 13713 selected frame, unless it has been deleted (by an X connection
13717 failure during redisplay, for example). */ 13714 failure during redisplay, for example). */
13718 13715
13719static Lisp_Object 13716static Lisp_Object
13720unwind_redisplay (Lisp_Object val) 13717unwind_redisplay (Lisp_Object old_frame)
13721{ 13718{
13722 Lisp_Object old_redisplaying_p, old_frame; 13719 redisplaying_p = 0;
13723
13724 old_redisplaying_p = XCAR (val);
13725 redisplaying_p = XFASTINT (old_redisplaying_p);
13726 old_frame = XCDR (val);
13727 if (! EQ (old_frame, selected_frame) 13720 if (! EQ (old_frame, selected_frame)
13728 && FRAME_LIVE_P (XFRAME (old_frame))) 13721 && FRAME_LIVE_P (XFRAME (old_frame)))
13729 select_frame_for_redisplay (old_frame); 13722 select_frame_for_redisplay (old_frame);
diff --git a/src/xterm.c b/src/xterm.c
index 052db0f3e63..f497b5322bf 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7843,7 +7843,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7843 (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once, 7843 (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once,
7844 the resulting Glib error message loop filled a user's disk. 7844 the resulting Glib error message loop filled a user's disk.
7845 To avoid this, kill Emacs unconditionally on disconnect. */ 7845 To avoid this, kill Emacs unconditionally on disconnect. */
7846 shut_down_emacs (0, 0, Qnil); 7846 shut_down_emacs (0, Qnil);
7847 fprintf (stderr, "%s\n\ 7847 fprintf (stderr, "%s\n\
7848When compiled with GTK, Emacs cannot recover from X disconnects.\n\ 7848When compiled with GTK, Emacs cannot recover from X disconnects.\n\
7849This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ 7849This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\