From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Emacs Wrestling Match: lisp.h vs rest of the includes Date: Mon, 9 Aug 2010 23:43:52 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1281390814 12694 80.91.229.12 (9 Aug 2010 21:53:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Aug 2010 21:53:34 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 09 23:53:33 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OiaHX-000255-SP for ged-emacs-devel@m.gmane.org; Mon, 09 Aug 2010 23:53:32 +0200 Original-Received: from localhost ([127.0.0.1]:46842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiaB6-0001d5-Tw for ged-emacs-devel@m.gmane.org; Mon, 09 Aug 2010 17:46:40 -0400 Original-Received: from [140.186.70.92] (port=48192 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oia9I-0000z9-MD for emacs-devel@gnu.org; Mon, 09 Aug 2010 17:46:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oia8j-00089J-74 for emacs-devel@gnu.org; Mon, 09 Aug 2010 17:44:15 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:40947) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oia8j-00088w-1J for emacs-devel@gnu.org; Mon, 09 Aug 2010 17:44:13 -0400 Original-Received: by gwj16 with SMTP id 16so4824156gwj.0 for ; Mon, 09 Aug 2010 14:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=T4jQKZGLwFwWFlY7HZ5sTmhA57i3cHqee0Phyer7/Mc=; b=WyCuMg+FvdBOp9mQFluimpttKohI03aFot2FDF2fric2SRWWZoxRjs+Ma1aKKOghS6 2wSSWyPYmsshFoYGYLeBd2CIs/zhiKRn8rJx6B2vdy9jsrjWdU3WPQudY6yqZ6ZV+gSJ BW794s1XYLia+OM3WpJRmGxnkkP9/8I9fZ9AE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=vUmXKWKbXsd0CvfmCjMUrrkcwQi7dq9lOfC302dIzr9nJB8vfJMWSVXSU/IXF6gjvd mzOngguPpFLlnk8mXvbxXQD3/vLkgpKGiBno/I8+4WE/5SXSi7+g+l/Ioez28bfjNg6/ BI2t94aFvefaab2uTyJ/F8Bac79ZcSLZq4iiY= Original-Received: by 10.90.75.11 with SMTP id x11mr1546089aga.2.1281390252144; Mon, 09 Aug 2010 14:44:12 -0700 (PDT) Original-Received: by 10.231.162.11 with HTTP; Mon, 9 Aug 2010 14:43:52 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128513 Archived-At: Now that Dan is doing a wonderful job of cleaning up the sources by building them under different -W settings to detect problems, I've been inspired to do the same thing. Building under -Wredundant-decls generates *a lot* of warnings. Some of them are difficult to avoid, for example the ones generated by EXFUN. Others are easier; see the attached patch, for starters. It fixes quite a few warnings generated by declarations duplicated in lisp.h and the relevant includes (for example, redisplay_preserve_echo_area is both in lisp.h and dispextern.h). The problem with these changes is that they represent moving things in the opposite direction of what I think would be right: from the includes to lisp.h (not that I'm moving anything to lisp.h, just keeping the declaration on lisp.h and removing the other one). I'm sure there are a lot of historical reasons why lisp.h is such humongous mass of disparate content (compilation time being, I suspect, the first and main reason in the past). But now that lisp.h is listed in the dependencies of all .c sources, that's not so relevant anymore. I think we should make an effort to *remove* things from lisp.h and back to where they belong. In some cases it will mean adding more .h dependencies to some sources, and perhaps just for one, or a few, external declarations. But it will be cleaner and more maintenable IMO. =C2=A0 =C2=A0 Juanma =3D=3D=3D modified file 'src/dispextern.h' --- src/dispextern.h 2010-08-09 09:35:21 +0000 +++ src/dispextern.h 2010-08-09 10:18:06 +0000 @@ -2925,7 +2925,6 @@ void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *); void mark_window_display_accurate (Lisp_Object, int); -void redisplay_preserve_echo_area (int); int set_cursor_from_row (struct window *, struct glyph_row *, struct glyph_matrix *, int, int, int, int); void init_iterator (struct it *, struct window *, EMACS_INT, @@ -2946,7 +2945,6 @@ int in_display_vector_p (struct it *); int frame_mode_line_height (struct frame *); void highlight_trailing_whitespace (struct frame *, struct glyph_row *); -extern Lisp_Object Qtool_bar; extern Lisp_Object Vshow_trailing_whitespace; extern int mode_line_in_non_selected_windows; extern int redisplaying_p; @@ -3088,7 +3086,6 @@ void unrequest_sigio (void); int tabs_safe_p (int); void init_baud_rate (int); -void init_sigio (int); /* Defined in xfaces.c */ @@ -3133,7 +3130,6 @@ int compute_char_face (struct frame *, int, Lisp_Object); void free_all_realized_faces (Lisp_Object); void free_realized_face (struct frame *, struct face *); -extern Lisp_Object Qforeground_color, Qbackground_color; extern Lisp_Object Qframe_set_background_mode; extern char unspecified_fg[], unspecified_bg[]; @@ -3245,8 +3241,6 @@ void update_single_window (struct window *, int); void do_pending_window_change (int); void change_frame_size (struct frame *, int, int, int, int, int); -void init_display (void); -void syms_of_display (void); extern Lisp_Object Qredisplay_dont_pause; void spec_glyph_lookup_face (struct window *, GLYPH *); =3D=3D=3D modified file 'src/frame.h' --- src/frame.h 2010-08-05 23:15:24 +0000 +++ src/frame.h 2010-08-09 03:05:28 +0000 @@ -825,7 +825,7 @@ list_var =3D XCDR (list_var)) -extern Lisp_Object Qframep, Qframe_live_p; +extern Lisp_Object Qframe_live_p; extern Lisp_Object Qtty, Qtty_type; extern Lisp_Object Qtty_color_mode; extern Lisp_Object Qterminal, Qterminal_live_p; @@ -854,9 +854,6 @@ extern Lisp_Object Vmouse_highlight; =0C -/* The currently selected frame. */ - -extern Lisp_Object selected_frame; /* Value is a pointer to the selected frame. If the selected frame isn't live, abort. */ @@ -1045,7 +1042,6 @@ extern Lisp_Object Qborder_color, Qborder_width; extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; extern Lisp_Object Qcursor_color, Qcursor_type; -extern Lisp_Object Qfont; extern Lisp_Object Qbackground_color, Qforeground_color; extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; extern Lisp_Object Qinternal_border_width; @@ -1070,15 +1066,11 @@ extern Lisp_Object Qheight, Qwidth; extern Lisp_Object Qminibuffer, Qmodeline; extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; -extern Lisp_Object Qvisible; extern Lisp_Object Qdisplay_type; extern Lisp_Object Qbackground_mode; extern Lisp_Object Qx_resource_name; -extern Lisp_Object Qleft, Qright, Qtop, Qbox, Qbottom; -extern Lisp_Object Qdisplay; - extern Lisp_Object Qrun_hook_with_args; #ifdef HAVE_WINDOW_SYSTEM @@ -1096,8 +1088,6 @@ /* These are in frame.c */ -extern Lisp_Object Vx_resource_name; -extern Lisp_Object Vx_resource_class; extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode; =3D=3D=3D modified file 'src/w32.h' --- src/w32.h 2010-01-13 08:35:10 +0000 +++ src/w32.h 2010-08-09 02:39:33 +0000 @@ -139,7 +139,6 @@ extern void term_w32select (void); extern void syms_of_w32menu (void); extern void globals_of_w32menu (void); -extern void syms_of_fontset (void); extern int _sys_read_ahead (int fd); extern int _sys_wait_accept (int fd);