aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2012-09-16 20:47:45 +0900
committerKenichi Handa2012-09-16 20:47:45 +0900
commitba13e6168a07a085c0ca8e67c91640b84ee0c1fd (patch)
treea63038205a6803ba06f5e17eda974c3ab23e57fb /src
parentdcbd9236f7be9da4e658fd559dfbd7454f4b6018 (diff)
parenta8c729af93b08531e5e3f3fff6f16a55c8baac3f (diff)
downloademacs-ba13e6168a07a085c0ca8e67c91640b84ee0c1fd.tar.gz
emacs-ba13e6168a07a085c0ca8e67c91640b84ee0c1fd.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog72
-rw-r--r--src/alloc.c13
-rw-r--r--src/atimer.c2
-rw-r--r--src/bidi.c1
-rw-r--r--src/buffer.c1
-rw-r--r--src/bytecode.c2
-rw-r--r--src/callint.c1
-rw-r--r--src/callproc.c1
-rw-r--r--src/casefiddle.c2
-rw-r--r--src/casetab.c2
-rw-r--r--src/category.c1
-rw-r--r--src/ccl.c1
-rw-r--r--src/character.c1
-rw-r--r--src/charset.c1
-rw-r--r--src/chartab.c2
-rw-r--r--src/cm.c1
-rw-r--r--src/cmds.c2
-rw-r--r--src/coding.c1
-rw-r--r--src/composite.c1
-rw-r--r--src/data.c1
-rw-r--r--src/dbusbind.c2
-rw-r--r--src/dired.c1
-rw-r--r--src/dispnew.c1
-rw-r--r--src/doc.c1
-rw-r--r--src/doprnt.c1
-rw-r--r--src/dosfns.c2
-rw-r--r--src/editfns.c1
-rw-r--r--src/emacs.c1
-rw-r--r--src/emacsgtkfixed.c2
-rw-r--r--src/eval.c15
-rw-r--r--src/fileio.c1
-rw-r--r--src/filelock.c1
-rw-r--r--src/floatfns.c2
-rw-r--r--src/fns.c1
-rw-r--r--src/font.c1
-rw-r--r--src/fontset.c1
-rw-r--r--src/frame.c1
-rw-r--r--src/fringe.c1
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftxfont.c1
-rw-r--r--src/gnutls.c1
-rw-r--r--src/gtkutil.c1
-rw-r--r--src/image.c23
-rw-r--r--src/indent.c1
-rw-r--r--src/insdel.c1
-rw-r--r--src/intervals.c1
-rw-r--r--src/keyboard.c20
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h23
-rw-r--r--src/lread.c1
-rw-r--r--src/macros.c2
-rw-r--r--src/marker.c2
-rw-r--r--src/menu.c1
-rw-r--r--src/minibuf.c1
-rw-r--r--src/nsfns.m14
-rw-r--r--src/nsfont.m1
-rw-r--r--src/nsimage.m1
-rw-r--r--src/nsmenu.m1
-rw-r--r--src/nsselect.m1
-rw-r--r--src/nsterm.m56
-rw-r--r--src/print.c2
-rw-r--r--src/process.c9
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c1
-rw-r--r--src/region-cache.c1
-rw-r--r--src/scroll.c2
-rw-r--r--src/search.c2
-rw-r--r--src/sheap.c3
-rw-r--r--src/sound.c2
-rw-r--r--src/syntax.c2
-rw-r--r--src/sysdep.c1
-rw-r--r--src/term.c1
-rw-r--r--src/termcap.c1
-rw-r--r--src/terminal.c1
-rw-r--r--src/terminfo.c1
-rw-r--r--src/textprop.c2
-rw-r--r--src/tparam.c2
-rw-r--r--src/undo.c2
-rw-r--r--src/unexaix.c1
-rw-r--r--src/unexcoff.c1
-rw-r--r--src/unexcw.c1
-rw-r--r--src/unexsol.c1
-rw-r--r--src/vm-limit.c1
-rw-r--r--src/w16select.c1
-rw-r--r--src/w32.c1
-rw-r--r--src/w32console.c1
-rw-r--r--src/w32fns.c1
-rw-r--r--src/w32font.c1
-rw-r--r--src/w32heap.c1
-rw-r--r--src/w32inevt.c1
-rw-r--r--src/w32menu.c1
-rw-r--r--src/w32proc.c1
-rw-r--r--src/w32reg.c1
-rw-r--r--src/w32select.c1
-rw-r--r--src/w32term.c1
-rw-r--r--src/w32uniscribe.c1
-rw-r--r--src/w32xfns.c1
-rw-r--r--src/widget.c2
-rw-r--r--src/window.c9
-rw-r--r--src/xdisp.c1
-rw-r--r--src/xfaces.c1
-rw-r--r--src/xfns.c1
-rw-r--r--src/xfont.c1
-rw-r--r--src/xftfont.c1
-rw-r--r--src/xgselect.c2
-rw-r--r--src/xmenu.c1
-rw-r--r--src/xml.c1
-rw-r--r--src/xrdb.c1
-rw-r--r--src/xselect.c1
-rw-r--r--src/xsettings.c5
-rw-r--r--src/xsmfns.c1
-rw-r--r--src/xterm.c2
112 files changed, 200 insertions, 188 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 88e385c876b..cfcd2b0e2f1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,78 @@
12012-09-15 Kenichi Handa <handa@gnu.org> 12012-09-16 Kenichi Handa <handa@gnu.org>
2 2
3 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster 3 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4 here, but just check the validity of glyphs in the glyph-string. 4 here, but just check the validity of glyphs in the glyph-string.
5 5
62012-09-16 Martin Rudalics <rudalics@gmx.at>
7
8 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
9 any window as argument (Bug#12452).
10
112012-09-16 Jan Djärv <jan.h.d@swipnet.se>
12
13 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
14 to ns_term_init to avoid memory leak.
15
16 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
17 explicit retain/release.
18 (ns_term_init): Only allow one display. Initialize outerpool and
19 ns_*_types.
20
212012-09-15 Paul Eggert <eggert@cs.ucla.edu>
22
23 Port _setjmp fix to POSIXish hosts as well as Microsoft.
24 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
25 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
26 the Microsoft problem in a different way, by altering ../nt/config.nt.
27
282012-09-15 Eli Zaretskii <eliz@gnu.org>
29
30 * w32xfns.c:
31 * w32uniscribe.c:
32 * w32term.c:
33 * w32select.c:
34 * w32reg.c:
35 * w32proc.c:
36 * w32menu.c:
37 * w32inevt.c:
38 * w32heap.c:
39 * w32font.c:
40 * w32fns.c:
41 * w32console.c:
42 * w32.c:
43 * w16select.c: Remove inclusion of setjmp.h, as it is now included
44 by lisp.h. This completes removal of setjmp.h inclusion
45 erroneously announced in the previous commit. (Bug#12446)
46
47 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
48 more accurate.
49
50 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
51 not defined as a macro. The latter happens on MS-Windows.
52 (Bug#12446)
53
542012-09-15 Paul Eggert <eggert@cs.ucla.edu>
55
56 Port better to POSIX hosts lacking _setjmp (Bug#12446).
57 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
58 Some instances of '#include <setjmp.h>' removed, if the
59 only reason for the instance was because "lisp.h" was included.
60 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
61 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
62 and _longjmp with the new symbols. Emacs already uses _setjmp if
63 available, so this change affects only POSIXish hosts that have
64 sigsetjmp but not _setjmp, such as some versions of Solaris and
65 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
66 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
67 (png_load_body) [HAVE_PNG]:
68 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
69 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
70 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
71 since PNG requires jmp_buf. This is the only exception to the
72 general rule that we now use sys_setjmp and sys_longjmp.
73 This exception is OK since this code does not change the signal
74 mask or longjmp out of a signal handler.
75
62012-09-14 Paul Eggert <eggert@cs.ucla.edu> 762012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7 77
8 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: 78 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
diff --git a/src/alloc.c b/src/alloc.c
index 25cf03dfa2e..0bfbb0c88b1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -24,7 +24,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <limits.h> /* For CHAR_BIT. */ 26#include <limits.h> /* For CHAR_BIT. */
27#include <setjmp.h>
28 27
29#ifdef ENABLE_CHECKING 28#ifdef ENABLE_CHECKING
30#include <signal.h> /* For SIGABRT. */ 29#include <signal.h> /* For SIGABRT. */
@@ -45,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#include "frame.h" 44#include "frame.h"
46#include "blockinput.h" 45#include "blockinput.h"
47#include "termhooks.h" /* For struct terminal. */ 46#include "termhooks.h" /* For struct terminal. */
48#include <setjmp.h> 47
49#include <verify.h> 48#include <verify.h>
50 49
51/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. 50/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
@@ -4764,14 +4763,14 @@ test_setjmp (void)
4764{ 4763{
4765 char buf[10]; 4764 char buf[10];
4766 register int x; 4765 register int x;
4767 jmp_buf jbuf; 4766 sys_jmp_buf jbuf;
4768 4767
4769 /* Arrange for X to be put in a register. */ 4768 /* Arrange for X to be put in a register. */
4770 sprintf (buf, "1"); 4769 sprintf (buf, "1");
4771 x = strlen (buf); 4770 x = strlen (buf);
4772 x = 2 * x - 1; 4771 x = 2 * x - 1;
4773 4772
4774 _setjmp (jbuf); 4773 sys_setjmp (jbuf);
4775 if (longjmps_done == 1) 4774 if (longjmps_done == 1)
4776 { 4775 {
4777 /* Came here after the longjmp at the end of the function. 4776 /* Came here after the longjmp at the end of the function.
@@ -4796,7 +4795,7 @@ test_setjmp (void)
4796 ++longjmps_done; 4795 ++longjmps_done;
4797 x = 2; 4796 x = 2;
4798 if (longjmps_done == 1) 4797 if (longjmps_done == 1)
4799 _longjmp (jbuf, 1); 4798 sys_longjmp (jbuf, 1);
4800} 4799}
4801 4800
4802#endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ 4801#endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */
@@ -4902,7 +4901,7 @@ mark_stack (void)
4902 /* jmp_buf may not be aligned enough on darwin-ppc64 */ 4901 /* jmp_buf may not be aligned enough on darwin-ppc64 */
4903 union aligned_jmpbuf { 4902 union aligned_jmpbuf {
4904 Lisp_Object o; 4903 Lisp_Object o;
4905 jmp_buf j; 4904 sys_jmp_buf j;
4906 } j; 4905 } j;
4907 volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; 4906 volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base;
4908#endif 4907#endif
@@ -4938,7 +4937,7 @@ mark_stack (void)
4938 } 4937 }
4939#endif /* GC_SETJMP_WORKS */ 4938#endif /* GC_SETJMP_WORKS */
4940 4939
4941 _setjmp (j.j); 4940 sys_setjmp (j.j);
4942 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; 4941 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
4943#endif /* not GC_SAVE_REGISTERS_ON_STACK */ 4942#endif /* not GC_SAVE_REGISTERS_ON_STACK */
4944#endif /* not HAVE___BUILTIN_UNWIND_INIT */ 4943#endif /* not HAVE___BUILTIN_UNWIND_INIT */
diff --git a/src/atimer.c b/src/atimer.c
index 34731920af5..80b813fe4fe 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -18,7 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <stdio.h> 20#include <stdio.h>
21#include <setjmp.h> 21
22#include "lisp.h" 22#include "lisp.h"
23#include "syssignal.h" 23#include "syssignal.h"
24#include "systime.h" 24#include "systime.h"
diff --git a/src/bidi.c b/src/bidi.c
index 4186a46e19e..af0209565e2 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -56,7 +56,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
56 56
57#include <config.h> 57#include <config.h>
58#include <stdio.h> 58#include <stdio.h>
59#include <setjmp.h>
60 59
61#include "lisp.h" 60#include "lisp.h"
62#include "character.h" 61#include "character.h"
diff --git a/src/buffer.c b/src/buffer.c
index d512547d34e..b020edb9962 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <sys/param.h> 26#include <sys/param.h>
27#include <errno.h> 27#include <errno.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h>
30#include <unistd.h> 29#include <unistd.h>
31 30
32#include <verify.h> 31#include <verify.h>
diff --git a/src/bytecode.c b/src/bytecode.c
index 97730636d0e..b151078f60f 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -33,7 +33,7 @@ by Hallvard:
33 */ 33 */
34 34
35#include <config.h> 35#include <config.h>
36#include <setjmp.h> 36
37#include "lisp.h" 37#include "lisp.h"
38#include "character.h" 38#include "character.h"
39#include "buffer.h" 39#include "buffer.h"
diff --git a/src/callint.c b/src/callint.c
index b11545ddea2..c4c087e83d7 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h>
23 22
24#include "lisp.h" 23#include "lisp.h"
25#include "character.h" 24#include "character.h"
diff --git a/src/callproc.c b/src/callproc.c
index a92959a1559..9171337ee76 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22#include <errno.h> 22#include <errno.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25#include <sys/types.h> 24#include <sys/types.h>
26#include <unistd.h> 25#include <unistd.h>
27 26
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 1102054b153..e3654627576 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h" 24#include "character.h"
25#include "buffer.h" 25#include "buffer.h"
diff --git a/src/casetab.c b/src/casetab.c
index 3e22d0d0b77..a84bc9202d0 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h" 24#include "character.h"
25#include "buffer.h" 25#include "buffer.h"
diff --git a/src/category.c b/src/category.c
index 80dc6938d8b..01a6f54ad17 100644
--- a/src/category.c
+++ b/src/category.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32 32
33#define CATEGORY_INLINE EXTERN_INLINE 33#define CATEGORY_INLINE EXTERN_INLINE
34 34
35#include <setjmp.h>
36#include "lisp.h" 35#include "lisp.h"
37#include "character.h" 36#include "character.h"
38#include "buffer.h" 37#include "buffer.h"
diff --git a/src/ccl.c b/src/ccl.c
index dd37934451d..34cc1c98eea 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <config.h> 26#include <config.h>
27 27
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h>
30#include <limits.h> 29#include <limits.h>
31 30
32#include "lisp.h" 31#include "lisp.h"
diff --git a/src/character.c b/src/character.c
index 37963d1878c..def1ad090fd 100644
--- a/src/character.c
+++ b/src/character.c
@@ -36,7 +36,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36#ifdef emacs 36#ifdef emacs
37 37
38#include <sys/types.h> 38#include <sys/types.h>
39#include <setjmp.h>
40#include <intprops.h> 39#include <intprops.h>
41#include "lisp.h" 40#include "lisp.h"
42#include "character.h" 41#include "character.h"
diff --git a/src/charset.c b/src/charset.c
index 972a0598059..d8c38e5ea3b 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include <unistd.h> 32#include <unistd.h>
33#include <limits.h> 33#include <limits.h>
34#include <sys/types.h> 34#include <sys/types.h>
35#include <setjmp.h>
36#include <c-ctype.h> 35#include <c-ctype.h>
37#include "lisp.h" 36#include "lisp.h"
38#include "character.h" 37#include "character.h"
diff --git a/src/chartab.c b/src/chartab.c
index c14df0ebac6..e864514e336 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h" 24#include "character.h"
25#include "charset.h" 25#include "charset.h"
diff --git a/src/cm.c b/src/cm.c
index 4b17b92eebc..eda6430bafa 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <setjmp.h>
24 23
25#include "lisp.h" 24#include "lisp.h"
26#include "frame.h" 25#include "frame.h"
diff --git a/src/cmds.c b/src/cmds.c
index 90d3cd6dced..45f7df948ae 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" 23#include "lisp.h"
24#include "commands.h" 24#include "commands.h"
25#include "character.h" 25#include "character.h"
diff --git a/src/coding.c b/src/coding.c
index 94a2d9fea80..4b3d22f956c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -285,7 +285,6 @@ encode_coding_XXX (struct coding_system *coding)
285 285
286#include <config.h> 286#include <config.h>
287#include <stdio.h> 287#include <stdio.h>
288#include <setjmp.h>
289 288
290#include "lisp.h" 289#include "lisp.h"
291#include "character.h" 290#include "character.h"
diff --git a/src/composite.c b/src/composite.c
index eddabb66d33..ae46df0a573 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27#define COMPOSITE_INLINE EXTERN_INLINE 27#define COMPOSITE_INLINE EXTERN_INLINE
28 28
29#include <setjmp.h>
30#include "lisp.h" 29#include "lisp.h"
31#include "character.h" 30#include "character.h"
32#include "buffer.h" 31#include "buffer.h"
diff --git a/src/data.c b/src/data.c
index 5d7f036b70d..72d7c8ccf9a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <setjmp.h>
24 23
25#include <intprops.h> 24#include <intprops.h>
26 25
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 901820648cb..c2eefd605bb 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#ifdef HAVE_DBUS 21#ifdef HAVE_DBUS
22#include <stdio.h> 22#include <stdio.h>
23#include <dbus/dbus.h> 23#include <dbus/dbus.h>
24#include <setjmp.h> 24
25#include "lisp.h" 25#include "lisp.h"
26#include "frame.h" 26#include "frame.h"
27#include "termhooks.h" 27#include "termhooks.h"
diff --git a/src/dired.c b/src/dired.c
index 9af5f76821b..3aa27ecf920 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <stdio.h> 22#include <stdio.h>
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/stat.h> 24#include <sys/stat.h>
25#include <setjmp.h>
26 25
27#ifdef HAVE_PWD_H 26#ifdef HAVE_PWD_H
28#include <pwd.h> 27#include <pwd.h>
diff --git a/src/dispnew.c b/src/dispnew.c
index f6186e86048..5827316a7b7 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#define DISPEXTERN_INLINE EXTERN_INLINE 22#define DISPEXTERN_INLINE EXTERN_INLINE
23 23
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h>
26#include <unistd.h> 25#include <unistd.h>
27 26
28#include "lisp.h" 27#include "lisp.h"
diff --git a/src/doc.c b/src/doc.c
index 02a5b4b8143..d2d664df266 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/file.h> /* Must be after sys/types.h for USG*/ 24#include <sys/file.h> /* Must be after sys/types.h for USG*/
25#include <setjmp.h>
26#include <fcntl.h> 25#include <fcntl.h>
27#include <unistd.h> 26#include <unistd.h>
28 27
diff --git a/src/doprnt.c b/src/doprnt.c
index 3b7391f07d4..caa56d6ae88 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -102,7 +102,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
102 102
103#include <config.h> 103#include <config.h>
104#include <stdio.h> 104#include <stdio.h>
105#include <setjmp.h>
106#include <float.h> 105#include <float.h>
107#include <unistd.h> 106#include <unistd.h>
108#include <limits.h> 107#include <limits.h>
diff --git a/src/dosfns.c b/src/dosfns.c
index 21676f4b4f5..3c649f4d534 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -30,7 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include <dos.h> 30#include <dos.h>
31#undef gettime 31#undef gettime
32#undef settime 32#undef settime
33#include <setjmp.h> 33
34#include "lisp.h" 34#include "lisp.h"
35#include "character.h" 35#include "character.h"
36#include "buffer.h" 36#include "buffer.h"
diff --git a/src/editfns.c b/src/editfns.c
index 299cad07fd7..c6744648bc5 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22#include <sys/types.h> 22#include <sys/types.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25 24
26#ifdef HAVE_PWD_H 25#ifdef HAVE_PWD_H
27#include <pwd.h> 26#include <pwd.h>
diff --git a/src/emacs.c b/src/emacs.c
index e8150631311..1416bf76c43 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include <sys/types.h> 26#include <sys/types.h>
27#include <sys/file.h> 27#include <sys/file.h>
28#include <setjmp.h>
29#include <unistd.h> 28#include <unistd.h>
30 29
31#include "lisp.h" 30#include "lisp.h"
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index c0d29a640ed..d10185072cc 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include "emacsgtkfixed.h" 23#include "emacsgtkfixed.h"
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h> 25
26#include "lisp.h" 26#include "lisp.h"
27#include "frame.h" 27#include "frame.h"
28#include "xterm.h" 28#include "xterm.h"
diff --git a/src/eval.c b/src/eval.c
index 3c0c65e9366..6cca13a8fda 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20#include <config.h> 20#include <config.h>
21#include <limits.h> 21#include <limits.h>
22#include <setjmp.h>
23#include <stdio.h> 22#include <stdio.h>
24#include "lisp.h" 23#include "lisp.h"
25#include "blockinput.h" 24#include "blockinput.h"
@@ -1072,7 +1071,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object
1072 catchlist = &c; 1071 catchlist = &c;
1073 1072
1074 /* Call FUNC. */ 1073 /* Call FUNC. */
1075 if (! _setjmp (c.jmp)) 1074 if (! sys_setjmp (c.jmp))
1076 c.val = (*func) (arg); 1075 c.val = (*func) (arg);
1077 1076
1078 /* Throw works by a longjmp that comes right here. */ 1077 /* Throw works by a longjmp that comes right here. */
@@ -1140,7 +1139,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1140 backtrace_list = catch->backlist; 1139 backtrace_list = catch->backlist;
1141 lisp_eval_depth = catch->lisp_eval_depth; 1140 lisp_eval_depth = catch->lisp_eval_depth;
1142 1141
1143 _longjmp (catch->jmp, 1); 1142 sys_longjmp (catch->jmp, 1);
1144} 1143}
1145 1144
1146DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, 1145DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0,
@@ -1246,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
1246 c.interrupt_input_blocked = interrupt_input_blocked; 1245 c.interrupt_input_blocked = interrupt_input_blocked;
1247 c.gcpro = gcprolist; 1246 c.gcpro = gcprolist;
1248 c.byte_stack = byte_stack_list; 1247 c.byte_stack = byte_stack_list;
1249 if (_setjmp (c.jmp)) 1248 if (sys_setjmp (c.jmp))
1250 { 1249 {
1251 if (!NILP (h.var)) 1250 if (!NILP (h.var))
1252 specbind (h.var, c.val); 1251 specbind (h.var, c.val);
@@ -1301,7 +1300,7 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers,
1301 c.interrupt_input_blocked = interrupt_input_blocked; 1300 c.interrupt_input_blocked = interrupt_input_blocked;
1302 c.gcpro = gcprolist; 1301 c.gcpro = gcprolist;
1303 c.byte_stack = byte_stack_list; 1302 c.byte_stack = byte_stack_list;
1304 if (_setjmp (c.jmp)) 1303 if (sys_setjmp (c.jmp))
1305 { 1304 {
1306 return (*hfun) (c.val); 1305 return (*hfun) (c.val);
1307 } 1306 }
@@ -1339,7 +1338,7 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg,
1339 c.interrupt_input_blocked = interrupt_input_blocked; 1338 c.interrupt_input_blocked = interrupt_input_blocked;
1340 c.gcpro = gcprolist; 1339 c.gcpro = gcprolist;
1341 c.byte_stack = byte_stack_list; 1340 c.byte_stack = byte_stack_list;
1342 if (_setjmp (c.jmp)) 1341 if (sys_setjmp (c.jmp))
1343 { 1342 {
1344 return (*hfun) (c.val); 1343 return (*hfun) (c.val);
1345 } 1344 }
@@ -1381,7 +1380,7 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
1381 c.interrupt_input_blocked = interrupt_input_blocked; 1380 c.interrupt_input_blocked = interrupt_input_blocked;
1382 c.gcpro = gcprolist; 1381 c.gcpro = gcprolist;
1383 c.byte_stack = byte_stack_list; 1382 c.byte_stack = byte_stack_list;
1384 if (_setjmp (c.jmp)) 1383 if (sys_setjmp (c.jmp))
1385 { 1384 {
1386 return (*hfun) (c.val); 1385 return (*hfun) (c.val);
1387 } 1386 }
@@ -1425,7 +1424,7 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
1425 c.interrupt_input_blocked = interrupt_input_blocked; 1424 c.interrupt_input_blocked = interrupt_input_blocked;
1426 c.gcpro = gcprolist; 1425 c.gcpro = gcprolist;
1427 c.byte_stack = byte_stack_list; 1426 c.byte_stack = byte_stack_list;
1428 if (_setjmp (c.jmp)) 1427 if (sys_setjmp (c.jmp))
1429 { 1428 {
1430 return (*hfun) (c.val, nargs, args); 1429 return (*hfun) (c.val, nargs, args);
1431 } 1430 }
diff --git a/src/fileio.c b/src/fileio.c
index f0b3f0cc2fd..ca71af7ed95 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <stdio.h> 23#include <stdio.h>
24#include <sys/types.h> 24#include <sys/types.h>
25#include <sys/stat.h> 25#include <sys/stat.h>
26#include <setjmp.h>
27#include <unistd.h> 26#include <unistd.h>
28 27
29#ifdef HAVE_PWD_H 28#ifdef HAVE_PWD_H
diff --git a/src/filelock.c b/src/filelock.c
index 1f599c68912..17f3f253249 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <signal.h> 24#include <signal.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h>
27 26
28#ifdef HAVE_PWD_H 27#ifdef HAVE_PWD_H
29#include <pwd.h> 28#include <pwd.h>
diff --git a/src/floatfns.c b/src/floatfns.c
index 66d7ca4af2c..4fe209fcb61 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29 */ 29 */
30 30
31#include <config.h> 31#include <config.h>
32#include <setjmp.h> 32
33#include "lisp.h" 33#include "lisp.h"
34#include "syssignal.h" 34#include "syssignal.h"
35 35
diff --git a/src/fns.c b/src/fns.c
index 91dc6639150..42c4f817f29 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <unistd.h> 22#include <unistd.h>
23#include <time.h> 23#include <time.h>
24#include <setjmp.h>
25 24
26#include <intprops.h> 25#include <intprops.h>
27 26
diff --git a/src/font.c b/src/font.c
index ccbeb9956f4..32194d1bb02 100644
--- a/src/font.c
+++ b/src/font.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <config.h> 23#include <config.h>
24#include <float.h> 24#include <float.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h>
27 26
28#include <c-ctype.h> 27#include <c-ctype.h>
29 28
diff --git a/src/fontset.c b/src/fontset.c
index 2b955fe6b11..35d4bfb367e 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27#include <config.h> 27#include <config.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h>
30 29
31#include "lisp.h" 30#include "lisp.h"
32#include "blockinput.h" 31#include "blockinput.h"
diff --git a/src/frame.c b/src/frame.c
index d10969692ee..6930dac3ce8 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -24,7 +24,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <stdio.h> 24#include <stdio.h>
25#include <errno.h> 25#include <errno.h>
26#include <limits.h> 26#include <limits.h>
27#include <setjmp.h>
28 27
29#include <c-ctype.h> 28#include <c-ctype.h>
30 29
diff --git a/src/fringe.c b/src/fringe.c
index 0c2109a0f8e..6e6deeddb08 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -18,7 +18,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <stdio.h> 20#include <stdio.h>
21#include <setjmp.h>
22 21
23#include "lisp.h" 22#include "lisp.h"
24#include "frame.h" 23#include "frame.h"
diff --git a/src/ftfont.c b/src/ftfont.c
index a85773a9a21..f07ad6f33c7 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -21,8 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25
26#include <fontconfig/fontconfig.h> 24#include <fontconfig/fontconfig.h>
27#include <fontconfig/fcfreetype.h> 25#include <fontconfig/fcfreetype.h>
28 26
diff --git a/src/ftxfont.c b/src/ftxfont.c
index c705ede62c4..466250bd43f 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25#include <X11/Xlib.h> 24#include <X11/Xlib.h>
26 25
27#include "lisp.h" 26#include "lisp.h"
diff --git a/src/gnutls.c b/src/gnutls.c
index a2573f6bd99..1c4693aee32 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -18,7 +18,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <errno.h> 20#include <errno.h>
21#include <setjmp.h>
22 21
23#include "lisp.h" 22#include "lisp.h"
24#include "process.h" 23#include "process.h"
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 884574e1062..1eb4b2cabdf 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#ifdef USE_GTK 22#ifdef USE_GTK
23#include <float.h> 23#include <float.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h>
26 25
27#include <c-ctype.h> 26#include <c-ctype.h>
28 27
diff --git a/src/image.c b/src/image.c
index d4e54fb7dcd..8fc1c8637eb 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5514,6 +5514,15 @@ init_png_functions (Lisp_Object libraries)
5514 5514
5515#endif /* HAVE_NTGUI */ 5515#endif /* HAVE_NTGUI */
5516 5516
5517/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp.
5518 Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp
5519 substitute may munge the signal mask, but that should be OK here.
5520 MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in
5521 the system header setjmp.h; don't mess up that. */
5522#ifndef HAVE__SETJMP
5523# define _setjmp(j) setjmp (j)
5524# define _longjmp longjmp
5525#endif
5517 5526
5518#if (PNG_LIBPNG_VER < 10500) 5527#if (PNG_LIBPNG_VER < 10500)
5519#define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) 5528#define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1))
@@ -5593,7 +5602,7 @@ png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length)
5593 5602
5594struct png_load_context 5603struct png_load_context
5595{ 5604{
5596 /* These are members so that _longjmp doesn't munge local variables. */ 5605 /* These are members so that longjmp doesn't munge local variables. */
5597 png_struct *png_ptr; 5606 png_struct *png_ptr;
5598 png_info *info_ptr; 5607 png_info *info_ptr;
5599 png_info *end_info; 5608 png_info *end_info;
@@ -6129,9 +6138,9 @@ jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired)
6129struct my_jpeg_error_mgr 6138struct my_jpeg_error_mgr
6130{ 6139{
6131 struct jpeg_error_mgr pub; 6140 struct jpeg_error_mgr pub;
6132 jmp_buf setjmp_buffer; 6141 sys_jmp_buf setjmp_buffer;
6133 6142
6134 /* The remaining members are so that _longjmp doesn't munge local 6143 /* The remaining members are so that longjmp doesn't munge local
6135 variables. */ 6144 variables. */
6136 struct jpeg_decompress_struct cinfo; 6145 struct jpeg_decompress_struct cinfo;
6137 enum 6146 enum
@@ -6151,7 +6160,7 @@ my_error_exit (j_common_ptr cinfo)
6151{ 6160{
6152 struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; 6161 struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err;
6153 mgr->failure_code = MY_JPEG_ERROR_EXIT; 6162 mgr->failure_code = MY_JPEG_ERROR_EXIT;
6154 _longjmp (mgr->setjmp_buffer, 1); 6163 sys_longjmp (mgr->setjmp_buffer, 1);
6155} 6164}
6156 6165
6157 6166
@@ -6401,7 +6410,7 @@ jpeg_load_body (struct frame *f, struct image *img,
6401 error is detected. This function will perform a longjmp. */ 6410 error is detected. This function will perform a longjmp. */
6402 mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); 6411 mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub);
6403 mgr->pub.error_exit = my_error_exit; 6412 mgr->pub.error_exit = my_error_exit;
6404 if (_setjmp (mgr->setjmp_buffer)) 6413 if (sys_setjmp (mgr->setjmp_buffer))
6405 { 6414 {
6406 switch (mgr->failure_code) 6415 switch (mgr->failure_code)
6407 { 6416 {
@@ -6460,14 +6469,14 @@ jpeg_load_body (struct frame *f, struct image *img,
6460 if (!check_image_size (f, width, height)) 6469 if (!check_image_size (f, width, height))
6461 { 6470 {
6462 mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; 6471 mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE;
6463 _longjmp (mgr->setjmp_buffer, 1); 6472 sys_longjmp (mgr->setjmp_buffer, 1);
6464 } 6473 }
6465 6474
6466 /* Create X image and pixmap. */ 6475 /* Create X image and pixmap. */
6467 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) 6476 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
6468 { 6477 {
6469 mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; 6478 mgr->failure_code = MY_JPEG_CANNOT_CREATE_X;
6470 _longjmp (mgr->setjmp_buffer, 1); 6479 sys_longjmp (mgr->setjmp_buffer, 1);
6471 } 6480 }
6472 6481
6473 /* Allocate colors. When color quantization is used, 6482 /* Allocate colors. When color quantization is used,
diff --git a/src/indent.c b/src/indent.c
index c60315a7f6e..053643e6319 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20#include <config.h> 20#include <config.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <setjmp.h>
23 22
24#include "lisp.h" 23#include "lisp.h"
25#include "character.h" 24#include "character.h"
diff --git a/src/insdel.c b/src/insdel.c
index bfb2327a696..87010cd8251 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h>
23 22
24#include <intprops.h> 23#include <intprops.h>
25 24
diff --git a/src/intervals.c b/src/intervals.c
index e508f968963..5a47cacb2dd 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -41,7 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41 41
42#define INTERVALS_INLINE EXTERN_INLINE 42#define INTERVALS_INLINE EXTERN_INLINE
43 43
44#include <setjmp.h>
45#include <intprops.h> 44#include <intprops.h>
46#include "lisp.h" 45#include "lisp.h"
47#include "intervals.h" 46#include "intervals.h"
diff --git a/src/keyboard.c b/src/keyboard.c
index 45638bc412b..d164083fb86 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#define KEYBOARD_INLINE EXTERN_INLINE 22#define KEYBOARD_INLINE EXTERN_INLINE
23 23
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h> 25
26#include "lisp.h" 26#include "lisp.h"
27#include "termchar.h" 27#include "termchar.h"
28#include "termopts.h" 28#include "termopts.h"
@@ -145,7 +145,7 @@ static ptrdiff_t before_command_echo_length;
145 145
146/* For longjmp to where kbd input is being done. */ 146/* For longjmp to where kbd input is being done. */
147 147
148static jmp_buf getcjmp; 148static sys_jmp_buf getcjmp;
149 149
150/* True while doing kbd input. */ 150/* True while doing kbd input. */
151int waiting_for_input; 151int waiting_for_input;
@@ -434,8 +434,8 @@ static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object,
434 Lisp_Object *, ptrdiff_t); 434 Lisp_Object *, ptrdiff_t);
435static Lisp_Object make_lispy_switch_frame (Lisp_Object); 435static Lisp_Object make_lispy_switch_frame (Lisp_Object);
436static int help_char_p (Lisp_Object); 436static int help_char_p (Lisp_Object);
437static void save_getcjmp (jmp_buf); 437static void save_getcjmp (sys_jmp_buf);
438static void restore_getcjmp (jmp_buf); 438static void restore_getcjmp (sys_jmp_buf);
439static Lisp_Object apply_modifiers (int, Lisp_Object); 439static Lisp_Object apply_modifiers (int, Lisp_Object);
440static void clear_event (struct input_event *); 440static void clear_event (struct input_event *);
441static Lisp_Object restore_kboard_configuration (Lisp_Object); 441static Lisp_Object restore_kboard_configuration (Lisp_Object);
@@ -2315,8 +2315,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2315{ 2315{
2316 volatile Lisp_Object c; 2316 volatile Lisp_Object c;
2317 ptrdiff_t jmpcount; 2317 ptrdiff_t jmpcount;
2318 jmp_buf local_getcjmp; 2318 sys_jmp_buf local_getcjmp;
2319 jmp_buf save_jump; 2319 sys_jmp_buf save_jump;
2320 volatile int key_already_recorded = 0; 2320 volatile int key_already_recorded = 0;
2321 Lisp_Object tem, save; 2321 Lisp_Object tem, save;
2322 volatile Lisp_Object previous_echo_area_message; 2322 volatile Lisp_Object previous_echo_area_message;
@@ -2562,7 +2562,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2562 it *must not* be in effect when we call redisplay. */ 2562 it *must not* be in effect when we call redisplay. */
2563 2563
2564 jmpcount = SPECPDL_INDEX (); 2564 jmpcount = SPECPDL_INDEX ();
2565 if (_setjmp (local_getcjmp)) 2565 if (sys_setjmp (local_getcjmp))
2566 { 2566 {
2567 /* Handle quits while reading the keyboard. */ 2567 /* Handle quits while reading the keyboard. */
2568 /* We must have saved the outer value of getcjmp here, 2568 /* We must have saved the outer value of getcjmp here,
@@ -3394,13 +3394,13 @@ record_char (Lisp_Object c)
3394 See read_process_output. */ 3394 See read_process_output. */
3395 3395
3396static void 3396static void
3397save_getcjmp (jmp_buf temp) 3397save_getcjmp (sys_jmp_buf temp)
3398{ 3398{
3399 memcpy (temp, getcjmp, sizeof getcjmp); 3399 memcpy (temp, getcjmp, sizeof getcjmp);
3400} 3400}
3401 3401
3402static void 3402static void
3403restore_getcjmp (jmp_buf temp) 3403restore_getcjmp (sys_jmp_buf temp)
3404{ 3404{
3405 memcpy (getcjmp, temp, sizeof getcjmp); 3405 memcpy (getcjmp, temp, sizeof getcjmp);
3406} 3406}
@@ -10979,7 +10979,7 @@ quit_throw_to_read_char (int from_signal)
10979 do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), 10979 do_switch_frame (make_lispy_switch_frame (internal_last_event_frame),
10980 0, 0, Qnil); 10980 0, 0, Qnil);
10981 10981
10982 _longjmp (getcjmp, 1); 10982 sys_longjmp (getcjmp, 1);
10983} 10983}
10984 10984
10985DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, 10985DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,
diff --git a/src/keymap.c b/src/keymap.c
index d79ff89ed67..66fb52061f9 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -40,7 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
40 40
41#include <config.h> 41#include <config.h>
42#include <stdio.h> 42#include <stdio.h>
43#include <setjmp.h> 43
44#include "lisp.h" 44#include "lisp.h"
45#include "commands.h" 45#include "commands.h"
46#include "character.h" 46#include "character.h"
diff --git a/src/lisp.h b/src/lisp.h
index ca22ca81228..447c6bd296b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#ifndef EMACS_LISP_H 20#ifndef EMACS_LISP_H
21#define EMACS_LISP_H 21#define EMACS_LISP_H
22 22
23#include <setjmp.h>
23#include <stdalign.h> 24#include <stdalign.h>
24#include <stdarg.h> 25#include <stdarg.h>
25#include <stdbool.h> 26#include <stdbool.h>
@@ -1963,7 +1964,25 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1963 static struct Lisp_Kboard_Objfwd ko_fwd; \ 1964 static struct Lisp_Kboard_Objfwd ko_fwd; \
1964 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ 1965 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \
1965 } while (0) 1966 } while (0)
1966 1967
1968/* Save and restore the instruction and environment pointers,
1969 without affecting the signal mask. */
1970
1971#ifdef HAVE__SETJMP
1972typedef jmp_buf sys_jmp_buf;
1973# define sys_setjmp(j) _setjmp (j)
1974# define sys_longjmp(j, v) _longjmp (j, v)
1975#elif defined HAVE_SIGSETJMP
1976typedef sigjmp_buf sys_jmp_buf;
1977# define sys_setjmp(j) sigsetjmp (j, 0)
1978# define sys_longjmp(j, v) siglongjmp (j, v)
1979#else
1980/* A platform that uses neither _longjmp nor siglongjmp; assume
1981 longjmp does not affect the sigmask. */
1982typedef jmp_buf sys_jmp_buf;
1983# define sys_setjmp(j) setjmp (j)
1984# define sys_longjmp(j, v) longjmp (j, v)
1985#endif
1967 1986
1968 1987
1969/* Structure for recording Lisp call stack for backtrace purposes. */ 1988/* Structure for recording Lisp call stack for backtrace purposes. */
@@ -2056,7 +2075,7 @@ struct catchtag
2056 Lisp_Object volatile val; 2075 Lisp_Object volatile val;
2057 struct catchtag *volatile next; 2076 struct catchtag *volatile next;
2058 struct gcpro *gcpro; 2077 struct gcpro *gcpro;
2059 jmp_buf jmp; 2078 sys_jmp_buf jmp;
2060 struct backtrace *backlist; 2079 struct backtrace *backlist;
2061 struct handler *handlerlist; 2080 struct handler *handlerlist;
2062 EMACS_INT lisp_eval_depth; 2081 EMACS_INT lisp_eval_depth;
diff --git a/src/lread.c b/src/lread.c
index 08a2e856c00..08d5f97292b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <sys/file.h> 25#include <sys/file.h>
26#include <errno.h> 26#include <errno.h>
27#include <limits.h> /* For CHAR_BIT. */ 27#include <limits.h> /* For CHAR_BIT. */
28#include <setjmp.h>
29#include <stat-time.h> 28#include <stat-time.h>
30#include "lisp.h" 29#include "lisp.h"
31#include "intervals.h" 30#include "intervals.h"
diff --git a/src/macros.c b/src/macros.c
index e81068181b9..a507f12e343 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" 23#include "lisp.h"
24#include "macros.h" 24#include "macros.h"
25#include "commands.h" 25#include "commands.h"
diff --git a/src/marker.c b/src/marker.c
index bfbb161a71d..0c4e8cb3b55 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -18,7 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19 19
20#include <config.h> 20#include <config.h>
21#include <setjmp.h> 21
22#include "lisp.h" 22#include "lisp.h"
23#include "character.h" 23#include "character.h"
24#include "buffer.h" 24#include "buffer.h"
diff --git a/src/menu.c b/src/menu.c
index bfdc68ca118..7b01d1faefc 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <setjmp.h>
24#include <limits.h> /* for INT_MAX */ 23#include <limits.h> /* for INT_MAX */
25 24
26#include "lisp.h" 25#include "lisp.h"
diff --git a/src/minibuf.c b/src/minibuf.c
index 4ed480a8408..8a1e0ddde86 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22#include <errno.h> 22#include <errno.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25 24
26#include "lisp.h" 25#include "lisp.h"
27#include "commands.h" 26#include "commands.h"
diff --git a/src/nsfns.m b/src/nsfns.m
index f73086eeee9..072005d2d3d 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -31,7 +31,6 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
31#include <config.h> 31#include <config.h>
32 32
33#include <math.h> 33#include <math.h>
34#include <setjmp.h>
35#include <c-strcase.h> 34#include <c-strcase.h>
36 35
37#include "lisp.h" 36#include "lisp.h"
@@ -1797,19 +1796,6 @@ terminate Emacs if we can't open the connection.
1797 SSDATA (display)); 1796 SSDATA (display));
1798 } 1797 }
1799 1798
1800 /* Register our external input/output types, used for determining
1801 applicable services and also drag/drop eligibility. */
1802 ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
1803 ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
1804 retain];
1805 ns_drag_types = [[NSArray arrayWithObjects:
1806 NSStringPboardType,
1807 NSTabularTextPboardType,
1808 NSFilenamesPboardType,
1809 NSURLPboardType,
1810 NSColorPboardType,
1811 NSFontPboardType, nil] retain];
1812
1813 return Qnil; 1799 return Qnil;
1814} 1800}
1815 1801
diff --git a/src/nsfont.m b/src/nsfont.m
index 1c9976ec6cc..eba1eb04765 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -23,7 +23,6 @@ Author: Adrian Robert (arobert@cogsci.ucsd.edu)
23/* This should be the first include, as it may set up #defines affecting 23/* This should be the first include, as it may set up #defines affecting
24 interpretation of even the system includes. */ 24 interpretation of even the system includes. */
25#include <config.h> 25#include <config.h>
26#include <setjmp.h>
27 26
28#include "lisp.h" 27#include "lisp.h"
29#include "dispextern.h" 28#include "dispextern.h"
diff --git a/src/nsimage.m b/src/nsimage.m
index 8a8a3ddaae4..668664c7a20 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -28,7 +28,6 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
28/* This should be the first include, as it may set up #defines affecting 28/* This should be the first include, as it may set up #defines affecting
29 interpretation of even the system includes. */ 29 interpretation of even the system includes. */
30#include <config.h> 30#include <config.h>
31#include <setjmp.h>
32 31
33#include "lisp.h" 32#include "lisp.h"
34#include "dispextern.h" 33#include "dispextern.h"
diff --git a/src/nsmenu.m b/src/nsmenu.m
index d0f3e45e939..3057f4f6a20 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -24,7 +24,6 @@ Carbon version by Yamamoto Mitsuharu. */
24/* This should be the first include, as it may set up #defines affecting 24/* This should be the first include, as it may set up #defines affecting
25 interpretation of even the system includes. */ 25 interpretation of even the system includes. */
26#include <config.h> 26#include <config.h>
27#include <setjmp.h>
28 27
29#include "lisp.h" 28#include "lisp.h"
30#include "window.h" 29#include "window.h"
diff --git a/src/nsselect.m b/src/nsselect.m
index e0bbfe58636..95bc1a95957 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -28,7 +28,6 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
28/* This should be the first include, as it may set up #defines affecting 28/* This should be the first include, as it may set up #defines affecting
29 interpretation of even the system includes. */ 29 interpretation of even the system includes. */
30#include <config.h> 30#include <config.h>
31#include <setjmp.h>
32 31
33#include "lisp.h" 32#include "lisp.h"
34#include "nsterm.h" 33#include "nsterm.h"
diff --git a/src/nsterm.m b/src/nsterm.m
index f9611fd1210..41520ce74d1 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -35,7 +35,6 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
35#include <time.h> 35#include <time.h>
36#include <signal.h> 36#include <signal.h>
37#include <unistd.h> 37#include <unistd.h>
38#include <setjmp.h>
39 38
40#include <c-ctype.h> 39#include <c-ctype.h>
41#include <c-strcase.h> 40#include <c-strcase.h>
@@ -628,7 +627,7 @@ ns_update_begin (struct frame *f)
628{ 627{
629 NSView *view = FRAME_NS_VIEW (f); 628 NSView *view = FRAME_NS_VIEW (f);
630 NSRect r = [view frame]; 629 NSRect r = [view frame];
631 NSBezierPath *bp = [NSBezierPath bezierPath]; 630 NSBezierPath *bp;
632 NSTRACE (ns_update_begin); 631 NSTRACE (ns_update_begin);
633 632
634 ns_update_auto_hide_menu_bar (); 633 ns_update_auto_hide_menu_bar ();
@@ -640,8 +639,9 @@ ns_update_begin (struct frame *f)
640 is for the minibuffer. But the display engine may draw more because 639 is for the minibuffer. But the display engine may draw more because
641 we have set the frame as garbaged. So reset clip path to the whole 640 we have set the frame as garbaged. So reset clip path to the whole
642 view. */ 641 view. */
643 [bp appendBezierPathWithRect: r]; 642 bp = [[NSBezierPath bezierPathWithRect: r] retain];
644 [bp setClip]; 643 [bp setClip];
644 [bp release];
645 645
646#ifdef NS_IMPL_GNUSTEP 646#ifdef NS_IMPL_GNUSTEP
647 uRect = NSMakeRect (0, 0, 0, 0); 647 uRect = NSMakeRect (0, 0, 0, 0);
@@ -3977,33 +3977,35 @@ ns_term_init (Lisp_Object display_name)
3977 static int ns_initialized = 0; 3977 static int ns_initialized = 0;
3978 Lisp_Object tmp; 3978 Lisp_Object tmp;
3979 3979
3980 if (ns_initialized) return x_display_list;
3981 ns_initialized = 1;
3982
3980 NSTRACE (ns_term_init); 3983 NSTRACE (ns_term_init);
3981 3984
3985 [outerpool release];
3986 outerpool = [[NSAutoreleasePool alloc] init];
3987
3982 /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */ 3988 /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */
3983 /*GSDebugAllocationActive (YES); */ 3989 /*GSDebugAllocationActive (YES); */
3984 BLOCK_INPUT; 3990 BLOCK_INPUT;
3985 handling_signal = 0; 3991 handling_signal = 0;
3986 3992
3987 if (!ns_initialized) 3993 baud_rate = 38400;
3988 { 3994 Fset_input_interrupt_mode (Qnil);
3989 baud_rate = 38400;
3990 Fset_input_interrupt_mode (Qnil);
3991 3995
3992 if (selfds[0] == -1) 3996 if (selfds[0] == -1)
3997 {
3998 if (pipe (selfds) == -1)
3993 { 3999 {
3994 if (pipe (selfds) == -1) 4000 fprintf (stderr, "Failed to create pipe: %s\n",
3995 { 4001 emacs_strerror (errno));
3996 fprintf (stderr, "Failed to create pipe: %s\n", 4002 emacs_abort ();
3997 emacs_strerror (errno));
3998 emacs_abort ();
3999 }
4000
4001 fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL));
4002 FD_ZERO (&select_readfds);
4003 FD_ZERO (&select_writefds);
4004 pthread_mutex_init (&select_mutex, NULL);
4005 } 4003 }
4006 ns_initialized = 1; 4004
4005 fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL));
4006 FD_ZERO (&select_readfds);
4007 FD_ZERO (&select_writefds);
4008 pthread_mutex_init (&select_mutex, NULL);
4007 } 4009 }
4008 4010
4009 ns_pending_files = [[NSMutableArray alloc] init]; 4011 ns_pending_files = [[NSMutableArray alloc] init];
@@ -4194,6 +4196,20 @@ ns_term_init (Lisp_Object display_name)
4194 } 4196 }
4195#endif /* MAC OS X menu setup */ 4197#endif /* MAC OS X menu setup */
4196 4198
4199 /* Register our external input/output types, used for determining
4200 applicable services and also drag/drop eligibility. */
4201 ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
4202 ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
4203 retain];
4204 ns_drag_types = [[NSArray arrayWithObjects:
4205 NSStringPboardType,
4206 NSTabularTextPboardType,
4207 NSFilenamesPboardType,
4208 NSURLPboardType,
4209 NSColorPboardType,
4210 NSFontPboardType, nil] retain];
4211
4212
4197 [NSApp run]; 4213 [NSApp run];
4198 ns_do_open_file = YES; 4214 ns_do_open_file = YES;
4199 return dpyinfo; 4215 return dpyinfo;
diff --git a/src/print.c b/src/print.c
index 16116643ad0..aae13bb6764 100644
--- a/src/print.c
+++ b/src/print.c
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h> 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h" 26#include "character.h"
27#include "buffer.h" 27#include "buffer.h"
diff --git a/src/process.c b/src/process.c
index b4b05a4b2e2..6dbff6f4b16 100644
--- a/src/process.c
+++ b/src/process.c
@@ -25,12 +25,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include <stdio.h> 26#include <stdio.h>
27#include <errno.h> 27#include <errno.h>
28#include <setjmp.h>
29#include <sys/types.h> /* Some typedefs are used in sys/file.h. */ 28#include <sys/types.h> /* Some typedefs are used in sys/file.h. */
30#include <sys/file.h> 29#include <sys/file.h>
31#include <sys/stat.h> 30#include <sys/stat.h>
32#include <setjmp.h>
33
34#include <unistd.h> 31#include <unistd.h>
35#include <fcntl.h> 32#include <fcntl.h>
36 33
@@ -5421,7 +5418,7 @@ read_process_output (Lisp_Object proc, register int channel)
5421 5418
5422/* Sending data to subprocess */ 5419/* Sending data to subprocess */
5423 5420
5424static jmp_buf send_process_frame; 5421static sys_jmp_buf send_process_frame;
5425static Lisp_Object process_sent_to; 5422static Lisp_Object process_sent_to;
5426 5423
5427static _Noreturn void 5424static _Noreturn void
@@ -5431,7 +5428,7 @@ handle_pipe_signal (int sig)
5431 sigemptyset (&unblocked); 5428 sigemptyset (&unblocked);
5432 sigaddset (&unblocked, SIGPIPE); 5429 sigaddset (&unblocked, SIGPIPE);
5433 pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); 5430 pthread_sigmask (SIG_UNBLOCK, &unblocked, 0);
5434 _longjmp (send_process_frame, 1); 5431 sys_longjmp (send_process_frame, 1);
5435} 5432}
5436 5433
5437static void 5434static void
@@ -5640,7 +5637,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5640 /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, 5637 /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2,
5641 CFLAGS="-g -O": The value of the parameter `proc' is clobbered 5638 CFLAGS="-g -O": The value of the parameter `proc' is clobbered
5642 when returning with longjmp despite being declared volatile. */ 5639 when returning with longjmp despite being declared volatile. */
5643 if (!_setjmp (send_process_frame)) 5640 if (!sys_setjmp (send_process_frame))
5644 { 5641 {
5645 p = XPROCESS (proc); /* Repair any setjmp clobbering. */ 5642 p = XPROCESS (proc); /* Repair any setjmp clobbering. */
5646 process_sent_to = proc; 5643 process_sent_to = proc;
diff --git a/src/ralloc.c b/src/ralloc.c
index 74834333aa3..b0134ea730a 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -25,7 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#ifdef emacs 25#ifdef emacs
26 26
27#include <config.h> 27#include <config.h>
28#include <setjmp.h> 28
29#include "lisp.h" /* Needed for VALBITS. */ 29#include "lisp.h" /* Needed for VALBITS. */
30#include "blockinput.h" 30#include "blockinput.h"
31 31
diff --git a/src/regex.c b/src/regex.c
index 472ef727979..92264ccae23 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -126,7 +126,6 @@
126 that make sense only in Emacs. */ 126 that make sense only in Emacs. */
127#ifdef emacs 127#ifdef emacs
128 128
129# include <setjmp.h>
130# include "lisp.h" 129# include "lisp.h"
131# include "character.h" 130# include "character.h"
132# include "buffer.h" 131# include "buffer.h"
diff --git a/src/region-cache.c b/src/region-cache.c
index c3eb087aade..832f4bfd214 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25 24
26#include "lisp.h" 25#include "lisp.h"
27#include "character.h" 26#include "character.h"
diff --git a/src/scroll.c b/src/scroll.c
index 79dd464b29e..71ce43b2e48 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h> 24
25#include "lisp.h" 25#include "lisp.h"
26#include "termchar.h" 26#include "termchar.h"
27#include "dispextern.h" 27#include "dispextern.h"
diff --git a/src/search.c b/src/search.c
index 72bd5605709..99fd7971e4c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -20,7 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21 21
22#include <config.h> 22#include <config.h>
23#include <setjmp.h> 23
24#include "lisp.h" 24#include "lisp.h"
25#include "syntax.h" 25#include "syntax.h"
26#include "category.h" 26#include "category.h"
diff --git a/src/sheap.c b/src/sheap.c
index 3ae14b5daec..f6022ea3ce7 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -20,7 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <setjmp.h> 23
24#include "lisp.h" 24#include "lisp.h"
25 25
26#include <unistd.h> 26#include <unistd.h>
@@ -93,4 +93,3 @@ report_sheap_usage (int die_if_pure_storage_exceeded)
93 bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); 93 bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE);
94 message ("%s", buf); 94 message ("%s", buf);
95} 95}
96
diff --git a/src/sound.c b/src/sound.c
index fe48bb277b2..0ee85312fd3 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -44,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include <unistd.h> 44#include <unistd.h>
45#include <sys/types.h> 45#include <sys/types.h>
46#include <errno.h> 46#include <errno.h>
47#include <setjmp.h> 47
48#include "lisp.h" 48#include "lisp.h"
49#include "dispextern.h" 49#include "dispextern.h"
50#include "atimer.h" 50#include "atimer.h"
diff --git a/src/syntax.c b/src/syntax.c
index fdd9353bb87..91ef4e66663 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <setjmp.h> 24
25#include "lisp.h" 25#include "lisp.h"
26#include "commands.h" 26#include "commands.h"
27#include "character.h" 27#include "character.h"
diff --git a/src/sysdep.c b/src/sysdep.c
index b8f35e79146..9065b38d6fc 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 23
24#include <execinfo.h> 24#include <execinfo.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h>
27#ifdef HAVE_PWD_H 26#ifdef HAVE_PWD_H
28#include <pwd.h> 27#include <pwd.h>
29#include <grp.h> 28#include <grp.h>
diff --git a/src/term.c b/src/term.c
index 47bde5ac240..f4117d67dec 100644
--- a/src/term.c
+++ b/src/term.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <sys/file.h> 25#include <sys/file.h>
26#include <sys/time.h> 26#include <sys/time.h>
27#include <unistd.h> 27#include <unistd.h>
28#include <setjmp.h>
29 28
30#include "lisp.h" 29#include "lisp.h"
31#include "termchar.h" 30#include "termchar.h"
diff --git a/src/termcap.c b/src/termcap.c
index d1b05e8df94..e494cd113d9 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -19,7 +19,6 @@ Boston, MA 02110-1301, USA. */
19 19
20/* Emacs config.h may rename various library functions such as malloc. */ 20/* Emacs config.h may rename various library functions such as malloc. */
21#include <config.h> 21#include <config.h>
22#include <setjmp.h>
23#include <sys/file.h> 22#include <sys/file.h>
24#include <fcntl.h> 23#include <fcntl.h>
25#include <unistd.h> 24#include <unistd.h>
diff --git a/src/terminal.c b/src/terminal.c
index c51a18dfa61..719c2a36111 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#define TERMHOOKS_INLINE EXTERN_INLINE 21#define TERMHOOKS_INLINE EXTERN_INLINE
22 22
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25 24
26#include "lisp.h" 25#include "lisp.h"
27#include "frame.h" 26#include "frame.h"
diff --git a/src/terminfo.c b/src/terminfo.c
index ca2d89a000b..124c452a4a9 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#include <config.h> 19#include <config.h>
20#include "tparam.h" 20#include "tparam.h"
21 21
22#include <setjmp.h>
23#include "lisp.h" 22#include "lisp.h"
24 23
25/* Define these variables that serve as global parameters to termcap, 24/* Define these variables that serve as global parameters to termcap,
diff --git a/src/textprop.c b/src/textprop.c
index 2a9efba1c45..872912ea706 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <setjmp.h> 20
21#include "lisp.h" 21#include "lisp.h"
22#include "intervals.h" 22#include "intervals.h"
23#include "character.h" 23#include "character.h"
diff --git a/src/tparam.c b/src/tparam.c
index 58a825c90d7..164f61d471b 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */
19 19
20/* Emacs config.h may rename various library functions such as malloc. */ 20/* Emacs config.h may rename various library functions such as malloc. */
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22
23#include "lisp.h" /* for xmalloc */ 23#include "lisp.h" /* for xmalloc */
24#include "tparam.h" 24#include "tparam.h"
25 25
diff --git a/src/undo.c b/src/undo.c
index 9cd1d5f9f67..e878ef4dcf9 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -18,7 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19 19
20#include <config.h> 20#include <config.h>
21#include <setjmp.h> 21
22#include "lisp.h" 22#include "lisp.h"
23#include "character.h" 23#include "character.h"
24#include "buffer.h" 24#include "buffer.h"
diff --git a/src/unexaix.c b/src/unexaix.c
index c09156296f7..c01a22a79f6 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -89,7 +89,6 @@ static int adjust_lnnoptrs (int, int, const char *);
89 89
90static int pagemask; 90static int pagemask;
91 91
92#include <setjmp.h>
93#include "lisp.h" 92#include "lisp.h"
94 93
95static void 94static void
diff --git a/src/unexcoff.c b/src/unexcoff.c
index e83042a379d..966dd58cb6e 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -120,7 +120,6 @@ static int pagemask;
120 120
121#define ADDR_CORRECT(x) ((char *)(x) - (char*)0) 121#define ADDR_CORRECT(x) ((char *)(x) - (char*)0)
122 122
123#include <setjmp.h>
124#include "lisp.h" 123#include "lisp.h"
125 124
126static void 125static void
diff --git a/src/unexcw.c b/src/unexcw.c
index eae534cf4dd..96c4b4a9aec 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22#include "unexec.h" 22#include "unexec.h"
23 23
24#include <setjmp.h>
25#include <lisp.h> 24#include <lisp.h>
26#include <stdio.h> 25#include <stdio.h>
27#include <fcntl.h> 26#include <fcntl.h>
diff --git a/src/unexsol.c b/src/unexsol.c
index 336f3b4faea..470206d5838 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -4,7 +4,6 @@
4#include "unexec.h" 4#include "unexec.h"
5 5
6#include <dlfcn.h> 6#include <dlfcn.h>
7#include <setjmp.h>
8 7
9#include "lisp.h" 8#include "lisp.h"
10#include "character.h" 9#include "character.h"
diff --git a/src/vm-limit.c b/src/vm-limit.c
index cf697b56fdf..8de0acd1bb2 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <setjmp.h>
21#include <unistd.h> /* for 'environ', on AIX */ 20#include <unistd.h> /* for 'environ', on AIX */
22#include "lisp.h" 21#include "lisp.h"
23#include "mem-limits.h" 22#include "mem-limits.h"
diff --git a/src/w16select.c b/src/w16select.c
index 2026de7421d..a3f6f1fb9ae 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -31,7 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include <dpmi.h> 31#include <dpmi.h>
32#include <go32.h> 32#include <go32.h>
33#include <sys/farptr.h> 33#include <sys/farptr.h>
34#include <setjmp.h>
35#include "lisp.h" 34#include "lisp.h"
36#include "dispextern.h" /* frame.h seems to want this */ 35#include "dispextern.h" /* frame.h seems to want this */
37#include "frame.h" /* Need this to get the X window of selected_frame */ 36#include "frame.h" /* Need this to get the X window of selected_frame */
diff --git a/src/w32.c b/src/w32.c
index 04f7471577c..bcb0511e2fa 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include <sys/utime.h> 33#include <sys/utime.h>
34#include <mbstring.h> /* for _mbspbrk */ 34#include <mbstring.h> /* for _mbspbrk */
35#include <math.h> 35#include <math.h>
36#include <setjmp.h>
37#include <time.h> 36#include <time.h>
38 37
39/* must include CRT headers *before* config.h */ 38/* must include CRT headers *before* config.h */
diff --git a/src/w32console.c b/src/w32console.c
index 76585851e7f..b22b09af2f2 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27#include <stdio.h> 27#include <stdio.h>
28#include <windows.h> 28#include <windows.h>
29#include <setjmp.h>
30 29
31#include "lisp.h" 30#include "lisp.h"
32#include "character.h" 31#include "character.h"
diff --git a/src/w32fns.c b/src/w32fns.c
index ec1acbd89d9..be008bb18c8 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <limits.h> 26#include <limits.h>
27#include <errno.h> 27#include <errno.h>
28#include <math.h> 28#include <math.h>
29#include <setjmp.h>
30 29
31#include "lisp.h" 30#include "lisp.h"
32#include "w32term.h" 31#include "w32term.h"
diff --git a/src/w32font.c b/src/w32font.c
index 8b3a0e4312e..833b7cdfb25 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <math.h> 21#include <math.h>
22#include <ctype.h> 22#include <ctype.h>
23#include <commdlg.h> 23#include <commdlg.h>
24#include <setjmp.h>
25 24
26#include "lisp.h" 25#include "lisp.h"
27#include "w32term.h" 26#include "w32term.h"
diff --git a/src/w32heap.c b/src/w32heap.c
index 26cc9aa0a0f..dc65198f90b 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h>
26 25
27#include "w32heap.h" 26#include "w32heap.h"
28#include "lisp.h" /* for VALMASK */ 27#include "lisp.h" /* for VALMASK */
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 731dd6715dc..ee07db5335b 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <config.h> 25#include <config.h>
26#include <stdio.h> 26#include <stdio.h>
27#include <windows.h> 27#include <windows.h>
28#include <setjmp.h>
29 28
30#ifndef MOUSE_MOVED 29#ifndef MOUSE_MOVED
31#define MOUSE_MOVED 1 30#define MOUSE_MOVED 1
diff --git a/src/w32menu.c b/src/w32menu.c
index d4de73a0de7..fa7db64f147 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <signal.h> 22#include <signal.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <mbstring.h> 24#include <mbstring.h>
25#include <setjmp.h>
26 25
27#include "lisp.h" 26#include "lisp.h"
28#include "keyboard.h" 27#include "keyboard.h"
diff --git a/src/w32proc.c b/src/w32proc.c
index 74427e76a4f..26a0925ad87 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -28,7 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <fcntl.h> 28#include <fcntl.h>
29#include <signal.h> 29#include <signal.h>
30#include <sys/file.h> 30#include <sys/file.h>
31#include <setjmp.h>
32 31
33/* must include CRT headers *before* config.h */ 32/* must include CRT headers *before* config.h */
34#include <config.h> 33#include <config.h>
diff --git a/src/w32reg.c b/src/w32reg.c
index 9c727ae5ab7..8a6a3c853b1 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19/* Written by Kevin Gallo */ 19/* Written by Kevin Gallo */
20 20
21#include <config.h> 21#include <config.h>
22#include <setjmp.h>
23#include "lisp.h" 22#include "lisp.h"
24#include "w32term.h" 23#include "w32term.h"
25#include "blockinput.h" 24#include "blockinput.h"
diff --git a/src/w32select.c b/src/w32select.c
index 3fb88d4f17f..11c68c9c617 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -73,7 +73,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
73 */ 73 */
74 74
75#include <config.h> 75#include <config.h>
76#include <setjmp.h>
77#include "lisp.h" 76#include "lisp.h"
78#include "w32term.h" /* for all of the w32 includes */ 77#include "w32term.h" /* for all of the w32 includes */
79#include "w32heap.h" /* os_subtype */ 78#include "w32heap.h" /* os_subtype */
diff --git a/src/w32term.c b/src/w32term.c
index 28c1c593cf6..69a16e1852b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21#include <signal.h> 21#include <signal.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <setjmp.h>
24#include "lisp.h" 23#include "lisp.h"
25#include "blockinput.h" 24#include "blockinput.h"
26#include "w32term.h" 25#include "w32term.h"
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index cf99d14dc77..5d160b9d42f 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -27,7 +27,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27#define _WIN32_WINNT 0x500 27#define _WIN32_WINNT 0x500
28#include <windows.h> 28#include <windows.h>
29#include <usp10.h> 29#include <usp10.h>
30#include <setjmp.h>
31 30
32#include "lisp.h" 31#include "lisp.h"
33#include "w32term.h" 32#include "w32term.h"
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 820dbcc76c6..33f40fc7c01 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#include <config.h> 19#include <config.h>
20#include <signal.h> 20#include <signal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <setjmp.h>
23#include "lisp.h" 22#include "lisp.h"
24#include "keyboard.h" 23#include "keyboard.h"
25#include "frame.h" 24#include "frame.h"
diff --git a/src/widget.c b/src/widget.c
index 0100acc8143..fd5ad167125 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -30,7 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31#include <config.h> 31#include <config.h>
32#include <stdio.h> 32#include <stdio.h>
33#include <setjmp.h> 33
34#include "lisp.h" 34#include "lisp.h"
35#include "xterm.h" 35#include "xterm.h"
36 36
diff --git a/src/window.c b/src/window.c
index 18a550782e8..fbccab8b358 100644
--- a/src/window.c
+++ b/src/window.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#define WINDOW_INLINE EXTERN_INLINE 23#define WINDOW_INLINE EXTERN_INLINE
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h>
27 26
28#include "lisp.h" 27#include "lisp.h"
29#include "character.h" 28#include "character.h"
@@ -1856,23 +1855,23 @@ return value is a list of elements of the form (PARAMETER . VALUE). */)
1856DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, 1855DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
1857 2, 2, 0, 1856 2, 2, 0,
1858 doc: /* Return WINDOW's value for PARAMETER. 1857 doc: /* Return WINDOW's value for PARAMETER.
1859WINDOW must be a valid window and defaults to the selected one. */) 1858WINDOW can be any window and defaults to the selected one. */)
1860 (Lisp_Object window, Lisp_Object parameter) 1859 (Lisp_Object window, Lisp_Object parameter)
1861{ 1860{
1862 Lisp_Object result; 1861 Lisp_Object result;
1863 1862
1864 result = Fassq (parameter, decode_valid_window (window)->window_parameters); 1863 result = Fassq (parameter, decode_any_window (window)->window_parameters);
1865 return CDR_SAFE (result); 1864 return CDR_SAFE (result);
1866} 1865}
1867 1866
1868DEFUN ("set-window-parameter", Fset_window_parameter, 1867DEFUN ("set-window-parameter", Fset_window_parameter,
1869 Sset_window_parameter, 3, 3, 0, 1868 Sset_window_parameter, 3, 3, 0,
1870 doc: /* Set WINDOW's value of PARAMETER to VALUE. 1869 doc: /* Set WINDOW's value of PARAMETER to VALUE.
1871WINDOW must be a valid window and defaults to the selected one. 1870WINDOW can be any window and defaults to the selected one.
1872Return VALUE. */) 1871Return VALUE. */)
1873 (Lisp_Object window, Lisp_Object parameter, Lisp_Object value) 1872 (Lisp_Object window, Lisp_Object parameter, Lisp_Object value)
1874{ 1873{
1875 register struct window *w = decode_valid_window (window); 1874 register struct window *w = decode_any_window (window);
1876 Lisp_Object old_alist_elt; 1875 Lisp_Object old_alist_elt;
1877 1876
1878 old_alist_elt = Fassq (parameter, w->window_parameters); 1877 old_alist_elt = Fassq (parameter, w->window_parameters);
diff --git a/src/xdisp.c b/src/xdisp.c
index 320998a5713..8e0975cf65a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -273,7 +273,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
273#include <config.h> 273#include <config.h>
274#include <stdio.h> 274#include <stdio.h>
275#include <limits.h> 275#include <limits.h>
276#include <setjmp.h>
277 276
278#include "lisp.h" 277#include "lisp.h"
279#include "keyboard.h" 278#include "keyboard.h"
diff --git a/src/xfaces.c b/src/xfaces.c
index c113c1a37b7..c240a05c6c0 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -204,7 +204,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
204#include <sys/types.h> 204#include <sys/types.h>
205#include <sys/stat.h> 205#include <sys/stat.h>
206#include <stdio.h> /* This needs to be before termchar.h */ 206#include <stdio.h> /* This needs to be before termchar.h */
207#include <setjmp.h>
208 207
209#include "lisp.h" 208#include "lisp.h"
210#include "character.h" 209#include "character.h"
diff --git a/src/xfns.c b/src/xfns.c
index 90b54d12345..8304a3df04f 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <math.h> 22#include <math.h>
23#include <setjmp.h>
24#include <unistd.h> 23#include <unistd.h>
25 24
26/* This makes the fields of a Display accessible, in Xlib header files. */ 25/* This makes the fields of a Display accessible, in Xlib header files. */
diff --git a/src/xfont.c b/src/xfont.c
index 7755b780815..1f2fd13f1b7 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25#include <X11/Xlib.h> 24#include <X11/Xlib.h>
26 25
27#include "lisp.h" 26#include "lisp.h"
diff --git a/src/xftfont.c b/src/xftfont.c
index 404b9124099..9f52eb8b233 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <setjmp.h>
25#include <X11/Xlib.h> 24#include <X11/Xlib.h>
26#include <X11/Xft/Xft.h> 25#include <X11/Xft/Xft.h>
27 26
diff --git a/src/xgselect.c b/src/xgselect.c
index 5f4c7edfb79..c161564a322 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -19,14 +19,12 @@ along with GNU Emacs. If not, see <http§://www.gnu.org/licenses/>. */
19 19
20#include <config.h> 20#include <config.h>
21 21
22#include <setjmp.h>
23#include "xgselect.h" 22#include "xgselect.h"
24 23
25#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) 24#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
26 25
27#include <glib.h> 26#include <glib.h>
28#include <errno.h> 27#include <errno.h>
29#include <setjmp.h>
30#include "xterm.h" 28#include "xterm.h"
31 29
32int 30int
diff --git a/src/xmenu.c b/src/xmenu.c
index 605db13e149..d03a4bc974b 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include <config.h> 33#include <config.h>
34 34
35#include <stdio.h> 35#include <stdio.h>
36#include <setjmp.h>
37 36
38#include "lisp.h" 37#include "lisp.h"
39#include "keyboard.h" 38#include "keyboard.h"
diff --git a/src/xml.c b/src/xml.c
index 7bc6130b8b1..b668525cf26 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#ifdef HAVE_LIBXML2 21#ifdef HAVE_LIBXML2
22 22
23#include <setjmp.h>
24#include <libxml/tree.h> 23#include <libxml/tree.h>
25#include <libxml/parser.h> 24#include <libxml/parser.h>
26#include <libxml/HTMLparser.h> 25#include <libxml/HTMLparser.h>
diff --git a/src/xrdb.c b/src/xrdb.c
index 624bafa5e92..73672c9617c 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <epaths.h> 26#include <epaths.h>
27 27
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h>
30 29
31#include "lisp.h" 30#include "lisp.h"
32 31
diff --git a/src/xselect.c b/src/xselect.c
index 5a3b7452c6d..ab199e0b9b9 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <config.h> 22#include <config.h>
23#include <limits.h> 23#include <limits.h>
24#include <stdio.h> /* termhooks.h needs this */ 24#include <stdio.h> /* termhooks.h needs this */
25#include <setjmp.h>
26 25
27#ifdef HAVE_SYS_TYPES_H 26#ifdef HAVE_SYS_TYPES_H
28#include <sys/types.h> 27#include <sys/types.h>
diff --git a/src/xsettings.c b/src/xsettings.c
index a28d75d9422..58c84495489 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <float.h> 22#include <float.h>
23#include <limits.h> 23#include <limits.h>
24#include <setjmp.h>
25#include <fcntl.h> 24#include <fcntl.h>
26#include "lisp.h" 25#include "lisp.h"
27#include "xterm.h" 26#include "xterm.h"
@@ -711,12 +710,12 @@ apply_xft_settings (struct x_display_info *dpyinfo,
711 if (send_event_p) 710 if (send_event_p)
712 store_config_changed_event (Qfont_render, 711 store_config_changed_event (Qfont_render,
713 XCAR (dpyinfo->name_list_element)); 712 XCAR (dpyinfo->name_list_element));
714 Vxft_settings 713 Vxft_settings
715 = make_formatted_string (buf, format, 714 = make_formatted_string (buf, format,
716 oldsettings.aa, oldsettings.hinting, 715 oldsettings.aa, oldsettings.hinting,
717 oldsettings.rgba, oldsettings.lcdfilter, 716 oldsettings.rgba, oldsettings.lcdfilter,
718 oldsettings.hintstyle, oldsettings.dpi); 717 oldsettings.hintstyle, oldsettings.dpi);
719 718
720 } 719 }
721 else 720 else
722 FcPatternDestroy (pat); 721 FcPatternDestroy (pat);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index cddbb2aae86..8067899f931 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -29,7 +29,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#include <unistd.h> 29#include <unistd.h>
30#include <sys/param.h> 30#include <sys/param.h>
31#include <stdio.h> 31#include <stdio.h>
32#include <setjmp.h>
33 32
34#include "lisp.h" 33#include "lisp.h"
35#include "systime.h" 34#include "systime.h"
diff --git a/src/xterm.c b/src/xterm.c
index 54d4f14bdd0..900a1d78b80 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <setjmp.h>
26 25
27#ifdef HAVE_X_WINDOWS 26#ifdef HAVE_X_WINDOWS
28 27
@@ -47,7 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47 46
48#include <fcntl.h> 47#include <fcntl.h>
49#include <errno.h> 48#include <errno.h>
50#include <setjmp.h>
51#include <sys/stat.h> 49#include <sys/stat.h>
52/* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ 50/* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */
53/* #include <sys/param.h> */ 51/* #include <sys/param.h> */