summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-10-20 18:27:05 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-10-20 18:35:53 -0700
commit63cfb75f3a9d0f658e099ae18779e305a7e49fee (patch)
tree85f353c8b62fa50a922b1381c3068841e35970b7
parente9af822ac3ddf9644aa4a68e56b0580e133449b2 (diff)
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 f08a35074c..7c33687ccd 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/>. */
#endif
#include "lisp.h"
-#include "process.h"
+#include "dispextern.h"
#include "intervals.h"
#include "puresize.h"
+#include "systime.h"
#include "character.h"
#include "buffer.h"
#include "window.h"
diff --git a/src/atimer.c b/src/atimer.c
index 8a1a48be64..976b990f5f 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/>. */
#include "lisp.h"
#include "syssignal.h"
#include "systime.h"
-#include "blockinput.h"
#include "atimer.h"
#include <unistd.h>
diff --git a/src/buffer.c b/src/buffer.c
index 38ee74d234..380a7af33c 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/>. */
#include <verify.h>
#include "lisp.h"
+#include "coding.h"
#include "intervals.h"
+#include "systime.h"
#include "window.h"
#include "commands.h"
#include "character.h"
@@ -38,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "region-cache.h"
#include "indent.h"
#include "blockinput.h"
-#include "keyboard.h"
#include "keymap.h"
#include "frame.h"
@@ -4573,8 +4574,6 @@ evaporate_overlays (ptrdiff_t pos)
#include <fcntl.h>
#endif
-#include "coding.h"
-
/* Memory is allocated in regions which are mapped using mmap(2).
The current implementation lets the system select mapped
diff --git a/src/callint.c b/src/callint.c
index 12d116db28..76ee13e533 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/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
-#include "commands.h"
#include "keyboard.h"
#include "window.h"
-#include "keymap.h"
static Lisp_Object preserved_fns;
diff --git a/src/callproc.c b/src/callproc.c
index e38844e2da..eafd6217c0 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/>. */
#endif /* MSDOS */
#include "commands.h"
-#include "character.h"
#include "buffer.h"
-#include "ccl.h"
#include "coding.h"
-#include "composite.h"
#include <epaths.h>
#include "process.h"
#include "syssignal.h"
-#include "systty.h"
#include "syswait.h"
#include "blockinput.h"
#include "frame.h"
-#include "termhooks.h"
#ifdef MSDOS
#include "msdos.h"
diff --git a/src/casetab.c b/src/casetab.c
index b086abc012..28da8850ec 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/>. */
#include <config.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
Lisp_Object Vascii_downcase_table;
diff --git a/src/category.c b/src/category.c
index 400116f6e0..5c7cf0795d 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/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
-#include "charset.h"
#include "category.h"
-#include "keymap.h"
/* This setter is used only in this file, so it can be private. */
static void
diff --git a/src/ccl.h b/src/ccl.h
index 7b72dc7410..fdce437e6c 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/>. */
#ifndef EMACS_CCL_H
#define EMACS_CCL_H
-#include "character.h" /* For MAX_MULTIBYTE_LENGTH */
-
/* Macros for exit status of CCL program. */
#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */
#define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */
diff --git a/src/character.c b/src/character.c
index f51d97125e..3e2bf1e70c 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/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
-#include "charset.h"
#include "composite.h"
#include "disptab.h"
diff --git a/src/charset.c b/src/charset.c
index eeebf172bd..04e81bb0ff 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/>. */
#include "character.h"
#include "charset.h"
#include "coding.h"
-#include "disptab.h"
#include "buffer.h"
/*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) ***
diff --git a/src/chartab.c b/src/chartab.c
index 274bb60727..ec618f3496 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/>. */
#include "lisp.h"
#include "character.h"
#include "charset.h"
-#include "ccl.h"
/* 64/16/32/128 */
diff --git a/src/cm.c b/src/cm.c
index 474f280af3..f0aa56d6c2 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/>. */
#include <stdio.h>
#include "lisp.h"
-#include "frame.h"
#include "cm.h"
-#include "termhooks.h"
#include "termchar.h"
#include "tparam.h"
diff --git a/src/cmds.c b/src/cmds.c
index 39c5af99f5..0afc023e68 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/>. */
#include "character.h"
#include "buffer.h"
#include "syntax.h"
-#include "window.h"
#include "keyboard.h"
#include "keymap.h"
-#include "dispextern.h"
#include "frame.h"
static int internal_self_insert (int, EMACS_INT);
diff --git a/src/coding.c b/src/coding.c
index c5099a7b0b..0b42a36543 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -297,8 +297,6 @@ encode_coding_XXX (struct coding_system *coding)
#include "ccl.h"
#include "composite.h"
#include "coding.h"
-#include "window.h"
-#include "frame.h"
#include "termhooks.h"
Lisp_Object Vcoding_system_hash_table;
diff --git a/src/composite.c b/src/composite.c
index 88cef222d3..0f729bc546 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/>. */
#include "lisp.h"
#include "character.h"
+#include "composite.h"
#include "buffer.h"
#include "coding.h"
#include "intervals.h"
-#include "window.h"
#include "frame.h"
#include "dispextern.h"
-#include "font.h"
#include "termhooks.h"
diff --git a/src/data.c b/src/data.c
index 33fe2855c9..5382b01066 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/>. */
#include "buffer.h"
#include "keyboard.h"
#include "frame.h"
-#include "syssignal.h"
-#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
-#include "font.h"
#include "keymap.h"
static void swap_in_symval_forwarding (struct Lisp_Symbol *,
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 181c7d016f..ce0465dcb8 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/>. */
#include <dbus/dbus.h>
#include "lisp.h"
-#include "frame.h"
#include "termhooks.h"
#include "keyboard.h"
#include "process.h"
diff --git a/src/decompress.c b/src/decompress.c
index 460d4fe767..d0c0018eb2 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/>. */
#include <zlib.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
#include <verify.h>
diff --git a/src/dired.c b/src/dired.c
index 3486e49b56..84bf247226 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/>. */
#include "lisp.h"
#include "systime.h"
-#include "character.h"
#include "buffer.h"
-#include "commands.h"
-#include "charset.h"
#include "coding.h"
#include "regex.h"
#include "blockinput.h"
diff --git a/src/dispnew.c b/src/dispnew.c
index 00d086e416..18eed3cfb1 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/>. */
/* cm.h must come after dispextern.h on Windows. */
#include "dispextern.h"
#include "cm.h"
-#include "character.h"
#include "buffer.h"
#include "keyboard.h"
#include "frame.h"
@@ -36,12 +35,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "commands.h"
#include "disptab.h"
-#include "indent.h"
-#include "intervals.h"
#include "blockinput.h"
-#include "process.h"
-
#include "syssignal.h"
+#include "systime.h"
#include "tparam.h"
#ifdef HAVE_WINDOW_SYSTEM
@@ -51,7 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fpending.h>
-#include <timespec.h>
#ifdef WINDOWSNT
#include "w32.h"
diff --git a/src/doc.c b/src/doc.c
index 68d4367182..694c159fc0 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/>. */
#include "lisp.h"
#include "character.h"
+#include "coding.h"
#include "buffer.h"
#include "disptab.h"
-#include "keyboard.h"
#include "keymap.h"
/* Buffer used for reading from documentation file. */
diff --git a/src/editfns.c b/src/editfns.c
index 12e5ca8c00..050eb2ac6e 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/>. */
#include <strftime.h>
#include <verify.h>
+#include "composite.h"
#include "intervals.h"
#include "character.h"
#include "buffer.h"
#include "coding.h"
-#include "frame.h"
#include "window.h"
#include "blockinput.h"
diff --git a/src/emacs.c b/src/emacs.c
index 3eff5a720e..b4052b851d 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/>. */
#include <config.h>
#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
@@ -59,13 +60,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include TERM_HEADER
#endif /* HAVE_WINDOW_SYSTEM */
-#include "commands.h"
+#include "coding.h"
#include "intervals.h"
#include "character.h"
#include "buffer.h"
#include "window.h"
-#include "systty.h"
#include "atimer.h"
#include "blockinput.h"
#include "syssignal.h"
diff --git a/src/fileio.c b/src/fileio.c
index 3155ef0edf..428093bdc4 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/>. */
#include <c-ctype.h>
#include "lisp.h"
-#include "intervals.h"
+#include "composite.h"
#include "character.h"
#include "buffer.h"
#include "coding.h"
@@ -51,7 +51,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "blockinput.h"
#include "region-cache.h"
#include "frame.h"
-#include "dispextern.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
diff --git a/src/filelock.c b/src/filelock.c
index cad6f83c1d..7f9b6e7f8e 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/>. */
#include <c-ctype.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
#include "coding.h"
-#include "systime.h"
#ifdef WINDOWSNT
#include <share.h>
#include <sys/socket.h> /* for fcntl */
diff --git a/src/fns.c b/src/fns.c
index dfd48a297a..f545066fb0 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/>. */
#include <config.h>
#include <unistd.h>
-#include <time.h>
-
#include <intprops.h>
#include <vla.h>
#include "lisp.h"
-#include "commands.h"
#include "character.h"
#include "coding.h"
+#include "composite.h"
#include "buffer.h"
-#include "keyboard.h"
-#include "keymap.h"
#include "intervals.h"
-#include "frame.h"
#include "window.h"
-#include "blockinput.h"
-#if defined (HAVE_X_WINDOWS)
-#include "xterm.h"
-#endif
static void sort_vector_copy (Lisp_Object, ptrdiff_t,
Lisp_Object [restrict], Lisp_Object [restrict]);
diff --git a/src/font.c b/src/font.c
index be55ce9bc7..016b7e0a88 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/>. */
#include "composite.h"
#include "fontset.h"
#include "font.h"
+#include "termhooks.h"
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
diff --git a/src/font.h b/src/font.h
index 43e67e98c0..1d13e1cb6b 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/>. */
#ifndef EMACS_FONT_H
#define EMACS_FONT_H
-#include "ccl.h"
-#include "frame.h"
+struct composition_it;
+struct face;
+struct glyph_string;
INLINE_HEADER_BEGIN
diff --git a/src/fontset.c b/src/fontset.c
index e735989bcb..9429d79b6b 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/>. */
#include "lisp.h"
#include "blockinput.h"
#include "character.h"
-#include "buffer.h"
#include "charset.h"
-#include "ccl.h"
-#include "keyboard.h"
#include "frame.h"
#include "dispextern.h"
-#include "intervals.h"
#include "fontset.h"
-#include "window.h"
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
#endif /* HAVE_WINDOW_SYSTEM */
-#include "termhooks.h"
#include "font.h"
/* FONTSET
diff --git a/src/frame.c b/src/frame.c
index 6d596a48e2..78f8ff71be 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/>. */
#include <c-ctype.h>
#include "lisp.h"
-#include "character.h"
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
@@ -34,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "buffer.h"
/* These help us bind and responding to switch-frame events. */
-#include "commands.h"
#include "keyboard.h"
#include "frame.h"
#include "blockinput.h"
@@ -42,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "termhooks.h"
#include "dispextern.h"
#include "window.h"
-#include "font.h"
#ifdef HAVE_WINDOW_SYSTEM
#include "fontset.h"
#endif
diff --git a/src/frame.h b/src/frame.h
index acac51448d..e7d3aab119 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -16,14 +16,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Don't multiply include: dispextern.h includes macterm.h which
- includes frame.h some emacs source includes both dispextern.h and
- frame.h. */
-
#ifndef EMACS_FRAME_H
#define EMACS_FRAME_H
-#include "dispextern.h"
#include "termhooks.h"
#include "window.h"
diff --git a/src/fringe.c b/src/fringe.c
index fcc5207b06..632fa0b25d 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/>. */
#include "frame.h"
#include "window.h"
#include "dispextern.h"
-#include "character.h"
#include "buffer.h"
#include "blockinput.h"
#include "termhooks.h"
diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index df3aa596f6..4326b775c8 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/>. */
#include <cairo-ft.h>
#include "lisp.h"
-#include "dispextern.h"
#include "xterm.h"
-#include "frame.h"
#include "blockinput.h"
-#include "character.h"
-#include "charset.h"
-#include "fontset.h"
#include "font.h"
#include "ftfont.h"
diff --git a/src/ftfont.c b/src/ftfont.c
index 15a815924c..fb1addb7a0 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/>. */
#include "lisp.h"
#include "dispextern.h"
-#include "frame.h"
-#include "blockinput.h"
#include "character.h"
#include "charset.h"
-#include "coding.h"
#include "composite.h"
-#include "fontset.h"
#include "font.h"
#include "ftfont.h"
diff --git a/src/ftxfont.c b/src/ftxfont.c
index cd2bf3e741..99b06f2b49 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/>. */
#include <X11/Xlib.h>
#include "lisp.h"
-#include "dispextern.h"
#include "xterm.h"
#include "frame.h"
#include "blockinput.h"
-#include "character.h"
-#include "charset.h"
-#include "fontset.h"
#include "font.h"
/* FTX font driver. */
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 69f635d411..2057f88530 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/>. */
#include <gio/gio.h>
#include "lisp.h"
#include "coding.h"
-#include "frame.h"
#include "termhooks.h"
#include "keyboard.h"
-#include "process.h"
/* This is a list, elements are triples (DESCRIPTOR FILE FLAGS CALLBACK) */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index ad71b9ccbc..701bcab706 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/>. */
#include <c-ctype.h>
#include "lisp.h"
+#include "dispextern.h"
+#include "frame.h"
+#include "systime.h"
#include "xterm.h"
#include "blockinput.h"
-#include "syssignal.h"
#include "window.h"
-#include "buffer.h"
#include "gtkutil.h"
#include "termhooks.h"
#include "keyboard.h"
-#include "charset.h"
#include "coding.h"
-#include "font.h"
#include <gdk/gdkkeysyms.h>
-#include "xsettings.h"
#ifdef HAVE_XFT
#include <X11/Xft/Xft.h>
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 34338db58f..0dbb4a1cdc 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/>. */
#include <gtk/gtk.h>
#include "../lwlib/lwlib-widget.h"
-#include "frame.h"
#include "xterm.h"
/* Minimum and maximum values used for GTK scroll bars */
diff --git a/src/image.c b/src/image.c
index 9970e5881e..928eb5cfa3 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
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#include "sysstdio.h"
+
+#include <fcntl.h>
+#include <stdio.h>
#include <unistd.h>
/* 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/>. */
#include "blockinput.h"
#include "systime.h"
#include <epaths.h>
-#include "character.h"
#include "coding.h"
#include "termhooks.h"
#include "font.h"
diff --git a/src/indent.c b/src/indent.c
index 330065b085..04837f8f51 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/>. */
#include "category.h"
#include "composite.h"
#include "indent.h"
-#include "keyboard.h"
#include "frame.h"
#include "window.h"
-#include "termchar.h"
#include "disptab.h"
#include "intervals.h"
#include "dispextern.h"
diff --git a/src/inotify.c b/src/inotify.c
index be8c1dd755..d1a80bbad1 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/>. */
#include "coding.h"
#include "process.h"
#include "keyboard.h"
-#include "character.h"
-#include "frame.h" /* Required for termhooks.h. */
#include "termhooks.h"
#include <errno.h>
diff --git a/src/insdel.c b/src/insdel.c
index a977b79bcc..24807b1e8f 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/>. */
#include <intprops.h>
#include "lisp.h"
+#include "composite.h"
#include "intervals.h"
#include "character.h"
#include "buffer.h"
#include "window.h"
-#include "blockinput.h"
#include "region-cache.h"
static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t,
diff --git a/src/intervals.c b/src/intervals.c
index 1c8dd41e6a..c272bae027 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/>. */
#include <intprops.h>
#include "lisp.h"
#include "intervals.h"
-#include "character.h"
#include "buffer.h"
#include "puresize.h"
-#include "keyboard.h"
#include "keymap.h"
/* Test for membership, allowing for t (actually any non-cons) to mean the
diff --git a/src/intervals.h b/src/intervals.h
index 5a7829de93..96e82055e9 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/>. */
#ifndef EMACS_INTERVALS_H
#define EMACS_INTERVALS_H
-#include "dispextern.h"
-
INLINE_HEADER_BEGIN
/* Basic data type for use of intervals. */
@@ -295,8 +293,6 @@ extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
extern void syms_of_textprop (void);
-#include "composite.h"
-
INLINE_HEADER_END
#endif /* EMACS_INTERVALS_H */
diff --git a/src/keyboard.c b/src/keyboard.c
index 966af69c97..1a78f6a705 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/>. */
#include <config.h>
-#include "sysstdio.h"
#include <sys/stat.h>
#include "lisp.h"
+#include "coding.h"
#include "termchar.h"
#include "termopts.h"
#include "frame.h"
@@ -34,13 +34,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "commands.h"
#include "character.h"
#include "buffer.h"
-#include "disptab.h"
#include "dispextern.h"
#include "syntax.h"
#include "intervals.h"
#include "keymap.h"
#include "blockinput.h"
-#include "puresize.h"
#include "systime.h"
#include "atimer.h"
#include "process.h"
diff --git a/src/keyboard.h b/src/keyboard.h
index 67afc3bc2b..98bc86b58e 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/>. */
#ifndef EMACS_KEYBOARD_H
#define EMACS_KEYBOARD_H
-#include "systime.h" /* for struct timespec, Time */
#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
#include "termhooks.h"
diff --git a/src/keymap.c b/src/keymap.c
index 81091f03d7..c988d12fe8 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/>. */
#include "commands.h"
#include "character.h"
#include "buffer.h"
-#include "charset.h"
#include "keyboard.h"
-#include "frame.h"
#include "termhooks.h"
#include "blockinput.h"
#include "puresize.h"
diff --git a/src/lread.c b/src/lread.c
index bceec4bb64..a98fa6199f 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/>. */
#include <math.h>
#include <stat-time.h>
#include "lisp.h"
+#include "dispextern.h"
#include "intervals.h"
#include "character.h"
#include "buffer.h"
@@ -39,7 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <epaths.h>
#include "commands.h"
#include "keyboard.h"
-#include "frame.h"
+#include "systime.h"
#include "termhooks.h"
#include "blockinput.h"
diff --git a/src/macros.c b/src/macros.c
index 1bf2cd7344..d963838069 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/>. */
#include "lisp.h"
#include "macros.h"
-#include "commands.h"
-#include "character.h"
-#include "buffer.h"
#include "window.h"
#include "keyboard.h"
diff --git a/src/menu.c b/src/menu.c
index dc82809629..74df43f6ce 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/>. */
#include <limits.h> /* for INT_MAX */
#include "lisp.h"
+#include "character.h"
+#include "coding.h"
#include "keyboard.h"
#include "keymap.h"
#include "frame.h"
#include "window.h"
#include "termhooks.h"
#include "blockinput.h"
-#include "dispextern.h"
#include "buffer.h"
#ifdef USE_X_TOOLKIT
diff --git a/src/menu.h b/src/menu.h
index de586a5e10..e89e93ec8e 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/>. */
#ifndef MENU_H
#define MENU_H
-#include "systime.h" /* for Time */
#include "../lwlib/lwlib-widget.h"
/* Bit fields used by terminal-specific menu_show_hook. */
diff --git a/src/minibuf.c b/src/minibuf.c
index e149e81941..31b69461bd 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/>. */
#include <binary-io.h>
#include "lisp.h"
-#include "commands.h"
#include "character.h"
#include "buffer.h"
-#include "dispextern.h"
#include "keyboard.h"
#include "frame.h"
#include "window.h"
-#include "syntax.h"
-#include "intervals.h"
#include "keymap.h"
-#include "termhooks.h"
#include "systty.h"
/* List of buffers for use as minibuffers.
diff --git a/src/print.c b/src/print.c
index 3c3dca7700..6f868ceff8 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/>. */
#include "lisp.h"
#include "character.h"
+#include "coding.h"
#include "buffer.h"
#include "charset.h"
-#include "keyboard.h"
#include "frame.h"
-#include "window.h"
#include "process.h"
-#include "dispextern.h"
#include "disptab.h"
-#include "termchar.h"
#include "intervals.h"
#include "blockinput.h"
-#include "termhooks.h" /* For struct terminal. */
-#include "font.h"
#include <c-ctype.h>
#include <float.h>
#include <ftoastr.h>
+struct terminal;
+
/* Avoid actual stack overflow in print. */
static ptrdiff_t print_depth;
diff --git a/src/process.c b/src/process.c
index 55f31a0267..dc93b86cee 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/>. */
#include "coding.h"
#include "process.h"
#include "frame.h"
-#include "termhooks.h"
#include "termopts.h"
-#include "commands.h"
#include "keyboard.h"
#include "blockinput.h"
-#include "dispextern.h"
-#include "composite.h"
#include "atimer.h"
#include "sysselect.h"
#include "syssignal.h"
diff --git a/src/region-cache.c b/src/region-cache.c
index 937f3d09aa..1383acd925 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/>. */
#include <stdio.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
#include "region-cache.h"
diff --git a/src/scroll.c b/src/scroll.c
index 7f5b73bd77..2534ab051e 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/>. */
#include "lisp.h"
#include "termchar.h"
#include "dispextern.h"
-#include "keyboard.h"
#include "frame.h"
-#include "window.h"
#include "termhooks.h"
/* All costs measured in characters.
diff --git a/src/search.c b/src/search.c
index 8c9714eb6f..e39ba3dbf0 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/>. */
#include <config.h>
#include "lisp.h"
-#include "category.h"
#include "character.h"
#include "buffer.h"
#include "syntax.h"
#include "charset.h"
#include "region-cache.h"
-#include "commands.h"
#include "blockinput.h"
#include "intervals.h"
diff --git a/src/sound.c b/src/sound.c
index 9a365c71ef..09ab48c58e 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/>. */
#include <errno.h>
#include "lisp.h"
-#include "dispextern.h"
#include "atimer.h"
#include "syssignal.h"
/* END: Common Includes */
diff --git a/src/syntax.c b/src/syntax.c
index 6bfb3b7601..1dcb3a5d15 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/>. */
#include <sys/types.h>
#include "lisp.h"
-#include "commands.h"
#include "character.h"
#include "buffer.h"
-#include "keymap.h"
#include "regex.h"
-
#include "syntax.h"
#include "intervals.h"
#include "category.h"
diff --git a/src/sysdep.c b/src/sysdep.c
index 836cc271b1..1af323eb8d 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/>. */
#include "keyboard.h"
#include "frame.h"
-#include "window.h"
#include "termhooks.h"
#include "termchar.h"
#include "termopts.h"
-#include "dispextern.h"
#include "process.h"
-#include "cm.h" /* for reset_sys_modes */
+#include "cm.h"
#ifdef WINDOWSNT
#include <direct.h>
diff --git a/src/systime.h b/src/systime.h
index 315f9d1ee6..a7c182a283 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -83,8 +83,8 @@ extern struct timeval make_timeval (struct timespec) ATTRIBUTE_CONST;
extern void set_waiting_for_input (struct timespec *);
/* When lisp.h is not included Lisp_Object is not defined (this can
- happen when this files is used outside the src directory). */
-#ifdef EMACS_LISP_H
+ happen when this file is used outside the src directory). */
+#ifdef emacs
/* Emacs uses the integer list (HI LO US PS) to represent the time
(HI << LO_TIME_BITS) + LO + US / 1e6 + PS / 1e12. */
diff --git a/src/term.c b/src/term.c
index 5acc47395d..9b1e7cad4b 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/>. */
#include "keymap.h"
#include "blockinput.h"
#include "syssignal.h"
-#include "systty.h"
-#include "intervals.h"
#ifdef MSDOS
#include "msdos.h"
static int been_here = -1;
@@ -56,10 +54,6 @@ static int been_here = -1;
#endif
#include "cm.h"
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-
#include "menu.h"
/* The name of the default console device. */
diff --git a/src/terminal.c b/src/terminal.c
index 80c6aa20be..27594e52a7 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/>. */
#include <stdio.h>
#include "lisp.h"
+#include "character.h"
#include "frame.h"
#include "termchar.h"
#include "termhooks.h"
-#include "charset.h"
-#include "coding.h"
#include "keyboard.h"
#if HAVE_STRUCT_UNIPAIR_UNICODE
diff --git a/src/textprop.c b/src/textprop.c
index 6758d4dfee..1995ff65ce 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/>. */
#include "lisp.h"
#include "intervals.h"
-#include "character.h"
#include "buffer.h"
#include "window.h"
diff --git a/src/undo.c b/src/undo.c
index 750bc8afff..e0924b2b98 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/>. */
#include <config.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
-#include "commands.h"
-#include "window.h"
/* Last buffer for which undo information was recorded. */
/* BEWARE: This is not traced by the GC, so never dereference it! */
diff --git a/src/unexsol.c b/src/unexsol.c
index cfd515ff50..0f84099d39 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -6,9 +6,7 @@
#include <dlfcn.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
-#include "charset.h"
#include "coding.h"
void
diff --git a/src/widget.c b/src/widget.c
index 48872f5593..d0c3e60cfa 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/>. */
*/
#include <config.h>
+#include "widget.h"
+
#include <stdio.h>
#include "lisp.h"
#include "xterm.h"
-
-#include "keyboard.h"
#include "frame.h"
-#include "window.h"
-
-#include "dispextern.h"
-#include "blockinput.h"
#include <X11/StringDefs.h>
#include <X11/IntrinsicP.h>
@@ -50,10 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <X11/ShellP.h>
#include "../lwlib/lwlib.h"
-#include "character.h"
-#include "font.h"
-
-
static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2);
static void EmacsFrameDestroy (Widget widget);
static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs);
diff --git a/src/widgetprv.h b/src/widgetprv.h
index 6cbbbd617f..dc0124887a 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/>. */
#include <X11/IntrinsicP.h>
#include <X11/CoreP.h>
-#include "widget.h"
typedef struct {
struct frame* frame; /* the *emacs* frame object */
diff --git a/src/window.c b/src/window.c
index 3566f6e646..8ed0f32a69 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/>. */
#include <stdio.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
#include "keyboard.h"
#include "keymap.h"
-#include "menu.h"
#include "frame.h"
#include "window.h"
#include "commands.h"
@@ -36,7 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "disptab.h"
#include "dispextern.h"
#include "blockinput.h"
-#include "intervals.h"
#include "termhooks.h" /* For FRAME_TERMINAL. */
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
diff --git a/src/xdisp.c b/src/xdisp.c
index 986e13f43b..bfd3a8299a 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/>. */
#include "lisp.h"
#include "atimer.h"
+#include "composite.h"
#include "keyboard.h"
+#include "systime.h"
#include "frame.h"
#include "window.h"
#include "termchar.h"
@@ -303,13 +305,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "indent.h"
#include "commands.h"
#include "keymap.h"
-#include "macros.h"
#include "disptab.h"
#include "termhooks.h"
#include "termopts.h"
#include "intervals.h"
#include "coding.h"
-#include "process.h"
#include "region-cache.h"
#include "font.h"
#include "fontset.h"
diff --git a/src/xfaces.c b/src/xfaces.c
index a3d122fbf4..6bbd541715 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/>. */
#include "lisp.h"
#include "character.h"
-#include "charset.h"
-#include "keyboard.h"
#include "frame.h"
-#include "termhooks.h"
#ifdef USE_MOTIF
#include <Xm/Xm.h>
@@ -237,7 +234,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "dispextern.h"
#include "blockinput.h"
#include "window.h"
-#include "intervals.h"
#include "termchar.h"
#include "font.h"
diff --git a/src/xfns.c b/src/xfns.c
index 8251f939b8..db87fcc94f 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/>. */
#include "lisp.h"
#include "xterm.h"
-#include "menu.h"
#include "frame.h"
#include "window.h"
-#include "character.h"
#include "buffer.h"
-#include "intervals.h"
#include "dispextern.h"
#include "keyboard.h"
#include "blockinput.h"
-#include <epaths.h>
#include "charset.h"
#include "coding.h"
-#include "fontset.h"
-#include "systime.h"
#include "termhooks.h"
-#include "atimer.h"
-#include "termchar.h"
#include "font.h"
#include <sys/types.h>
diff --git a/src/xfont.c b/src/xfont.c
index d5a7d64e69..671b1050c9 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/>. */
#include <X11/Xlib.h>
#include "lisp.h"
-#include "dispextern.h"
#include "xterm.h"
#include "frame.h"
#include "blockinput.h"
#include "character.h"
#include "charset.h"
-#include "fontset.h"
#include "font.h"
-#include "ccl.h"
/* X core font driver. */
diff --git a/src/xftfont.c b/src/xftfont.c
index 851edb69fa..956231ee42 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/>. */
#include <X11/Xft/Xft.h>
#include "lisp.h"
-#include "dispextern.h"
#include "xterm.h"
#include "frame.h"
#include "blockinput.h"
-#include "character.h"
#include "charset.h"
#include "composite.h"
-#include "fontset.h"
#include "font.h"
#include "ftfont.h"
diff --git a/src/xgselect.c b/src/xgselect.c
index 0b62d3e825..55e1ffcabf 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/>. */
#include <glib.h>
#include <errno.h>
#include <stdbool.h>
-#include <timespec.h>
-#include "frame.h"
#include "blockinput.h"
+#include "systime.h"
/* `xg_select' is a `pselect' replacement. Why do we need a separate function?
1. Timeouts. Glib and Gtk rely on timer events. If we did pselect
diff --git a/src/xgselect.h b/src/xgselect.h
index ada2376c98..524fff7d35 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/>. */
#define XGSELECT_H
#include "lisp.h"
-#include <time.h>
#include "sysselect.h"
+struct timespec;
+
extern int xg_select (int max_fds,
fd_set *rfds, fd_set *wfds, fd_set *efds,
struct timespec const *timeout,
diff --git a/src/xmenu.c b/src/xmenu.c
index 4379cddaf2..be6e41de63 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/>. */
#include "lisp.h"
#include "keyboard.h"
-#include "keymap.h"
#include "frame.h"
+#include "systime.h"
#include "termhooks.h"
#include "window.h"
#include "blockinput.h"
-#include "character.h"
#include "buffer.h"
-#include "charset.h"
#include "coding.h"
#include "sysselect.h"
@@ -63,8 +61,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#endif
-#include "dispextern.h"
-
#ifdef HAVE_X_WINDOWS
/* Defining HAVE_MULTILINGUAL_MENU would mean that the toolkit menu
code accepts the Emacs internal encoding. */
diff --git a/src/xml.c b/src/xml.c
index 9e68fff2b4..fc77f22b86 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/>. */
#include <libxml/HTMLparser.h>
#include "lisp.h"
-#include "character.h"
#include "buffer.h"
diff --git a/src/xrdb.c b/src/xrdb.c
index 2235b4535d..ce6e7d21ed 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/>. */
#include <pwd.h>
#endif
-#ifdef USE_MOTIF
-/* For Vdouble_click_time. */
-#include "keyboard.h"
-#endif
-
/* X file search path processing. */
diff --git a/src/xselect.c b/src/xselect.c
index 9a7e6974cd..9d178a50d7 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/>. */
#include "lisp.h"
#include "xterm.h" /* for all of the X includes */
-#include "dispextern.h" /* frame.h seems to want this */
#include "frame.h" /* Need this to get the X window of selected_frame */
#include "blockinput.h"
-#include "character.h"
-#include "buffer.h"
-#include "process.h"
#include "termhooks.h"
#include "keyboard.h"
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 3b06f7133c..b84f2ac58d 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/>. */
#include <stdio.h>
#include "lisp.h"
-#include "systime.h"
-#include "sysselect.h"
#include "frame.h"
#include "termhooks.h"
#include "xterm.h"
diff --git a/src/xterm.c b/src/xterm.c
index fcd81a162c..691ad05efe 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/>. */
#include "lisp.h"
#include "blockinput.h"
-#include "syssignal.h"
/* This may include sys/types.h, and that somehow loses
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/>. */
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
-/* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */
-/* #include <sys/param.h> */
-
-#include "charset.h"
#include "character.h"
#include "coding.h"
+#include "composite.h"
#include "frame.h"
#include "dispextern.h"
#include "fontset.h"
@@ -71,17 +67,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "termopts.h"
#include "termchar.h"
#include "emacs-icon.h"
-#include "disptab.h"
#include "buffer.h"
#include "window.h"
#include "keyboard.h"
-#include "intervals.h"
-#include "process.h"
#include "atimer.h"
-#include "keymap.h"
#include "font.h"
#include "xsettings.h"
-#include "xgselect.h"
#include "sysselect.h"
#include "menu.h"