From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23476: 25.0.93; Visiting C files on master signals an error Date: Mon, 9 May 2016 11:07:13 +0000 Message-ID: <20160509110713.GA5316@acm.fritz.box> References: <834maafhtx.fsf@gnu.org> <867ff56cpr.fsf@gmail.com> <83oa8hepuj.fsf@gnu.org> <20160507175030.GA4161@acm.fritz.box> <83mvo1enoe.fsf@gnu.org> <20160507185225.GB3660@acm.fritz.box> <83lh3lelw1.fsf@gnu.org> <83k2j5ekdc.fsf@gnu.org> <20160507204022.GE3660@acm.fritz.box> <83inyoeek8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1462792128 22194 80.91.229.3 (9 May 2016 11:08:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 May 2016 11:08:48 +0000 (UTC) Cc: 23476@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 09 13:08:32 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1azj2t-0006xS-Ed for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2016 13:08:16 +0200 Original-Received: from localhost ([::1]:40605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azj2s-0001rb-Em for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 May 2016 07:08:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azj2n-0001n4-Sa for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 07:08:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azj2g-0001BL-Mw for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 07:08:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azj2g-0001B7-JE for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 07:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1azj2g-0005JF-DW for bug-gnu-emacs@gnu.org; Mon, 09 May 2016 07:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2016 11:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23476 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23476-submit@debbugs.gnu.org id=B23476.146279203920360 (code B ref 23476); Mon, 09 May 2016 11:08:02 +0000 Original-Received: (at 23476) by debbugs.gnu.org; 9 May 2016 11:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:43800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azj1z-0005IK-4j for submit@debbugs.gnu.org; Mon, 09 May 2016 07:07:19 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:10895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azj1w-0005IB-Sf for 23476@debbugs.gnu.org; Mon, 09 May 2016 07:07:17 -0400 Original-Received: (qmail 68060 invoked by uid 3782); 9 May 2016 11:07:15 -0000 Original-Received: from acm.muc.de (p4FC46F8C.dip0.t-ipconnect.de [79.196.111.140]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 09 May 2016 13:07:13 +0200 Original-Received: (qmail 5384 invoked by uid 1000); 9 May 2016 11:07:13 -0000 Content-Disposition: inline In-Reply-To: <83inyoeek8.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118019 Archived-At: Hello, Eli. On Sun, May 08, 2016 at 06:48:23PM +0300, Eli Zaretskii wrote: > > Date: Sat, 7 May 2016 20:40:22 +0000 > > Cc: 23476@debbugs.gnu.org > > From: Alan Mackenzie > > > One way is to turn on by default the feature that fontifies these > > > macros correctly. Why does it have to be off by default? > > The feature is dependent on _configuration_: the '("IF_LINT") is that > > configuration. > But the IF_LINT part is AFAIU the _only_ part of the configuration > that the user needs to supply. All the rest, including the forms to > evaluate, doesn't have to be in file-local variables. Right? Right. I've amended C(etc.) Mode to use the new :after-hook parameter to define-derived-mode which I committed yesterday. The eval form which used to be in .dir-locals.el is now run by C Mode after the mode hooks (and file/dir local variables stuff) have been done. > And a list of strings can easily be a safe local variable, so if you > devise a variable that will accept lists like '("IF_LINT"), it could > easily be specified without prompting those annoying questions. Done. So now, Emacs master will now accept the "IF_LINT" value from .dir-locals.el without asking the user any questions. (I haven't commited the change yet, though.) However, visiting a master C source file using the emacs-25 branch would still ask the question. One way to get round this would be to add the safe-local-variable stuff into emacs-25, but nobody wants to change emacs-25 at this late stage. > Moreover, we could support these particular macros by default: I doubt > that Paul invented them for Emacs, and even if he did, they are by now > probably used elsewhere, so it should be good to have their support > built-in. To me, this doesn't feel like the Right Thing to do. A user might easily define a macro (or even a variable) called IF_LINT and be puzzled as to why it wasn't fontifying or indenting correctly. > Am I missing something? For the master branch, making IF_LINT a noise macro by default wouldn't gain us anything. For visiting a master branch C file from the emacs-25 branch, this wouldn't help. > > I've reverted the change to .dir-locals.el which caused the problem. > > This should take the pressure off, so that we can find a good solution. > Thanks. I hope the considerations above will allow to restore the > feature soon. Just how bad would it be to get the question about unsafe local variables when visiting master C files from emacs-25 emacs -Q? If the answer is "not too bad", I can also commit the change to .dir-locals.el. Otherwise, probably the best thing is just to commit the changes to CC Mode for now, and amend .dir-locals.el after the Emacs 25 release, when people will mostly be using the code in the master branch for development. What do you say? -- Alan Mackenzie (Nuremberg, Germany).