From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Flymake support for C/C++ Date: Thu, 12 Oct 2017 17:03:10 -0400 Message-ID: References: <87zi8wmmhw.fsf@gmail.com> <20171012175044.GA6106@ACM> <20171012204523.GC6106@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507842197 19527 195.159.176.226 (12 Oct 2017 21:03:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2017 21:03:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , eliz@gnu.org, emacs-devel@gnu.org, sdl.web@gmail.com, npostavs@users.sourceforge.net To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 23:03:12 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2kdI-00043c-4T for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2017 23:03:08 +0200 Original-Received: from localhost ([::1]:47236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kdP-0006tM-A2 for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2017 17:03:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kd9-0006mj-E3 for emacs-devel@gnu.org; Thu, 12 Oct 2017 17:03:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kd5-0002yB-HE for emacs-devel@gnu.org; Thu, 12 Oct 2017 17:02:59 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:44547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kd5-0002y5-Co; Thu, 12 Oct 2017 17:02:55 -0400 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v9CL2qqQ026671; Thu, 12 Oct 2017 17:02:52 -0400 Original-Received: by lechazo.home (Postfix, from userid 20848) id 7494064469; Thu, 12 Oct 2017 17:03:10 -0400 (EDT) In-Reply-To: <20171012204523.GC6106@ACM> (Alan Mackenzie's message of "Thu, 12 Oct 2017 20:45:23 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6135=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6135> : inlines <6129> : streams <1766974> : uri <2515528> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219431 Archived-At: >> > What is stopping the needed setup and initialisation being in a >> > function to be added to one of the mode's hooks: say c-mode-common-hook, >> > or even c-initialization-hook (which are documented in the CC Mode >> > manual)? >> The same could apply to font-lock support in CC-mode, or indentation >> support in CC-mode, or imenu support, or ... > Font-lock and indentation support are essential to the major mode. But > all of these, bar indentation, are connected to major modes via hooks of > one sort or another. AFAICT, imenu support in CC-mode is enabled by having the major mode function explicitly calling cc-imenu-init, not via some kind of hook. Maybe all you want is for flymake support to be moved to cc-flymake.el and then calls to `cc-flymake-init` be added to the relevant major mode functions? >> I'm not saying that the flymake support for C code has to be in CC-mode, >> but I think it's a natural place for it. > What does Flymake mode do, anyway? It runs a code-checker in the background and highlights the source code with the various error/warnings found. It's very much like flyspell except design to check code sanity rather spelling. I think nowadays Emacs should strive to enable flymake automatically as much as possible. It's currently not really possible because *very* few major modes support it, and because for most major modes you can't get it to work without some user intervention (typically we need to have some knowledge of the overall project organization in order to know how this file relates to others, in C code typically we need at least information about -I and -D compilation options). But for Emacs-27, we should at the very least aim to enable it in emacs-lisp-mode (where checking can be done without needing extra user intervention). > There's no documentation for it in the Emacs manual, It's definitely in the manual in the emacs-26 branch. Stefan