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#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Date: 19 Jun 2016 21:14:40 -0000 Organization: muc.de e.V. Message-ID: <20160619211440.86830.qmail@mail.muc.de> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1466370930 14780 80.91.229.3 (19 Jun 2016 21:15:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2016 21:15:30 +0000 (UTC) Cc: 23610@debbugs.gnu.org To: Ivan Andrus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 19 23:15:21 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 1bEk3p-00064V-5i for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jun 2016 23:15:17 +0200 Original-Received: from localhost ([::1]:40075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEk3o-00083J-A9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jun 2016 17:15:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEk3e-0007yN-ID for bug-gnu-emacs@gnu.org; Sun, 19 Jun 2016 17:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEk3a-0008AT-EH for bug-gnu-emacs@gnu.org; Sun, 19 Jun 2016 17:15:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEk3a-0008AJ-AZ; Sun, 19 Jun 2016 17:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bEk3a-0005g0-2R; Sun, 19 Jun 2016 17:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 19 Jun 2016 21:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23610 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146637088521779 (code B ref 23610); Sun, 19 Jun 2016 21:15:02 +0000 Original-Received: (at 23610) by debbugs.gnu.org; 19 Jun 2016 21:14:45 +0000 Original-Received: from localhost ([127.0.0.1]:46716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEk3J-0005fD-8C for submit@debbugs.gnu.org; Sun, 19 Jun 2016 17:14:45 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:56283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEk3H-0005f0-Pr for 23610@debbugs.gnu.org; Sun, 19 Jun 2016 17:14:44 -0400 Original-Received: (qmail 86831 invoked by uid 3782); 19 Jun 2016 21:14:40 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE-p4 (amd64)) 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:119797 Archived-At: Hello, Ivan. In article you wrote: > Starting with emacs -Q, Y is not fontified in the snippet below, whereas > X is. > -Ivan > template > class bob { > }; [ .... ] The following patch is a first attempt to fontify parameter packs. After applying it, please be sure either to recompile CC Mode entirely, or first to compile cc-langs.el (which contains macros), and then all three of cc-fonts.el, cc-engine.el, and cc-mode.el. It seems to fontify the "Y" above OK. I've tried it on a stock example out of Wikipedia, and that works. Could you try it out on your code, please, and let me know how well it works. Here's the patch: diff -r f70569e7cf8e cc-engine.el --- a/cc-engine.el Sun Jun 19 11:54:55 2016 +0000 +++ b/cc-engine.el Sun Jun 19 21:05:32 2016 +0000 @@ -6910,6 +6910,9 @@ (while (cond ((looking-at c-decl-hangon-key) (c-forward-keyword-clause 1)) + ((looking-at c-pack-key) + (goto-char (match-end 1)) + (c-forward-syntactic-ws)) ((and c-opt-cpp-prefix (looking-at c-noise-macro-with-parens-name-re)) (c-forward-noise-clause)))) diff -r f70569e7cf8e cc-langs.el --- a/cc-langs.el Sun Jun 19 11:54:55 2016 +0000 +++ b/cc-langs.el Sun Jun 19 21:05:32 2016 +0000 @@ -1304,6 +1304,14 @@ (c-lang-defvar c-stmt-delim-chars-with-comma (c-lang-const c-stmt-delim-chars-with-comma)) +(c-lang-defconst c-pack-ops + "Ops which signal C++11's \"parameter pack\"" + t nil + c++ '("...")) +(c-lang-defconst c-pack-key + t (c-make-keywords-re 'appendable (c-lang-const c-pack-ops))) +(c-lang-defvar c-pack-key (c-lang-const c-pack-key)) + (c-lang-defconst c-auto-ops ;; Ops which signal C++11's new auto uses. t nil -- Alan Mackenzie (Nuremberg, Germany).