aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-10-20 18:27:05 -0700
committerPaul Eggert2015-10-20 18:35:53 -0700
commit63cfb75f3a9d0f658e099ae18779e305a7e49fee (patch)
tree85f353c8b62fa50a922b1381c3068841e35970b7
parente9af822ac3ddf9644aa4a68e56b0580e133449b2 (diff)
downloademacs-63cfb75f3a9d0f658e099ae18779e305a7e49fee.tar.gz
emacs-63cfb75f3a9d0f658e099ae18779e305a7e49fee.zip
Include-file cleanup for src directory
Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707). In a few cases, add ‘#include "foo.h"’ if the file needs foo.h but does not include it directly. As a general rule, a source file should include foo.h if it needs the interfaces that foo.h defines. * src/alloc.c: Don’t include process.h. Include dispextern.h, systime.h. * src/atimer.c: Don’t include blockinput.h. * src/buffer.c: Include coding.h, systime.h. Don’t include keyboard.h, coding.h. * src/callint.c: Don’t include commands.h, keymap.h. * src/callproc.c: Don’t include character.h, ccl.h, composite.h, systty.h, termhooks.h. * src/casetab.c: Don’t include character.h. * src/category.c: Don’t include charset.h, keymap.h. * src/ccl.h: Don’t include character.h. * src/character.c: Don’t include charset.h. * src/charset.c: Don’t include disptab.h. * src/chartab.c: Don’t include ccl.h. * src/cm.c: Don’t include frame.h, termhooks.h. * src/cmds.c: Don’t include window.h, dispextern.h. * src/coding.c: Don’t include window.h, frame.h. * src/composite.c: Include composite.h. Don’t include window.h, font.h. * src/data.c: Don’t include syssignal.h, termhooks.h, font.h. * src/dbusbind.c: Don’t include frame.h. * src/decompress.c: Don’t include character.h. * src/dired.c: Don’t include character.h, commands.h, charset.h. * src/dispnew.c: Don’t include character.h, indent.h, intervals.h, process.h, timespec.h. Include systime.h. * src/doc.c: Include coding.h. Don’t include keyboard.h. * src/editfns.c: Include composite.h. Don’t include frame.h. * src/emacs.c: Include fcntl.h, coding.h. Don’t include commands.h, systty.h.. * src/fileio.c: Don’t include intervals.h, dispextern.h. Include composite.h. * src/filelock.c: Don’t include character.h, systime.h. * src/fns.c: Don’t include time.h, commands.h, keyboard.h, keymap.h, frame.h, blockinput.h, xterm.h. Include composite.h. * src/font.c: Include termhooks.h. * src/font.h: Don’t include ccl.h, frame.h. Add forward decls of struct composition_it, struct face, struct glyph_string. * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h, intervals.h, window.h, termhooks.h. * src/frame.c: Don’t include character.h, commands.h, font.h. * src/frame.h: Don’t include dispextern.h. * src/fringe.c: Don’t include character.h. * src/ftcrfont.c: Don’t include dispextern.h, frame.h, character.h, charset.h, fontset.h. * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h, fontset.h. * src/ftxfont.c: Don’t include dispextern.h, character.h, charset.h, fontset.h. * src/gfilenotify.c: Don’t include frame.h, process.h. * src/gtkutil.c: Include dispextern.h, frame.h, systime.h. Don’t include syssignal.h, buffer.h, charset.h, font.h. * src/gtkutil.h: Don’t include frame.h. * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h. Don’t include character.h. * src/indent.c: Don’t include keyboard.h, termchar.h. * src/inotify.c: Don’t include character.h, frame.h. * src/insdel.c: Include composite.h. Don’t include blockinput.h. * src/intervals.c: Don’t include character.h, keyboard.h. * src/intervals.h: Don’t include dispextern.h, composite.h. * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h. Include coding.h. * src/keyboard.h: Don’t incldue systime.h. * src/keymap.c: Don’t include charset.h, frame.h. * src/lread.c: Include dispextern.h and systime.h. Don’t include frame.h. Include systime.h. * src/macros.c: Don’t include commands.h, character.h, buffer.h. * src/menu.c: Include character.h, coding.h. Don’t include dispextern.h. * src/menu.h: Don’t include systime.h. * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h, intervals.h, termhooks.h. * src/print.c: Include coding.h. Don’t include keyboard.h, window.h, dispextern.h, termchar.h, termhooks.h, font.h. Add forward decl of struct terminal. * src/process.c: Don’t include termhooks.h, commands.h, dispextern.h, composite.h. * src/region-cache.c: Don’t include character.h. * src/scroll.c: Don’t include keyboard.h, window.h. * src/search.c: Don’t include category.h, commands.h. * src/sound.c: Don’t include dispextern.h. * src/syntax.c: Don’t include command.h, keymap.h. * src/sysdep.c: Don’t include window.h, dispextern.h. * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’, * src/term.c: Don’t include systty.h, intervals.h, xterm.h. * src/terminal.c: Include character.h. Don’t include charset.h, coding.h. * src/textprop.c: Don’t include character.h. * src/undo.c: Don’t include character.h, commands.h, window.h. * src/unexsol.c: Don’t include character.h, charset.h. * src/widget.c: Include widget.h. Don’t include keyboard.h, window.h, dispextern.h, blockinput.h, character.h, font.h. * src/widgetprv.h: Don’t include widget.h. * src/window.c: Don’t include character.h, menu.h, intervals.h. * src/xdisp.c: Include composite.h, systime.h. Don’t include macros.h, process.h. * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h, intervals.h. * src/xfns.c: Don’t include menu.h, character.h, intervals.h, epaths.h, fontset.h, systime.h, atimer.h, termchar.h. * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h. * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h. * src/xgselect.c: Don’t include timespec.h, frame.h. Include systime.h. * src/xgselect.h: Don’t include time.h. Use a forward decl to struct timespec instead. * src/xmenu.c: Don’t include keymap.h, character.h, charset.h, dispextern.h. Include systime.h. * src/xml.c: Don’t include character.h. * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h. * src/xselect.c: Don’t include dispextern.h, character.h, buffer.h, process.h. * src/xsmfns.c: Don’t include systime.h, sysselect.h. * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h, intervals.h process.h, keymap.h, xgselect.h. Include composite.h.
-rw-r--r--src/alloc.c3
-rw-r--r--src/atimer.c1
-rw-r--r--src/buffer.c5
-rw-r--r--src/callint.c2
-rw-r--r--src/callproc.c5
-rw-r--r--src/casetab.c1
-rw-r--r--src/category.c2
-rw-r--r--src/ccl.h2
-rw-r--r--src/character.c1
-rw-r--r--src/charset.c1
-rw-r--r--src/chartab.c1
-rw-r--r--src/cm.c2
-rw-r--r--src/cmds.c2
-rw-r--r--src/coding.c2
-rw-r--r--src/composite.c3
-rw-r--r--src/data.c3
-rw-r--r--src/dbusbind.c1
-rw-r--r--src/decompress.c1
-rw-r--r--src/dired.c3
-rw-r--r--src/dispnew.c7
-rw-r--r--src/doc.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c4
-rw-r--r--src/fileio.c3
-rw-r--r--src/filelock.c2
-rw-r--r--src/fns.c11
-rw-r--r--src/font.c1
-rw-r--r--src/font.h5
-rw-r--r--src/fontset.c6
-rw-r--r--src/frame.c3
-rw-r--r--src/frame.h5
-rw-r--r--src/fringe.c1
-rw-r--r--src/ftcrfont.c5
-rw-r--r--src/ftfont.c4
-rw-r--r--src/ftxfont.c4
-rw-r--r--src/gfilenotify.c2
-rw-r--r--src/gtkutil.c8
-rw-r--r--src/gtkutil.h1
-rw-r--r--src/image.c5
-rw-r--r--src/indent.c2
-rw-r--r--src/inotify.c2
-rw-r--r--src/insdel.c2
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h4
-rw-r--r--src/keyboard.c4
-rw-r--r--src/keyboard.h1
-rw-r--r--src/keymap.c2
-rw-r--r--src/lread.c3
-rw-r--r--src/macros.c3
-rw-r--r--src/menu.c3
-rw-r--r--src/menu.h1
-rw-r--r--src/minibuf.c5
-rw-r--r--src/print.c9
-rw-r--r--src/process.c4
-rw-r--r--src/region-cache.c1
-rw-r--r--src/scroll.c2
-rw-r--r--src/search.c2
-rw-r--r--src/sound.c1
-rw-r--r--src/syntax.c3
-rw-r--r--src/sysdep.c4
-rw-r--r--src/systime.h4
-rw-r--r--src/term.c6
-rw-r--r--src/terminal.c3
-rw-r--r--src/textprop.c1
-rw-r--r--src/undo.c3
-rw-r--r--src/unexsol.c2
-rw-r--r--src/widget.c12
-rw-r--r--src/widgetprv.h1
-rw-r--r--src/window.c3
-rw-r--r--src/xdisp.c4
-rw-r--r--src/xfaces.c4
-rw-r--r--src/xfns.c8
-rw-r--r--src/xfont.c3
-rw-r--r--src/xftfont.c3
-rw-r--r--src/xgselect.c3
-rw-r--r--src/xgselect.h3
-rw-r--r--src/xmenu.c6
-rw-r--r--src/xml.c1
-rw-r--r--src/xrdb.c5
-rw-r--r--src/xselect.c4
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c11
82 files changed, 44 insertions, 230 deletions
diff --git a/src/alloc.c b/src/alloc.c
index f08a35074c7..7c33687ccdf 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -32,9 +32,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#endif 32#endif
33 33
34#include "lisp.h" 34#include "lisp.h"
35#include "process.h" 35#include "dispextern.h"
36#include "intervals.h" 36#include "intervals.h"
37#include "puresize.h" 37#include "puresize.h"
38#include "systime.h"
38#include "character.h" 39#include "character.h"
39#include "buffer.h" 40#include "buffer.h"
40#include "window.h" 41#include "window.h"
diff --git a/src/atimer.c b/src/atimer.c
index 8a1a48be641..976b990f5ff 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include "lisp.h" 22#include "lisp.h"
23#include "syssignal.h" 23#include "syssignal.h"
24#include "systime.h" 24#include "systime.h"
25#include "blockinput.h"
26#include "atimer.h" 25#include "atimer.h"
27#include <unistd.h> 26#include <unistd.h>
28 27
diff --git a/src/buffer.c b/src/buffer.c
index 38ee74d2341..380a7af33c1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -30,7 +30,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include <verify.h> 30#include <verify.h>
31 31
32#include "lisp.h" 32#include "lisp.h"
33#include "coding.h"
33#include "intervals.h" 34#include "intervals.h"
35#include "systime.h"
34#include "window.h" 36#include "window.h"
35#include "commands.h" 37#include "commands.h"
36#include "character.h" 38#include "character.h"
@@ -38,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "region-cache.h" 40#include "region-cache.h"
39#include "indent.h" 41#include "indent.h"
40#include "blockinput.h" 42#include "blockinput.h"
41#include "keyboard.h"
42#include "keymap.h" 43#include "keymap.h"
43#include "frame.h" 44#include "frame.h"
44 45
@@ -4573,8 +4574,6 @@ evaporate_overlays (ptrdiff_t pos)
4573#include <fcntl.h> 4574#include <fcntl.h>
4574#endif 4575#endif
4575 4576
4576#include "coding.h"
4577
4578 4577
4579/* Memory is allocated in regions which are mapped using mmap(2). 4578/* Memory is allocated in regions which are mapped using mmap(2).
4580 The current implementation lets the system select mapped 4579 The current implementation lets the system select mapped
diff --git a/src/callint.c b/src/callint.c
index 12d116db28b..76ee13e533e 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -23,10 +23,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h" 24#include "character.h"
25#include "buffer.h" 25#include "buffer.h"
26#include "commands.h"
27#include "keyboard.h" 26#include "keyboard.h"
28#include "window.h" 27#include "window.h"
29#include "keymap.h"
30 28
31static Lisp_Object preserved_fns; 29static Lisp_Object preserved_fns;
32 30
diff --git a/src/callproc.c b/src/callproc.c
index e38844e2da6..eafd6217c0f 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -44,19 +44,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#endif /* MSDOS */ 44#endif /* MSDOS */
45 45
46#include "commands.h" 46#include "commands.h"
47#include "character.h"
48#include "buffer.h" 47#include "buffer.h"
49#include "ccl.h"
50#include "coding.h" 48#include "coding.h"
51#include "composite.h"
52#include <epaths.h> 49#include <epaths.h>
53#include "process.h" 50#include "process.h"
54#include "syssignal.h" 51#include "syssignal.h"
55#include "systty.h"
56#include "syswait.h" 52#include "syswait.h"
57#include "blockinput.h" 53#include "blockinput.h"
58#include "frame.h" 54#include "frame.h"
59#include "termhooks.h"
60 55
61#ifdef MSDOS 56#ifdef MSDOS
62#include "msdos.h" 57#include "msdos.h"
diff --git a/src/casetab.c b/src/casetab.c
index b086abc0125..28da8850ec5 100644
--- a/src/casetab.c
+++ b/src/casetab.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 22
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h"
25#include "buffer.h" 24#include "buffer.h"
26 25
27Lisp_Object Vascii_downcase_table; 26Lisp_Object Vascii_downcase_table;
diff --git a/src/category.c b/src/category.c
index 400116f6e03..5c7cf0795d3 100644
--- a/src/category.c
+++ b/src/category.c
@@ -33,9 +33,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include "lisp.h" 33#include "lisp.h"
34#include "character.h" 34#include "character.h"
35#include "buffer.h" 35#include "buffer.h"
36#include "charset.h"
37#include "category.h" 36#include "category.h"
38#include "keymap.h"
39 37
40/* This setter is used only in this file, so it can be private. */ 38/* This setter is used only in this file, so it can be private. */
41static void 39static void
diff --git a/src/ccl.h b/src/ccl.h
index 7b72dc74104..fdce437e6cd 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -26,8 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#ifndef EMACS_CCL_H 26#ifndef EMACS_CCL_H
27#define EMACS_CCL_H 27#define EMACS_CCL_H
28 28
29#include "character.h" /* For MAX_MULTIBYTE_LENGTH */
30
31/* Macros for exit status of CCL program. */ 29/* Macros for exit status of CCL program. */
32#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */ 30#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */
33#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */ 31#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */
diff --git a/src/character.c b/src/character.c
index f51d97125e0..3e2bf1e70c2 100644
--- a/src/character.c
+++ b/src/character.c
@@ -38,7 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "lisp.h" 38#include "lisp.h"
39#include "character.h" 39#include "character.h"
40#include "buffer.h" 40#include "buffer.h"
41#include "charset.h"
42#include "composite.h" 41#include "composite.h"
43#include "disptab.h" 42#include "disptab.h"
44 43
diff --git a/src/charset.c b/src/charset.c
index eeebf172bdf..04e81bb0ff5 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -38,7 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "character.h" 38#include "character.h"
39#include "charset.h" 39#include "charset.h"
40#include "coding.h" 40#include "coding.h"
41#include "disptab.h"
42#include "buffer.h" 41#include "buffer.h"
43 42
44/*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) *** 43/*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) ***
diff --git a/src/chartab.c b/src/chartab.c
index 274bb60727c..ec618f3496e 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h" 24#include "character.h"
25#include "charset.h" 25#include "charset.h"
26#include "ccl.h"
27 26
28/* 64/16/32/128 */ 27/* 64/16/32/128 */
29 28
diff --git a/src/cm.c b/src/cm.c
index 474f280af3f..f0aa56d6c2a 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -22,9 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <stdio.h> 22#include <stdio.h>
23 23
24#include "lisp.h" 24#include "lisp.h"
25#include "frame.h"
26#include "cm.h" 25#include "cm.h"
27#include "termhooks.h"
28#include "termchar.h" 26#include "termchar.h"
29#include "tparam.h" 27#include "tparam.h"
30 28
diff --git a/src/cmds.c b/src/cmds.c
index 39c5af99f5d..0afc023e681 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -25,10 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include "character.h" 25#include "character.h"
26#include "buffer.h" 26#include "buffer.h"
27#include "syntax.h" 27#include "syntax.h"
28#include "window.h"
29#include "keyboard.h" 28#include "keyboard.h"
30#include "keymap.h" 29#include "keymap.h"
31#include "dispextern.h"
32#include "frame.h" 30#include "frame.h"
33 31
34static int internal_self_insert (int, EMACS_INT); 32static int internal_self_insert (int, EMACS_INT);
diff --git a/src/coding.c b/src/coding.c
index c5099a7b0b9..0b42a36543c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -297,8 +297,6 @@ encode_coding_XXX (struct coding_system *coding)
297#include "ccl.h" 297#include "ccl.h"
298#include "composite.h" 298#include "composite.h"
299#include "coding.h" 299#include "coding.h"
300#include "window.h"
301#include "frame.h"
302#include "termhooks.h" 300#include "termhooks.h"
303 301
304Lisp_Object Vcoding_system_hash_table; 302Lisp_Object Vcoding_system_hash_table;
diff --git a/src/composite.c b/src/composite.c
index 88cef222d3a..0f729bc5460 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -26,13 +26,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "character.h" 28#include "character.h"
29#include "composite.h"
29#include "buffer.h" 30#include "buffer.h"
30#include "coding.h" 31#include "coding.h"
31#include "intervals.h" 32#include "intervals.h"
32#include "window.h"
33#include "frame.h" 33#include "frame.h"
34#include "dispextern.h" 34#include "dispextern.h"
35#include "font.h"
36#include "termhooks.h" 35#include "termhooks.h"
37 36
38 37
diff --git a/src/data.c b/src/data.c
index 33fe2855c99..5382b01066e 100644
--- a/src/data.c
+++ b/src/data.c
@@ -32,9 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include "buffer.h" 32#include "buffer.h"
33#include "keyboard.h" 33#include "keyboard.h"
34#include "frame.h" 34#include "frame.h"
35#include "syssignal.h"
36#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
37#include "font.h"
38#include "keymap.h" 35#include "keymap.h"
39 36
40static void swap_in_symval_forwarding (struct Lisp_Symbol *, 37static void swap_in_symval_forwarding (struct Lisp_Symbol *,
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 181c7d016fd..ce0465dcb8b 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <dbus/dbus.h> 23#include <dbus/dbus.h>
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "frame.h"
27#include "termhooks.h" 26#include "termhooks.h"
28#include "keyboard.h" 27#include "keyboard.h"
29#include "process.h" 28#include "process.h"
diff --git a/src/decompress.c b/src/decompress.c
index 460d4fe7670..d0c0018eb26 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <zlib.h> 23#include <zlib.h>
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h"
27#include "buffer.h" 26#include "buffer.h"
28 27
29#include <verify.h> 28#include <verify.h>
diff --git a/src/dired.c b/src/dired.c
index 3486e49b566..84bf2472262 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -39,10 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39 39
40#include "lisp.h" 40#include "lisp.h"
41#include "systime.h" 41#include "systime.h"
42#include "character.h"
43#include "buffer.h" 42#include "buffer.h"
44#include "commands.h"
45#include "charset.h"
46#include "coding.h" 43#include "coding.h"
47#include "regex.h" 44#include "regex.h"
48#include "blockinput.h" 45#include "blockinput.h"
diff --git a/src/dispnew.c b/src/dispnew.c
index 00d086e4161..18eed3cfb14 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -28,7 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28/* cm.h must come after dispextern.h on Windows. */ 28/* cm.h must come after dispextern.h on Windows. */
29#include "dispextern.h" 29#include "dispextern.h"
30#include "cm.h" 30#include "cm.h"
31#include "character.h"
32#include "buffer.h" 31#include "buffer.h"
33#include "keyboard.h" 32#include "keyboard.h"
34#include "frame.h" 33#include "frame.h"
@@ -36,12 +35,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36#include "window.h" 35#include "window.h"
37#include "commands.h" 36#include "commands.h"
38#include "disptab.h" 37#include "disptab.h"
39#include "indent.h"
40#include "intervals.h"
41#include "blockinput.h" 38#include "blockinput.h"
42#include "process.h"
43
44#include "syssignal.h" 39#include "syssignal.h"
40#include "systime.h"
45#include "tparam.h" 41#include "tparam.h"
46 42
47#ifdef HAVE_WINDOW_SYSTEM 43#ifdef HAVE_WINDOW_SYSTEM
@@ -51,7 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
51#include <errno.h> 47#include <errno.h>
52 48
53#include <fpending.h> 49#include <fpending.h>
54#include <timespec.h>
55 50
56#ifdef WINDOWSNT 51#ifdef WINDOWSNT
57#include "w32.h" 52#include "w32.h"
diff --git a/src/doc.c b/src/doc.c
index 68d4367182d..694c159fc09 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -31,9 +31,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31 31
32#include "lisp.h" 32#include "lisp.h"
33#include "character.h" 33#include "character.h"
34#include "coding.h"
34#include "buffer.h" 35#include "buffer.h"
35#include "disptab.h" 36#include "disptab.h"
36#include "keyboard.h"
37#include "keymap.h" 37#include "keymap.h"
38 38
39/* Buffer used for reading from documentation file. */ 39/* Buffer used for reading from documentation file. */
diff --git a/src/editfns.c b/src/editfns.c
index 12e5ca8c001..050eb2ac6ec 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -52,11 +52,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
52#include <strftime.h> 52#include <strftime.h>
53#include <verify.h> 53#include <verify.h>
54 54
55#include "composite.h"
55#include "intervals.h" 56#include "intervals.h"
56#include "character.h" 57#include "character.h"
57#include "buffer.h" 58#include "buffer.h"
58#include "coding.h" 59#include "coding.h"
59#include "frame.h"
60#include "window.h" 60#include "window.h"
61#include "blockinput.h" 61#include "blockinput.h"
62 62
diff --git a/src/emacs.c b/src/emacs.c
index 3eff5a720ea..b4052b851d7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <config.h> 22#include <config.h>
23 23
24#include <errno.h> 24#include <errno.h>
25#include <fcntl.h>
25#include <stdio.h> 26#include <stdio.h>
26 27
27#include <sys/types.h> 28#include <sys/types.h>
@@ -59,13 +60,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59#include TERM_HEADER 60#include TERM_HEADER
60#endif /* HAVE_WINDOW_SYSTEM */ 61#endif /* HAVE_WINDOW_SYSTEM */
61 62
62#include "commands.h" 63#include "coding.h"
63#include "intervals.h" 64#include "intervals.h"
64#include "character.h" 65#include "character.h"
65#include "buffer.h" 66#include "buffer.h"
66#include "window.h" 67#include "window.h"
67 68
68#include "systty.h"
69#include "atimer.h" 69#include "atimer.h"
70#include "blockinput.h" 70#include "blockinput.h"
71#include "syssignal.h" 71#include "syssignal.h"
diff --git a/src/fileio.c b/src/fileio.c
index 3155ef0edf1..428093bdc4b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -43,7 +43,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
43#include <c-ctype.h> 43#include <c-ctype.h>
44 44
45#include "lisp.h" 45#include "lisp.h"
46#include "intervals.h" 46#include "composite.h"
47#include "character.h" 47#include "character.h"
48#include "buffer.h" 48#include "buffer.h"
49#include "coding.h" 49#include "coding.h"
@@ -51,7 +51,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
51#include "blockinput.h" 51#include "blockinput.h"
52#include "region-cache.h" 52#include "region-cache.h"
53#include "frame.h" 53#include "frame.h"
54#include "dispextern.h"
55 54
56#ifdef WINDOWSNT 55#ifdef WINDOWSNT
57#define NOMINMAX 1 56#define NOMINMAX 1
diff --git a/src/filelock.c b/src/filelock.c
index cad6f83c1d0..7f9b6e7f8e8 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -45,10 +45,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#include <c-ctype.h> 45#include <c-ctype.h>
46 46
47#include "lisp.h" 47#include "lisp.h"
48#include "character.h"
49#include "buffer.h" 48#include "buffer.h"
50#include "coding.h" 49#include "coding.h"
51#include "systime.h"
52#ifdef WINDOWSNT 50#ifdef WINDOWSNT
53#include <share.h> 51#include <share.h>
54#include <sys/socket.h> /* for fcntl */ 52#include <sys/socket.h> /* for fcntl */
diff --git a/src/fns.c b/src/fns.c
index dfd48a297a6..f545066fb07 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -21,25 +21,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <config.h> 21#include <config.h>
22 22
23#include <unistd.h> 23#include <unistd.h>
24#include <time.h>
25
26#include <intprops.h> 24#include <intprops.h>
27#include <vla.h> 25#include <vla.h>
28 26
29#include "lisp.h" 27#include "lisp.h"
30#include "commands.h"
31#include "character.h" 28#include "character.h"
32#include "coding.h" 29#include "coding.h"
30#include "composite.h"
33#include "buffer.h" 31#include "buffer.h"
34#include "keyboard.h"
35#include "keymap.h"
36#include "intervals.h" 32#include "intervals.h"
37#include "frame.h"
38#include "window.h" 33#include "window.h"
39#include "blockinput.h"
40#if defined (HAVE_X_WINDOWS)
41#include "xterm.h"
42#endif
43 34
44static void sort_vector_copy (Lisp_Object, ptrdiff_t, 35static void sort_vector_copy (Lisp_Object, ptrdiff_t,
45 Lisp_Object [restrict], Lisp_Object [restrict]); 36 Lisp_Object [restrict], Lisp_Object [restrict]);
diff --git a/src/font.c b/src/font.c
index be55ce9bc7b..016b7e0a88e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -36,6 +36,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36#include "composite.h" 36#include "composite.h"
37#include "fontset.h" 37#include "fontset.h"
38#include "font.h" 38#include "font.h"
39#include "termhooks.h"
39 40
40#ifdef HAVE_WINDOW_SYSTEM 41#ifdef HAVE_WINDOW_SYSTEM
41#include TERM_HEADER 42#include TERM_HEADER
diff --git a/src/font.h b/src/font.h
index 43e67e98c06..1d13e1cb6b0 100644
--- a/src/font.h
+++ b/src/font.h
@@ -22,8 +22,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#ifndef EMACS_FONT_H 22#ifndef EMACS_FONT_H
23#define EMACS_FONT_H 23#define EMACS_FONT_H
24 24
25#include "ccl.h" 25struct composition_it;
26#include "frame.h" 26struct face;
27struct glyph_string;
27 28
28INLINE_HEADER_BEGIN 29INLINE_HEADER_BEGIN
29 30
diff --git a/src/fontset.c b/src/fontset.c
index e735989bcbf..9429d79b6b9 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -30,19 +30,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include "lisp.h" 30#include "lisp.h"
31#include "blockinput.h" 31#include "blockinput.h"
32#include "character.h" 32#include "character.h"
33#include "buffer.h"
34#include "charset.h" 33#include "charset.h"
35#include "ccl.h"
36#include "keyboard.h"
37#include "frame.h" 34#include "frame.h"
38#include "dispextern.h" 35#include "dispextern.h"
39#include "intervals.h"
40#include "fontset.h" 36#include "fontset.h"
41#include "window.h"
42#ifdef HAVE_WINDOW_SYSTEM 37#ifdef HAVE_WINDOW_SYSTEM
43#include TERM_HEADER 38#include TERM_HEADER
44#endif /* HAVE_WINDOW_SYSTEM */ 39#endif /* HAVE_WINDOW_SYSTEM */
45#include "termhooks.h"
46#include "font.h" 40#include "font.h"
47 41
48/* FONTSET 42/* FONTSET
diff --git a/src/frame.c b/src/frame.c
index 6d596a48e23..78f8ff71be3 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <c-ctype.h> 26#include <c-ctype.h>
27 27
28#include "lisp.h" 28#include "lisp.h"
29#include "character.h"
30 29
31#ifdef HAVE_WINDOW_SYSTEM 30#ifdef HAVE_WINDOW_SYSTEM
32#include TERM_HEADER 31#include TERM_HEADER
@@ -34,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34 33
35#include "buffer.h" 34#include "buffer.h"
36/* These help us bind and responding to switch-frame events. */ 35/* These help us bind and responding to switch-frame events. */
37#include "commands.h"
38#include "keyboard.h" 36#include "keyboard.h"
39#include "frame.h" 37#include "frame.h"
40#include "blockinput.h" 38#include "blockinput.h"
@@ -42,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42#include "termhooks.h" 40#include "termhooks.h"
43#include "dispextern.h" 41#include "dispextern.h"
44#include "window.h" 42#include "window.h"
45#include "font.h"
46#ifdef HAVE_WINDOW_SYSTEM 43#ifdef HAVE_WINDOW_SYSTEM
47#include "fontset.h" 44#include "fontset.h"
48#endif 45#endif
diff --git a/src/frame.h b/src/frame.h
index acac51448d4..e7d3aab119a 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -16,14 +16,9 @@ GNU General Public License for more details.
16You should have received a copy of the GNU General Public License 16You 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/* Don't multiply include: dispextern.h includes macterm.h which
20 includes frame.h some emacs source includes both dispextern.h and
21 frame.h. */
22
23#ifndef EMACS_FRAME_H 19#ifndef EMACS_FRAME_H
24#define EMACS_FRAME_H 20#define EMACS_FRAME_H
25 21
26#include "dispextern.h"
27#include "termhooks.h" 22#include "termhooks.h"
28#include "window.h" 23#include "window.h"
29 24
diff --git a/src/fringe.c b/src/fringe.c
index fcc5207b062..632fa0b25d4 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include "frame.h" 26#include "frame.h"
27#include "window.h" 27#include "window.h"
28#include "dispextern.h" 28#include "dispextern.h"
29#include "character.h"
30#include "buffer.h" 29#include "buffer.h"
31#include "blockinput.h" 30#include "blockinput.h"
32#include "termhooks.h" 31#include "termhooks.h"
diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index df3aa596f6b..4326b775c8f 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -22,13 +22,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <cairo-ft.h> 22#include <cairo-ft.h>
23 23
24#include "lisp.h" 24#include "lisp.h"
25#include "dispextern.h"
26#include "xterm.h" 25#include "xterm.h"
27#include "frame.h"
28#include "blockinput.h" 26#include "blockinput.h"
29#include "character.h"
30#include "charset.h"
31#include "fontset.h"
32#include "font.h" 27#include "font.h"
33#include "ftfont.h" 28#include "ftfont.h"
34 29
diff --git a/src/ftfont.c b/src/ftfont.c
index 15a815924c1..fb1addb7a0c 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -28,13 +28,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28 28
29#include "lisp.h" 29#include "lisp.h"
30#include "dispextern.h" 30#include "dispextern.h"
31#include "frame.h"
32#include "blockinput.h"
33#include "character.h" 31#include "character.h"
34#include "charset.h" 32#include "charset.h"
35#include "coding.h"
36#include "composite.h" 33#include "composite.h"
37#include "fontset.h"
38#include "font.h" 34#include "font.h"
39#include "ftfont.h" 35#include "ftfont.h"
40 36
diff --git a/src/ftxfont.c b/src/ftxfont.c
index cd2bf3e7415..99b06f2b49c 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -24,13 +24,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <X11/Xlib.h> 24#include <X11/Xlib.h>
25 25
26#include "lisp.h" 26#include "lisp.h"
27#include "dispextern.h"
28#include "xterm.h" 27#include "xterm.h"
29#include "frame.h" 28#include "frame.h"
30#include "blockinput.h" 29#include "blockinput.h"
31#include "character.h"
32#include "charset.h"
33#include "fontset.h"
34#include "font.h" 30#include "font.h"
35 31
36/* FTX font driver. */ 32/* FTX font driver. */
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 69f635d4115..2057f885300 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -23,10 +23,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <gio/gio.h> 23#include <gio/gio.h>
24#include "lisp.h" 24#include "lisp.h"
25#include "coding.h" 25#include "coding.h"
26#include "frame.h"
27#include "termhooks.h" 26#include "termhooks.h"
28#include "keyboard.h" 27#include "keyboard.h"
29#include "process.h"
30 28
31 29
32/* This is a list, elements are triples (DESCRIPTOR FILE FLAGS CALLBACK) */ 30/* This is a list, elements are triples (DESCRIPTOR FILE FLAGS CALLBACK) */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index ad71b9ccbcb..701bcab7060 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -26,20 +26,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <c-ctype.h> 26#include <c-ctype.h>
27 27
28#include "lisp.h" 28#include "lisp.h"
29#include "dispextern.h"
30#include "frame.h"
31#include "systime.h"
29#include "xterm.h" 32#include "xterm.h"
30#include "blockinput.h" 33#include "blockinput.h"
31#include "syssignal.h"
32#include "window.h" 34#include "window.h"
33#include "buffer.h"
34#include "gtkutil.h" 35#include "gtkutil.h"
35#include "termhooks.h" 36#include "termhooks.h"
36#include "keyboard.h" 37#include "keyboard.h"
37#include "charset.h"
38#include "coding.h" 38#include "coding.h"
39#include "font.h"
40 39
41#include <gdk/gdkkeysyms.h> 40#include <gdk/gdkkeysyms.h>
42#include "xsettings.h"
43 41
44#ifdef HAVE_XFT 42#ifdef HAVE_XFT
45#include <X11/Xft/Xft.h> 43#include <X11/Xft/Xft.h>
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 34338db58fb..0dbb4a1cdc6 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include <gtk/gtk.h> 26#include <gtk/gtk.h>
27#include "../lwlib/lwlib-widget.h" 27#include "../lwlib/lwlib-widget.h"
28#include "frame.h"
29#include "xterm.h" 28#include "xterm.h"
30 29
31/* Minimum and maximum values used for GTK scroll bars */ 30/* Minimum and maximum values used for GTK scroll bars */
diff --git a/src/image.c b/src/image.c
index 9970e5881e0..928eb5cfa37 100644
--- a/src/image.c
+++ b/src/image.c
@@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20#include <config.h> 20#include <config.h>
21#include "sysstdio.h" 21
22#include <fcntl.h>
23#include <stdio.h>
22#include <unistd.h> 24#include <unistd.h>
23 25
24/* Include this before including <setjmp.h> to work around bugs with 26/* Include this before including <setjmp.h> to work around bugs with
@@ -38,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include "blockinput.h" 40#include "blockinput.h"
39#include "systime.h" 41#include "systime.h"
40#include <epaths.h> 42#include <epaths.h>
41#include "character.h"
42#include "coding.h" 43#include "coding.h"
43#include "termhooks.h" 44#include "termhooks.h"
44#include "font.h" 45#include "font.h"
diff --git a/src/indent.c b/src/indent.c
index 330065b085e..04837f8f513 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -26,10 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include "category.h" 26#include "category.h"
27#include "composite.h" 27#include "composite.h"
28#include "indent.h" 28#include "indent.h"
29#include "keyboard.h"
30#include "frame.h" 29#include "frame.h"
31#include "window.h" 30#include "window.h"
32#include "termchar.h"
33#include "disptab.h" 31#include "disptab.h"
34#include "intervals.h" 32#include "intervals.h"
35#include "dispextern.h" 33#include "dispextern.h"
diff --git a/src/inotify.c b/src/inotify.c
index be8c1dd7553..d1a80bbad1b 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -25,8 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include "coding.h" 25#include "coding.h"
26#include "process.h" 26#include "process.h"
27#include "keyboard.h" 27#include "keyboard.h"
28#include "character.h"
29#include "frame.h" /* Required for termhooks.h. */
30#include "termhooks.h" 28#include "termhooks.h"
31 29
32#include <errno.h> 30#include <errno.h>
diff --git a/src/insdel.c b/src/insdel.c
index a977b79bccc..24807b1e8f4 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -23,11 +23,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <intprops.h> 23#include <intprops.h>
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "composite.h"
26#include "intervals.h" 27#include "intervals.h"
27#include "character.h" 28#include "character.h"
28#include "buffer.h" 29#include "buffer.h"
29#include "window.h" 30#include "window.h"
30#include "blockinput.h"
31#include "region-cache.h" 31#include "region-cache.h"
32 32
33static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, 33static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t,
diff --git a/src/intervals.c b/src/intervals.c
index 1c8dd41e6a2..c272bae027d 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -43,10 +43,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
43#include <intprops.h> 43#include <intprops.h>
44#include "lisp.h" 44#include "lisp.h"
45#include "intervals.h" 45#include "intervals.h"
46#include "character.h"
47#include "buffer.h" 46#include "buffer.h"
48#include "puresize.h" 47#include "puresize.h"
49#include "keyboard.h"
50#include "keymap.h" 48#include "keymap.h"
51 49
52/* Test for membership, allowing for t (actually any non-cons) to mean the 50/* Test for membership, allowing for t (actually any non-cons) to mean the
diff --git a/src/intervals.h b/src/intervals.h
index 5a7829de93c..96e82055e9c 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -19,8 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#ifndef EMACS_INTERVALS_H 19#ifndef EMACS_INTERVALS_H
20#define EMACS_INTERVALS_H 20#define EMACS_INTERVALS_H
21 21
22#include "dispextern.h"
23
24INLINE_HEADER_BEGIN 22INLINE_HEADER_BEGIN
25 23
26/* Basic data type for use of intervals. */ 24/* Basic data type for use of intervals. */
@@ -295,8 +293,6 @@ extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
295 293
296extern void syms_of_textprop (void); 294extern void syms_of_textprop (void);
297 295
298#include "composite.h"
299
300INLINE_HEADER_END 296INLINE_HEADER_END
301 297
302#endif /* EMACS_INTERVALS_H */ 298#endif /* EMACS_INTERVALS_H */
diff --git a/src/keyboard.c b/src/keyboard.c
index 966af69c97b..1a78f6a705c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -20,10 +20,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22 22
23#include "sysstdio.h"
24#include <sys/stat.h> 23#include <sys/stat.h>
25 24
26#include "lisp.h" 25#include "lisp.h"
26#include "coding.h"
27#include "termchar.h" 27#include "termchar.h"
28#include "termopts.h" 28#include "termopts.h"
29#include "frame.h" 29#include "frame.h"
@@ -34,13 +34,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34#include "commands.h" 34#include "commands.h"
35#include "character.h" 35#include "character.h"
36#include "buffer.h" 36#include "buffer.h"
37#include "disptab.h"
38#include "dispextern.h" 37#include "dispextern.h"
39#include "syntax.h" 38#include "syntax.h"
40#include "intervals.h" 39#include "intervals.h"
41#include "keymap.h" 40#include "keymap.h"
42#include "blockinput.h" 41#include "blockinput.h"
43#include "puresize.h"
44#include "systime.h" 42#include "systime.h"
45#include "atimer.h" 43#include "atimer.h"
46#include "process.h" 44#include "process.h"
diff --git a/src/keyboard.h b/src/keyboard.h
index 67afc3bc2be..98bc86b58ed 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#ifndef EMACS_KEYBOARD_H 20#ifndef EMACS_KEYBOARD_H
21#define EMACS_KEYBOARD_H 21#define EMACS_KEYBOARD_H
22 22
23#include "systime.h" /* for struct timespec, Time */
24#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ 23#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
25#include "termhooks.h" 24#include "termhooks.h"
26 25
diff --git a/src/keymap.c b/src/keymap.c
index 81091f03d70..c988d12fe80 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -46,9 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#include "commands.h" 46#include "commands.h"
47#include "character.h" 47#include "character.h"
48#include "buffer.h" 48#include "buffer.h"
49#include "charset.h"
50#include "keyboard.h" 49#include "keyboard.h"
51#include "frame.h"
52#include "termhooks.h" 50#include "termhooks.h"
53#include "blockinput.h" 51#include "blockinput.h"
54#include "puresize.h" 52#include "puresize.h"
diff --git a/src/lread.c b/src/lread.c
index bceec4bb644..a98fa6199f1 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include <math.h> 31#include <math.h>
32#include <stat-time.h> 32#include <stat-time.h>
33#include "lisp.h" 33#include "lisp.h"
34#include "dispextern.h"
34#include "intervals.h" 35#include "intervals.h"
35#include "character.h" 36#include "character.h"
36#include "buffer.h" 37#include "buffer.h"
@@ -39,7 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39#include <epaths.h> 40#include <epaths.h>
40#include "commands.h" 41#include "commands.h"
41#include "keyboard.h" 42#include "keyboard.h"
42#include "frame.h" 43#include "systime.h"
43#include "termhooks.h" 44#include "termhooks.h"
44#include "blockinput.h" 45#include "blockinput.h"
45 46
diff --git a/src/macros.c b/src/macros.c
index 1bf2cd73443..d963838069b 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -22,9 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include "lisp.h" 23#include "lisp.h"
24#include "macros.h" 24#include "macros.h"
25#include "commands.h"
26#include "character.h"
27#include "buffer.h"
28#include "window.h" 25#include "window.h"
29#include "keyboard.h" 26#include "keyboard.h"
30 27
diff --git a/src/menu.c b/src/menu.c
index dc82809629a..74df43f6ce9 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -23,13 +23,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <limits.h> /* for INT_MAX */ 23#include <limits.h> /* for INT_MAX */
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h"
27#include "coding.h"
26#include "keyboard.h" 28#include "keyboard.h"
27#include "keymap.h" 29#include "keymap.h"
28#include "frame.h" 30#include "frame.h"
29#include "window.h" 31#include "window.h"
30#include "termhooks.h" 32#include "termhooks.h"
31#include "blockinput.h" 33#include "blockinput.h"
32#include "dispextern.h"
33#include "buffer.h" 34#include "buffer.h"
34 35
35#ifdef USE_X_TOOLKIT 36#ifdef USE_X_TOOLKIT
diff --git a/src/menu.h b/src/menu.h
index de586a5e101..e89e93ec8eb 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#ifndef MENU_H 19#ifndef MENU_H
20#define MENU_H 20#define MENU_H
21 21
22#include "systime.h" /* for Time */
23#include "../lwlib/lwlib-widget.h" 22#include "../lwlib/lwlib-widget.h"
24 23
25/* Bit fields used by terminal-specific menu_show_hook. */ 24/* Bit fields used by terminal-specific menu_show_hook. */
diff --git a/src/minibuf.c b/src/minibuf.c
index e149e819413..31b69461bde 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -25,17 +25,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <binary-io.h> 25#include <binary-io.h>
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "commands.h"
29#include "character.h" 28#include "character.h"
30#include "buffer.h" 29#include "buffer.h"
31#include "dispextern.h"
32#include "keyboard.h" 30#include "keyboard.h"
33#include "frame.h" 31#include "frame.h"
34#include "window.h" 32#include "window.h"
35#include "syntax.h"
36#include "intervals.h"
37#include "keymap.h" 33#include "keymap.h"
38#include "termhooks.h"
39#include "systty.h" 34#include "systty.h"
40 35
41/* List of buffers for use as minibuffers. 36/* List of buffers for use as minibuffers.
diff --git a/src/print.c b/src/print.c
index 3c3dca77000..6f868ceff84 100644
--- a/src/print.c
+++ b/src/print.c
@@ -24,24 +24,21 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h" 26#include "character.h"
27#include "coding.h"
27#include "buffer.h" 28#include "buffer.h"
28#include "charset.h" 29#include "charset.h"
29#include "keyboard.h"
30#include "frame.h" 30#include "frame.h"
31#include "window.h"
32#include "process.h" 31#include "process.h"
33#include "dispextern.h"
34#include "disptab.h" 32#include "disptab.h"
35#include "termchar.h"
36#include "intervals.h" 33#include "intervals.h"
37#include "blockinput.h" 34#include "blockinput.h"
38#include "termhooks.h" /* For struct terminal. */
39#include "font.h"
40 35
41#include <c-ctype.h> 36#include <c-ctype.h>
42#include <float.h> 37#include <float.h>
43#include <ftoastr.h> 38#include <ftoastr.h>
44 39
40struct terminal;
41
45/* Avoid actual stack overflow in print. */ 42/* Avoid actual stack overflow in print. */
46static ptrdiff_t print_depth; 43static ptrdiff_t print_depth;
47 44
diff --git a/src/process.c b/src/process.c
index 55f31a02673..dc93b86cee2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -103,13 +103,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
103#include "coding.h" 103#include "coding.h"
104#include "process.h" 104#include "process.h"
105#include "frame.h" 105#include "frame.h"
106#include "termhooks.h"
107#include "termopts.h" 106#include "termopts.h"
108#include "commands.h"
109#include "keyboard.h" 107#include "keyboard.h"
110#include "blockinput.h" 108#include "blockinput.h"
111#include "dispextern.h"
112#include "composite.h"
113#include "atimer.h" 109#include "atimer.h"
114#include "sysselect.h" 110#include "sysselect.h"
115#include "syssignal.h" 111#include "syssignal.h"
diff --git a/src/region-cache.c b/src/region-cache.c
index 937f3d09aaf..1383acd9256 100644
--- a/src/region-cache.c
+++ b/src/region-cache.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 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h"
27#include "buffer.h" 26#include "buffer.h"
28#include "region-cache.h" 27#include "region-cache.h"
29 28
diff --git a/src/scroll.c b/src/scroll.c
index 7f5b73bd773..2534ab051e3 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -25,9 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include "lisp.h" 25#include "lisp.h"
26#include "termchar.h" 26#include "termchar.h"
27#include "dispextern.h" 27#include "dispextern.h"
28#include "keyboard.h"
29#include "frame.h" 28#include "frame.h"
30#include "window.h"
31#include "termhooks.h" 29#include "termhooks.h"
32 30
33/* All costs measured in characters. 31/* All costs measured in characters.
diff --git a/src/search.c b/src/search.c
index 8c9714eb6fa..e39ba3dbf07 100644
--- a/src/search.c
+++ b/src/search.c
@@ -22,13 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <config.h> 22#include <config.h>
23 23
24#include "lisp.h" 24#include "lisp.h"
25#include "category.h"
26#include "character.h" 25#include "character.h"
27#include "buffer.h" 26#include "buffer.h"
28#include "syntax.h" 27#include "syntax.h"
29#include "charset.h" 28#include "charset.h"
30#include "region-cache.h" 29#include "region-cache.h"
31#include "commands.h"
32#include "blockinput.h" 30#include "blockinput.h"
33#include "intervals.h" 31#include "intervals.h"
34 32
diff --git a/src/sound.c b/src/sound.c
index 9a365c71ef2..09ab48c58e1 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -46,7 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#include <errno.h> 46#include <errno.h>
47 47
48#include "lisp.h" 48#include "lisp.h"
49#include "dispextern.h"
50#include "atimer.h" 49#include "atimer.h"
51#include "syssignal.h" 50#include "syssignal.h"
52/* END: Common Includes */ 51/* END: Common Includes */
diff --git a/src/syntax.c b/src/syntax.c
index 6bfb3b7601d..1dcb3a5d15d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -23,12 +23,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <sys/types.h> 23#include <sys/types.h>
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "commands.h"
27#include "character.h" 26#include "character.h"
28#include "buffer.h" 27#include "buffer.h"
29#include "keymap.h"
30#include "regex.h" 28#include "regex.h"
31
32#include "syntax.h" 29#include "syntax.h"
33#include "intervals.h" 30#include "intervals.h"
34#include "category.h" 31#include "category.h"
diff --git a/src/sysdep.c b/src/sysdep.c
index 836cc271b11..1af323eb8d6 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -93,13 +93,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
93 93
94#include "keyboard.h" 94#include "keyboard.h"
95#include "frame.h" 95#include "frame.h"
96#include "window.h"
97#include "termhooks.h" 96#include "termhooks.h"
98#include "termchar.h" 97#include "termchar.h"
99#include "termopts.h" 98#include "termopts.h"
100#include "dispextern.h"
101#include "process.h" 99#include "process.h"
102#include "cm.h" /* for reset_sys_modes */ 100#include "cm.h"
103 101
104#ifdef WINDOWSNT 102#ifdef WINDOWSNT
105#include <direct.h> 103#include <direct.h>
diff --git a/src/systime.h b/src/systime.h
index 315f9d1ee68..a7c182a283d 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -83,8 +83,8 @@ extern struct timeval make_timeval (struct timespec) ATTRIBUTE_CONST;
83extern void set_waiting_for_input (struct timespec *); 83extern void set_waiting_for_input (struct timespec *);
84 84
85/* When lisp.h is not included Lisp_Object is not defined (this can 85/* When lisp.h is not included Lisp_Object is not defined (this can
86 happen when this files is used outside the src directory). */ 86 happen when this file is used outside the src directory). */
87#ifdef EMACS_LISP_H 87#ifdef emacs
88 88
89/* Emacs uses the integer list (HI LO US PS) to represent the time 89/* Emacs uses the integer list (HI LO US PS) to represent the time
90 (HI << LO_TIME_BITS) + LO + US / 1e6 + PS / 1e12. */ 90 (HI << LO_TIME_BITS) + LO + US / 1e6 + PS / 1e12. */
diff --git a/src/term.c b/src/term.c
index 5acc47395db..9b1e7cad4b2 100644
--- a/src/term.c
+++ b/src/term.c
@@ -44,8 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include "keymap.h" 44#include "keymap.h"
45#include "blockinput.h" 45#include "blockinput.h"
46#include "syssignal.h" 46#include "syssignal.h"
47#include "systty.h"
48#include "intervals.h"
49#ifdef MSDOS 47#ifdef MSDOS
50#include "msdos.h" 48#include "msdos.h"
51static int been_here = -1; 49static int been_here = -1;
@@ -56,10 +54,6 @@ static int been_here = -1;
56#endif 54#endif
57 55
58#include "cm.h" 56#include "cm.h"
59#ifdef HAVE_X_WINDOWS
60#include "xterm.h"
61#endif
62
63#include "menu.h" 57#include "menu.h"
64 58
65/* The name of the default console device. */ 59/* The name of the default console device. */
diff --git a/src/terminal.c b/src/terminal.c
index 80c6aa20bee..27594e52a74 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -21,11 +21,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <stdio.h> 21#include <stdio.h>
22 22
23#include "lisp.h" 23#include "lisp.h"
24#include "character.h"
24#include "frame.h" 25#include "frame.h"
25#include "termchar.h" 26#include "termchar.h"
26#include "termhooks.h" 27#include "termhooks.h"
27#include "charset.h"
28#include "coding.h"
29#include "keyboard.h" 28#include "keyboard.h"
30 29
31#if HAVE_STRUCT_UNIPAIR_UNICODE 30#if HAVE_STRUCT_UNIPAIR_UNICODE
diff --git a/src/textprop.c b/src/textprop.c
index 6758d4dfee2..1995ff65ce0 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include "lisp.h" 22#include "lisp.h"
23#include "intervals.h" 23#include "intervals.h"
24#include "character.h"
25#include "buffer.h" 24#include "buffer.h"
26#include "window.h" 25#include "window.h"
27 26
diff --git a/src/undo.c b/src/undo.c
index 750bc8afff2..e0924b2b989 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -21,10 +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 "lisp.h" 23#include "lisp.h"
24#include "character.h"
25#include "buffer.h" 24#include "buffer.h"
26#include "commands.h"
27#include "window.h"
28 25
29/* Last buffer for which undo information was recorded. */ 26/* Last buffer for which undo information was recorded. */
30/* BEWARE: This is not traced by the GC, so never dereference it! */ 27/* BEWARE: This is not traced by the GC, so never dereference it! */
diff --git a/src/unexsol.c b/src/unexsol.c
index cfd515ff504..0f84099d39e 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -6,9 +6,7 @@
6#include <dlfcn.h> 6#include <dlfcn.h>
7 7
8#include "lisp.h" 8#include "lisp.h"
9#include "character.h"
10#include "buffer.h" 9#include "buffer.h"
11#include "charset.h"
12#include "coding.h" 10#include "coding.h"
13 11
14void 12void
diff --git a/src/widget.c b/src/widget.c
index 48872f55938..d0c3e60cfa6 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -29,17 +29,13 @@ 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 "widget.h"
33
32#include <stdio.h> 34#include <stdio.h>
33 35
34#include "lisp.h" 36#include "lisp.h"
35#include "xterm.h" 37#include "xterm.h"
36
37#include "keyboard.h"
38#include "frame.h" 38#include "frame.h"
39#include "window.h"
40
41#include "dispextern.h"
42#include "blockinput.h"
43 39
44#include <X11/StringDefs.h> 40#include <X11/StringDefs.h>
45#include <X11/IntrinsicP.h> 41#include <X11/IntrinsicP.h>
@@ -50,10 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include <X11/ShellP.h> 46#include <X11/ShellP.h>
51#include "../lwlib/lwlib.h" 47#include "../lwlib/lwlib.h"
52 48
53#include "character.h"
54#include "font.h"
55
56
57static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2); 49static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2);
58static void EmacsFrameDestroy (Widget widget); 50static void EmacsFrameDestroy (Widget widget);
59static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs); 51static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs);
diff --git a/src/widgetprv.h b/src/widgetprv.h
index 6cbbbd617f0..dc0124887ad 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 23
24#include <X11/IntrinsicP.h> 24#include <X11/IntrinsicP.h>
25#include <X11/CoreP.h> 25#include <X11/CoreP.h>
26#include "widget.h"
27 26
28typedef struct { 27typedef struct {
29 struct frame* frame; /* the *emacs* frame object */ 28 struct frame* frame; /* the *emacs* frame object */
diff --git a/src/window.c b/src/window.c
index 3566f6e6469..8ed0f32a694 100644
--- a/src/window.c
+++ b/src/window.c
@@ -23,11 +23,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <stdio.h> 23#include <stdio.h>
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "character.h"
27#include "buffer.h" 26#include "buffer.h"
28#include "keyboard.h" 27#include "keyboard.h"
29#include "keymap.h" 28#include "keymap.h"
30#include "menu.h"
31#include "frame.h" 29#include "frame.h"
32#include "window.h" 30#include "window.h"
33#include "commands.h" 31#include "commands.h"
@@ -36,7 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36#include "disptab.h" 34#include "disptab.h"
37#include "dispextern.h" 35#include "dispextern.h"
38#include "blockinput.h" 36#include "blockinput.h"
39#include "intervals.h"
40#include "termhooks.h" /* For FRAME_TERMINAL. */ 37#include "termhooks.h" /* For FRAME_TERMINAL. */
41#ifdef HAVE_WINDOW_SYSTEM 38#ifdef HAVE_WINDOW_SYSTEM
42#include TERM_HEADER 39#include TERM_HEADER
diff --git a/src/xdisp.c b/src/xdisp.c
index 986e13f43b5..bfd3a8299ad 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -292,7 +292,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
292 292
293#include "lisp.h" 293#include "lisp.h"
294#include "atimer.h" 294#include "atimer.h"
295#include "composite.h"
295#include "keyboard.h" 296#include "keyboard.h"
297#include "systime.h"
296#include "frame.h" 298#include "frame.h"
297#include "window.h" 299#include "window.h"
298#include "termchar.h" 300#include "termchar.h"
@@ -303,13 +305,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
303#include "indent.h" 305#include "indent.h"
304#include "commands.h" 306#include "commands.h"
305#include "keymap.h" 307#include "keymap.h"
306#include "macros.h"
307#include "disptab.h" 308#include "disptab.h"
308#include "termhooks.h" 309#include "termhooks.h"
309#include "termopts.h" 310#include "termopts.h"
310#include "intervals.h" 311#include "intervals.h"
311#include "coding.h" 312#include "coding.h"
312#include "process.h"
313#include "region-cache.h" 313#include "region-cache.h"
314#include "font.h" 314#include "font.h"
315#include "fontset.h" 315#include "fontset.h"
diff --git a/src/xfaces.c b/src/xfaces.c
index a3d122fbf46..6bbd5417155 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -206,10 +206,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
206 206
207#include "lisp.h" 207#include "lisp.h"
208#include "character.h" 208#include "character.h"
209#include "charset.h"
210#include "keyboard.h"
211#include "frame.h" 209#include "frame.h"
212#include "termhooks.h"
213 210
214#ifdef USE_MOTIF 211#ifdef USE_MOTIF
215#include <Xm/Xm.h> 212#include <Xm/Xm.h>
@@ -237,7 +234,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
237#include "dispextern.h" 234#include "dispextern.h"
238#include "blockinput.h" 235#include "blockinput.h"
239#include "window.h" 236#include "window.h"
240#include "intervals.h"
241#include "termchar.h" 237#include "termchar.h"
242 238
243#include "font.h" 239#include "font.h"
diff --git a/src/xfns.c b/src/xfns.c
index 8251f939b8c..db87fcc94fc 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -24,23 +24,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24 24
25#include "lisp.h" 25#include "lisp.h"
26#include "xterm.h" 26#include "xterm.h"
27#include "menu.h"
28#include "frame.h" 27#include "frame.h"
29#include "window.h" 28#include "window.h"
30#include "character.h"
31#include "buffer.h" 29#include "buffer.h"
32#include "intervals.h"
33#include "dispextern.h" 30#include "dispextern.h"
34#include "keyboard.h" 31#include "keyboard.h"
35#include "blockinput.h" 32#include "blockinput.h"
36#include <epaths.h>
37#include "charset.h" 33#include "charset.h"
38#include "coding.h" 34#include "coding.h"
39#include "fontset.h"
40#include "systime.h"
41#include "termhooks.h" 35#include "termhooks.h"
42#include "atimer.h"
43#include "termchar.h"
44#include "font.h" 36#include "font.h"
45 37
46#include <sys/types.h> 38#include <sys/types.h>
diff --git a/src/xfont.c b/src/xfont.c
index d5a7d64e697..671b1050c9c 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -24,15 +24,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <X11/Xlib.h> 24#include <X11/Xlib.h>
25 25
26#include "lisp.h" 26#include "lisp.h"
27#include "dispextern.h"
28#include "xterm.h" 27#include "xterm.h"
29#include "frame.h" 28#include "frame.h"
30#include "blockinput.h" 29#include "blockinput.h"
31#include "character.h" 30#include "character.h"
32#include "charset.h" 31#include "charset.h"
33#include "fontset.h"
34#include "font.h" 32#include "font.h"
35#include "ccl.h"
36 33
37 34
38/* X core font driver. */ 35/* X core font driver. */
diff --git a/src/xftfont.c b/src/xftfont.c
index 851edb69fa0..956231ee422 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -25,14 +25,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <X11/Xft/Xft.h> 25#include <X11/Xft/Xft.h>
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "dispextern.h"
29#include "xterm.h" 28#include "xterm.h"
30#include "frame.h" 29#include "frame.h"
31#include "blockinput.h" 30#include "blockinput.h"
32#include "character.h"
33#include "charset.h" 31#include "charset.h"
34#include "composite.h" 32#include "composite.h"
35#include "fontset.h"
36#include "font.h" 33#include "font.h"
37#include "ftfont.h" 34#include "ftfont.h"
38 35
diff --git a/src/xgselect.c b/src/xgselect.c
index 0b62d3e8255..55e1ffcabff 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -26,9 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#include <glib.h> 26#include <glib.h>
27#include <errno.h> 27#include <errno.h>
28#include <stdbool.h> 28#include <stdbool.h>
29#include <timespec.h>
30#include "frame.h"
31#include "blockinput.h" 29#include "blockinput.h"
30#include "systime.h"
32 31
33/* `xg_select' is a `pselect' replacement. Why do we need a separate function? 32/* `xg_select' is a `pselect' replacement. Why do we need a separate function?
34 1. Timeouts. Glib and Gtk rely on timer events. If we did pselect 33 1. Timeouts. Glib and Gtk rely on timer events. If we did pselect
diff --git a/src/xgselect.h b/src/xgselect.h
index ada2376c98e..524fff7d352 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -21,9 +21,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#define XGSELECT_H 21#define XGSELECT_H
22 22
23#include "lisp.h" 23#include "lisp.h"
24#include <time.h>
25#include "sysselect.h" 24#include "sysselect.h"
26 25
26struct timespec;
27
27extern int xg_select (int max_fds, 28extern int xg_select (int max_fds,
28 fd_set *rfds, fd_set *wfds, fd_set *efds, 29 fd_set *rfds, fd_set *wfds, fd_set *efds,
29 struct timespec const *timeout, 30 struct timespec const *timeout,
diff --git a/src/xmenu.c b/src/xmenu.c
index 4379cddaf2e..be6e41de63e 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -36,14 +36,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
36 36
37#include "lisp.h" 37#include "lisp.h"
38#include "keyboard.h" 38#include "keyboard.h"
39#include "keymap.h"
40#include "frame.h" 39#include "frame.h"
40#include "systime.h"
41#include "termhooks.h" 41#include "termhooks.h"
42#include "window.h" 42#include "window.h"
43#include "blockinput.h" 43#include "blockinput.h"
44#include "character.h"
45#include "buffer.h" 44#include "buffer.h"
46#include "charset.h"
47#include "coding.h" 45#include "coding.h"
48#include "sysselect.h" 46#include "sysselect.h"
49 47
@@ -63,8 +61,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
63#include <sys/types.h> 61#include <sys/types.h>
64#endif 62#endif
65 63
66#include "dispextern.h"
67
68#ifdef HAVE_X_WINDOWS 64#ifdef HAVE_X_WINDOWS
69/* Defining HAVE_MULTILINGUAL_MENU would mean that the toolkit menu 65/* Defining HAVE_MULTILINGUAL_MENU would mean that the toolkit menu
70 code accepts the Emacs internal encoding. */ 66 code accepts the Emacs internal encoding. */
diff --git a/src/xml.c b/src/xml.c
index 9e68fff2b4d..fc77f22b862 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -25,7 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <libxml/HTMLparser.h> 25#include <libxml/HTMLparser.h>
26 26
27#include "lisp.h" 27#include "lisp.h"
28#include "character.h"
29#include "buffer.h" 28#include "buffer.h"
30 29
31 30
diff --git a/src/xrdb.c b/src/xrdb.c
index 2235b4535da..ce6e7d21edb 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -43,11 +43,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
43#include <pwd.h> 43#include <pwd.h>
44#endif 44#endif
45 45
46#ifdef USE_MOTIF
47/* For Vdouble_click_time. */
48#include "keyboard.h"
49#endif
50
51/* X file search path processing. */ 46/* X file search path processing. */
52 47
53 48
diff --git a/src/xselect.c b/src/xselect.c
index 9a7e6974cd9..9d178a50d7a 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -31,12 +31,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31 31
32#include "lisp.h" 32#include "lisp.h"
33#include "xterm.h" /* for all of the X includes */ 33#include "xterm.h" /* for all of the X includes */
34#include "dispextern.h" /* frame.h seems to want this */
35#include "frame.h" /* Need this to get the X window of selected_frame */ 34#include "frame.h" /* Need this to get the X window of selected_frame */
36#include "blockinput.h" 35#include "blockinput.h"
37#include "character.h"
38#include "buffer.h"
39#include "process.h"
40#include "termhooks.h" 36#include "termhooks.h"
41#include "keyboard.h" 37#include "keyboard.h"
42 38
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 3b06f7133c7..b84f2ac58d9 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -32,8 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include <stdio.h> 32#include <stdio.h>
33 33
34#include "lisp.h" 34#include "lisp.h"
35#include "systime.h"
36#include "sysselect.h"
37#include "frame.h" 35#include "frame.h"
38#include "termhooks.h" 36#include "termhooks.h"
39#include "xterm.h" 37#include "xterm.h"
diff --git a/src/xterm.c b/src/xterm.c
index fcd81a162c9..691ad05efe1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -28,7 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28 28
29#include "lisp.h" 29#include "lisp.h"
30#include "blockinput.h" 30#include "blockinput.h"
31#include "syssignal.h"
32 31
33/* This may include sys/types.h, and that somehow loses 32/* This may include sys/types.h, and that somehow loses
34 if this is not done before the other system files. */ 33 if this is not done before the other system files. */
@@ -58,12 +57,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#include <fcntl.h> 57#include <fcntl.h>
59#include <errno.h> 58#include <errno.h>
60#include <sys/stat.h> 59#include <sys/stat.h>
61/* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */
62/* #include <sys/param.h> */
63
64#include "charset.h"
65#include "character.h" 60#include "character.h"
66#include "coding.h" 61#include "coding.h"
62#include "composite.h"
67#include "frame.h" 63#include "frame.h"
68#include "dispextern.h" 64#include "dispextern.h"
69#include "fontset.h" 65#include "fontset.h"
@@ -71,17 +67,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
71#include "termopts.h" 67#include "termopts.h"
72#include "termchar.h" 68#include "termchar.h"
73#include "emacs-icon.h" 69#include "emacs-icon.h"
74#include "disptab.h"
75#include "buffer.h" 70#include "buffer.h"
76#include "window.h" 71#include "window.h"
77#include "keyboard.h" 72#include "keyboard.h"
78#include "intervals.h"
79#include "process.h"
80#include "atimer.h" 73#include "atimer.h"
81#include "keymap.h"
82#include "font.h" 74#include "font.h"
83#include "xsettings.h" 75#include "xsettings.h"
84#include "xgselect.h"
85#include "sysselect.h" 76#include "sysselect.h"
86#include "menu.h" 77#include "menu.h"
87 78