From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Flymake support for C/C++ Date: Thu, 12 Oct 2017 19:46:20 +0100 Message-ID: <87tvz4mcg3.fsf@gmail.com> References: <87zi8wmmhw.fsf@gmail.com> <20171012175044.GA6106@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1507834003 29526 195.159.176.226 (12 Oct 2017 18:46:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2017 18:46:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: eliz@gnu.org, npostavs@users.sourceforge.net, sdl.web@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 20:46:36 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 1e2iV9-0006dh-2I for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2017 20:46:35 +0200 Original-Received: from localhost ([::1]:46791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2iVG-0007ri-F2 for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2017 14:46:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2iV8-0007q5-J2 for emacs-devel@gnu.org; Thu, 12 Oct 2017 14:46:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2iV7-0000cZ-M4 for emacs-devel@gnu.org; Thu, 12 Oct 2017 14:46:34 -0400 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:47368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2iV2-0000U8-Nu; Thu, 12 Oct 2017 14:46:28 -0400 Original-Received: by mail-wm0-x22f.google.com with SMTP id t69so15634483wmt.2; Thu, 12 Oct 2017 11:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=usxnBlsY1a8nNVT2UVZJcr0XgURGcRu+DcD2p/8H+PI=; b=b1viO3elo5HPx8nMDmC/nKbeWizCHmRhkQjjwu/rK14UGiIhO/+7SEZ/eGpNgk4v/T sN1XMyeDlF3ToJWj8FX35ZVIkYXSYvz2whS0l7cbU32wMBaaKwVXh7qhe0g+OH624P9r ZYe2ohnLtthpw32gPi0ROk0cufWiobbjy+L8OwiZE0cIjF+wWR5+JWSHCTIVNJUtyHZl 54D3P2zZHVwwvW5+HfRq9MOs3Xr1DL9ROEOkl0DzrghaBmWGBi34mrW3tF+lCvnSoN5Q vfpkfEimiPlsW2j8Qou0ZqXme84db17+w4em00Ov5hDpYXTCrgizg3RMSDZetSdkwU6u LzVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=usxnBlsY1a8nNVT2UVZJcr0XgURGcRu+DcD2p/8H+PI=; b=W0OYg8Nauf3RgV0j94xLVPfWyYQRUaRfZGb4yIOPn2OE6mHWrj5tBg1cHPhSJGB7kM yztp4axFn95phlaTeoNug5jt1QsiZrY43WOBICyj79Gtzbfi02eDMUyFvoXFgiWlKHB6 ywvSHtYP0+nj9Nxymdi3VpwFs1Y9R+QCLZ6PQhj1UHyp/pOfzvW58dpnb+lHNLm43+nD Tp/GSPtg1OVsfPdGEv1cTRBCfJbxkJ02oYPi8jy0PGSwRnzl75rndFLXittxBRf/rI/Q tBLQenvfhjcK/Ad0Nm5YuRQl2MXSI/9Sk9cSnWiXj2bA/K3+xIAXg7SnODsDGC4DqBBV Ogkw== X-Gm-Message-State: AMCzsaW+KsG/SdGaRSUWOY+Vd2doa48L1hVT13HHmxgt3eKmGfa+fc+g VgLDtGYy/3NVvW8QIdbHZGQ= X-Google-Smtp-Source: AOwi7QDvOAVbcTKYBcSLhjg1X6tYNpoRbx070NX6P4zoDP5d4eUv6mQH2cjDmEVlhzBThpvF0AeamQ== X-Received: by 10.28.7.82 with SMTP id 79mr2382683wmh.4.1507833987517; Thu, 12 Oct 2017 11:46:27 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id f10sm10853196wrg.20.2017.10.12.11.46.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 11:46:26 -0700 (PDT) In-Reply-To: <20171012175044.GA6106@ACM> (Alan Mackenzie's message of "Thu, 12 Oct 2017 17:50:44 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f 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:219427 Archived-At: Hi Alan, Thanks for the quick reply. Alan Mackenzie writes: > I must admit not to being too keen on CC Mode changing like this; it > would spoil the unity of purpose of the mode. I've glanced through the > new code, but can't quite see why it needs to be an integral part of CC > Mode. Does setting a variable in the mode function make it an "integral part"? > 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)? I may be wrong, but I thought hooks were reserved for the user and should be empty by default. But even if they weren't I don't think it would work: c-initialization-hook doesn't work, as flymake-diagnostic-functions is a hook which needs a buffer-local value. c-mode-common-hook is where a user would turn on `flymake-mode'. I, for example, have this in my .emacs, which is the recommended way to turn on a minor mode: (add-hook 'c-mode-common-hook 'flymake-mode) If the setup is also moved to c-mode-common-hook, then this won't work (because flymake-mode activation comes before its setup). > If there is any reason why it couldn't work on a CC Mode hook, Absolutely no reason, but those two don't seem to fit. Perhaps some new hook run before c-mode-common-hook. > I'd far rather solve that reason (thus making the solution available > for other libraries too, and pres