From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Flymake support for C/C++ Date: Sun, 3 Jun 2018 16:43:10 +0000 Message-ID: <20180603164310.GC5860@ACM> References: <20171012175044.GA6106@ACM> <87tvz4mcg3.fsf@gmail.com> <20171012203953.GB6106@ACM> <87infkm53o.fsf@gmail.com> <20180601210708.GA6771@ACM> <87in72p3yq.fsf@gmail.com> <20180602103317.GA4392@ACM> <87h8mlt5so.fsf@gmail.com> <20180603154544.GB5860@ACM> <87y3fvrg0r.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1528044339 15880 195.159.176.226 (3 Jun 2018 16:45:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Jun 2018 16:45:39 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) Cc: eliz@gnu.org, npostavs@users.sourceforge.net, sdl.web@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 03 18:45:34 2018 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 1fPW8M-00041h-EW for ged-emacs-devel@m.gmane.org; Sun, 03 Jun 2018 18:45:34 +0200 Original-Received: from localhost ([::1]:35950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPWAT-0001WU-F8 for ged-emacs-devel@m.gmane.org; Sun, 03 Jun 2018 12:47:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPW9j-0001WN-C2 for emacs-devel@gnu.org; Sun, 03 Jun 2018 12:47:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPW9e-0005eO-Hh for emacs-devel@gnu.org; Sun, 03 Jun 2018 12:46:59 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:15796 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1fPW9e-0005cR-5z for emacs-devel@gnu.org; Sun, 03 Jun 2018 12:46:54 -0400 Original-Received: (qmail 83061 invoked by uid 3782); 3 Jun 2018 16:46:53 -0000 Original-Received: from acm.muc.de (p5B146781.dip0.t-ipconnect.de [91.20.103.129]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 03 Jun 2018 18:46:50 +0200 Original-Received: (qmail 26643 invoked by uid 1000); 3 Jun 2018 16:43:10 -0000 Content-Disposition: inline In-Reply-To: <87y3fvrg0r.fsf@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:225967 Archived-At: Hello, Joćo. On Sun, Jun 03, 2018 at 17:28:20 +0100, Joćo Tįvora wrote: > Hello Alan, > Alan Mackenzie writes: > > OK. But a little way down there's a > > (setq-local flymake-proc-allowed-file-name-masks nil) > > , which will create a buffer-local free variable if the variable doesn't > > already exist. This is somewhat untidy. Not so important, either. > Very much so. I will remove this line, it's not needed. Thanks > > How about putting all these details in an alist in flymake-mode.el, > > the key being the major-mode > That's something that flymake-mode.el had *before* the Emacs 26.1 > redesign. It's a natural approach when a package lives outside Emacs, > but obviously, suffers from the big drawback that flymake-mode.el itself > must be changed everytime a major-mode is added to Emacs, or to GNU > ELPA, or anywhere in the emacs ecosphere. I suppose so. > >> (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t) > > As I suggested above, why not simply build that information into > > flymake.el at build (or customisation) time without troubling CC Mode at > > all? > No, for the reasons detailed above. As it stands, I propose to add that > single to cc-mode.el. Oh, OK. I suppose we've spent enough time arguing it out. So feel free to add that line to the c-mode code. You'll probably want to add a similar line to c++-mode, and possibly to the other modes, too, maybe some time in the future. I'll copy it into the standalone CC Mode, too, sometime. > As argued already: > 1. it is much shorter than, say cc-mode's configuration of imenu, or > font-lock Well, font-lock is an essential part of CC Mode, but I take the point about imenu. > 2. in contrast to those two, because it uses add-hook, it will never > break or error even if flymake-mode.el is removed, reworked, etc.. OK. > > c-initialization-hook is run exactly once, when CC Mode itself is > > loaded. Maybe this could be useful here. > Unfortunately, it doesn't meet criteria (b), so I can't use it. Fine. I think we're agreed. Yes? Have a good evening! > Joćo -- Alan Mackenzie (Nuremberg, Germany).