From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Ivan Andrus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 May 2016 17:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23610 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23610@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146410929128988 (code B ref -1); Tue, 24 May 2016 17:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 May 2016 17:01:31 +0000 Received: from localhost ([127.0.0.1]:36615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Fhz-0007XU-BK for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Fhy-0007XH-1O for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Fhn-0003sR-3T for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhn-0003sL-0T for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhi-0001YU-Og for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Fhh-0003rY-Ou for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:14 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:33441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhh-0003rS-Ja for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:13 -0400 Received: by mail-oi0-x234.google.com with SMTP id k23so36759274oih.0 for ; Tue, 24 May 2016 10:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=YWZOD6V5dy5POdTo+xQIHFyXbP4eQOjjnaJF64NNqsE=; b=s0dN75gfjaMvr8e9lDuN3ffrGvQXmPfjlKCMLSWhzA25IsqTt4vguAbsz2C5s9jLbR YBUE2MiMQVOyyQoil3QSN0ZZ2ISFo4NE3UI1b9G1lo85JnX6M1OtekGhtnqB8cyC8+7r VJb4iv3FIZOrJBKwZZFjXPwKv/PZf4aMPiKWlEgnphM2S2ktKfDSjxj7BsP6uWYI8h1g Qu4SHjh7LWB5sbrtMGxVrkJs4KPm723CweLCK+DSRIawRAhkkgPIT+E8ta+8839dJL38 9tuuhQyz2Y6s7/N6GXNGt4aNt9c2FmkaEGJhwxUFe+GrA/eDMP55Qv1tlSfovc4uwd2s q66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=YWZOD6V5dy5POdTo+xQIHFyXbP4eQOjjnaJF64NNqsE=; b=bPr2i1Pd7ajERhP1FfgiuAJzfoYqHamRAdgrEWM5g1nQUu0Koo8W4T2bgP5WcQzF83 GSFiQowPtYICnJ20PNycGRWi1mFe9MN5n39SlaP1eSWSrPaHPZRJnzjPsa2gUPMbRAzk +/C3DhHQ3T1sieACWELPEMHzdh3FF4kqCXUSqXzEzMiyMsXbl4FRcZAK7ww8Nhy61lPz PlSKdMGd0/9LuGqaz7JpngG3T3YNrK8DOeEDibgqYOBS2waJas9IdpeBexHHkm/ZQReA UNmHY5RcKiNw1+UKoWCzJbNBGRetxRmx/DPIvXPuPJ3wGO6/2nwhmdBE61Bbk+jtCN0E JCNw== X-Gm-Message-State: ALyK8tJfgxsJGexZCtHXoAklsymB3y6Oq+xcQKgND0/1FEj30Yr/OmrV4sOXBFLcjNdX0ifuVeaKTj43yRcFvg== MIME-Version: 1.0 X-Received: by 10.157.34.12 with SMTP id o12mr3405429ota.55.1464109272422; Tue, 24 May 2016 10:01:12 -0700 (PDT) Received: by 10.202.65.8 with HTTP; Tue, 24 May 2016 10:01:12 -0700 (PDT) Date: Tue, 24 May 2016 11:01:12 -0600 Message-ID: From: Ivan Andrus Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Starting with emacs -Q, Y is not fontified in the snippet below, whereas X is. -Ivan template class bob { }; In GNU Emacs 25.0.94.2 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 Version 10.11.4 (Build 15E65)) of 2016-05-22 built on iandrus-osx Repository revision: ae8352b8219b3d40f70fda8986ae86fbef7322fb Windowing system distributor 'Apple', version 10.3.1404 Configured using: 'configure --with-ns --with-modules PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' Configured features: JPEG RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C++/l Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: The mark is not set now, so there is no region Undo! is undefined user-error: The mark is not set now, so there is no region user-error: No mark set in this buffer Mark set Undo! Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cl-extra help-mode cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 216680 9514) (symbols 48 22190 2) (miscs 40 50 243) (strings 32 20775 6226) (string-bytes 1 712665) (vectors 16 35464) (vector-slots 8 687847 4136) (floats 8 163 110) (intervals 56 332 8) (buffers 976 11)) From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename References: Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 30 May 2016 12:58:01 +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: To: Ivan Andrus Cc: 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146461304116107 (code B ref 23610); Mon, 30 May 2016 12:58:01 +0000 Received: (at 23610) by debbugs.gnu.org; 30 May 2016 12:57:21 +0000 Received: from localhost ([127.0.0.1]:46959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Mky-0004Bj-T8 for submit@debbugs.gnu.org; Mon, 30 May 2016 08:57:21 -0400 Received: from mail.muc.de ([193.149.48.3]:42061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Mkx-0004Ba-6T for 23610@debbugs.gnu.org; Mon, 30 May 2016 08:57:19 -0400 Received: (qmail 37914 invoked by uid 3782); 30 May 2016 12:57:17 -0000 Date: 30 May 2016 12:57:17 -0000 Message-ID: <20160530125717.37913.qmail@mail.muc.de> From: Alan Mackenzie Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE (amd64)) X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hello, Ivan. In article you wrote: > Starting with emacs -Q, Y is not fontified in the snippet below, whereas > X is. I'm not all that familiar with variadic templates. In the declaration below, is the "..." token syntactically part of "typename..." or is better regarded as part of "... Y"? I also need to get a feel for what keywords can come before the "...". Obviously "typename", but what about things like "class"? Do you know of a good web page where these things are explained completely and concisely, yet readably? If so, please tell me! > -Ivan > template > class bob { > }; > In GNU Emacs 25.0.94.2 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 > Version 10.11.4 (Build 15E65)) > of 2016-05-22 built on iandrus-osx > Repository revision: ae8352b8219b3d40f70fda8986ae86fbef7322fb > Windowing system distributor 'Apple', version 10.3.1404 > Configured using: > 'configure --with-ns --with-modules > PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 30 May 2016 13:51:01 +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: To: Alan Mackenzie Cc: Ivan Andrus , 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146461621020793 (code B ref 23610); Mon, 30 May 2016 13:51:01 +0000 Received: (at 23610) by debbugs.gnu.org; 30 May 2016 13:50:10 +0000 Received: from localhost ([127.0.0.1]:46984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Na6-0005PJ-36 for submit@debbugs.gnu.org; Mon, 30 May 2016 09:50:10 -0400 Received: from relaycp04.dominioabsoluto.net ([217.116.26.100]:53256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Na2-0005Oh-BH for 23610@debbugs.gnu.org; Mon, 30 May 2016 09:50:08 -0400 Received: from smtp.movistar.es (smtp09.acens.net [86.109.99.133]) by relaycp04.dominioabsoluto.net (Postfix) with ESMTP id 98114642CB; Mon, 30 May 2016 15:49:59 +0200 (CEST) X-CTCH-RefID: str=0001.0A0B0201.574C4507.018D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Received: from qcore (217.125.182.141) by smtp.movistar.es (8.6.122.03) (authenticated as 981711563$telefonica.net) id 571A57FE021346BC; Mon, 30 May 2016 13:49:59 +0000 From: =?UTF-8?Q?=C3=93scar?= Fuentes References: <20160530125717.37913.qmail@mail.muc.de> Date: Mon, 30 May 2016 15:49:57 +0200 In-Reply-To: <20160530125717.37913.qmail@mail.muc.de> (Alan Mackenzie's message of "30 May 2016 12:57:17 -0000") Message-ID: <87oa7nbqpm.fsf@wanadoo.es> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hello Alan. Alan Mackenzie writes: > I'm not all that familiar with variadic templates. In the declaration > below, is the "..." token syntactically part of "typename..." or is > better regarded as part of "... Y"? Neiter, I'll say. It is legal to omit the name of the parameter pack (the `Y' in the example). > I also need to get a feel for what keywords can come before the "...". > Obviously "typename", but what about things like "class"? Yes, `class' and `typename' are interchangeable here. There is also `sizeof': template struct Foo { void print() { printf("Intantiated with %d parameters.\n", sizeof...(Ts)); } }; int main() { Foo foo; foo.print(); return 0; } Prints Intantiated with 2 parameters. > Do you know of a good web page where these things are explained > completely and concisely, yet readably? If so, please tell me! Try this, which is short and precise: http://en.cppreference.com/w/cpp/language/parameter_pack From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 30 May 2016 15:26: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: To: =?UTF-8?Q?=C3=93scar?= Fuentes Cc: Ivan Andrus , 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146462193830096 (code B ref 23610); Mon, 30 May 2016 15:26:02 +0000 Received: (at 23610) by debbugs.gnu.org; 30 May 2016 15:25:38 +0000 Received: from localhost ([127.0.0.1]:47741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7P4T-0007pL-Vx for submit@debbugs.gnu.org; Mon, 30 May 2016 11:25:38 -0400 Received: from mail.muc.de ([193.149.48.3]:11635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7P4S-0007pD-3R for 23610@debbugs.gnu.org; Mon, 30 May 2016 11:25:36 -0400 Received: (qmail 61801 invoked by uid 3782); 30 May 2016 15:25:34 -0000 Received: from acm.muc.de (p548C74F7.dip0.t-ipconnect.de [84.140.116.247]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 30 May 2016 17:25:33 +0200 Received: (qmail 5010 invoked by uid 1000); 30 May 2016 15:25:39 -0000 Date: Mon, 30 May 2016 15:25:39 +0000 Message-ID: <20160530152538.GA3629@acm.fritz.box> References: <20160530125717.37913.qmail@mail.muc.de> <87oa7nbqpm.fsf@wanadoo.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87oa7nbqpm.fsf@wanadoo.es> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hello, Óscar. Thanks for your post! On Mon, May 30, 2016 at 03:49:57PM +0200, Óscar Fuentes wrote: > Hello Alan. > Alan Mackenzie writes: > > I'm not all that familiar with variadic templates. In the declaration > > below, is the "..." token syntactically part of "typename..." or is > > better regarded as part of "... Y"? > Neither, I'll say. > It is legal to omit the name of the parameter pack (the `Y' in the > example). > > I also need to get a feel for what keywords can come before the "...". > > Obviously "typename", but what about things like "class"? > Yes, `class' and `typename' are interchangeable here. There is also > `sizeof': I thought there might be something like that. ;-) > template struct Foo { > void print() { > printf("Instantiated with %d parameters.\n", sizeof...(Ts)); > } > }; > int main() { > Foo foo; > foo.print(); > return 0; > } > Prints > Intantiated with 2 parameters. > > Do you know of a good web page where these things are explained > > completely and concisely, yet readably? If so, please tell me! > Try this, which is short and precise: > http://en.cppreference.com/w/cpp/language/parameter_pack That looks like exactly what I need. Thanks very much! -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename References: 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: To: Ivan Andrus Cc: 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146637088521779 (code B ref 23610); Sun, 19 Jun 2016 21:15:02 +0000 Received: (at 23610) by debbugs.gnu.org; 19 Jun 2016 21:14:45 +0000 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 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 Received: (qmail 86831 invoked by uid 3782); 19 Jun 2016 21:14:40 -0000 Date: 19 Jun 2016 21:14:40 -0000 Message-ID: <20160619211440.86830.qmail@mail.muc.de> From: Alan Mackenzie Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE-p4 (amd64)) X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) 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). From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Ivan Andrus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 22 Jun 2016 15:23: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: To: Alan Mackenzie Cc: 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146660893120819 (code B ref 23610); Wed, 22 Jun 2016 15:23:02 +0000 Received: (at 23610) by debbugs.gnu.org; 22 Jun 2016 15:22:11 +0000 Received: from localhost ([127.0.0.1]:51313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFjyk-0005Pi-UE for submit@debbugs.gnu.org; Wed, 22 Jun 2016 11:22:11 -0400 Received: from mail-vk0-f54.google.com ([209.85.213.54]:32820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFjyh-0005PS-Sd for 23610@debbugs.gnu.org; Wed, 22 Jun 2016 11:22:10 -0400 Received: by mail-vk0-f54.google.com with SMTP id d185so66495685vkg.0 for <23610@debbugs.gnu.org>; Wed, 22 Jun 2016 08:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NHLYz4rYd+tVel0hxu2G8xAUL4lSnX5m+rNQaOo/5nY=; b=W0jnkO4n69abqJLDTjcLclgU8X18TaE+ylwEFwZkNNtNwpTmSgSHnO0mKQUq71vzfY AQatCX9iEpPoET+g12tAd1yk16VJhyEakhqzOVgXwY+qLduC35JjafvPlLiElsNoce60 qA1xBMErO49vw5uc6Knit02QOmM99FbALGBD/DJK3cdm+McrJAhM19uWS6kG6KlXbtxE 2W0XCRzVN/kQqFSy9A7gjh2rCt6ic8m75tVucljSeLa53cknfSo6n9OOkl1UwFb1CEaZ o8Ec+GZXKjA5BnN72eBfr0XiSE5t5scaMFKNhXwFDcfClYhcoTjQg/eDmH07Ykg1Zcdx Gh3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NHLYz4rYd+tVel0hxu2G8xAUL4lSnX5m+rNQaOo/5nY=; b=BX9QOdwWh9F/vsuG1OTDloe6YNzylBRbDjV59wSkYfbkasO/yKrWdeP08Yxe+sbunG RF+XGS1HN+c9FfNJuzXxXXoBU0f/iqPgaCqKlRwv6+LiQJ8DG9gtXPMXmsgISWdyXVxD 9DXjk11evGFDmssR1z0AWYo96pUvnuEB3Aci+kK0aGorevh4B15V4YrlMc+Kz360cUEL r1Vd1BPokAbM7HvVPiD1J5AspWNVFuCwWceKCZoQgNVbiswdftDY+0XL/Ne2j3GqvtUc VcwKTvuEsTnKUxzXu2EMTPbCCUam93w4ySlGeh/hGZibL3JUBcDOjUHU1UH3DSJmX4kJ A3Cg== X-Gm-Message-State: ALyK8tKUwGwGYMvjvUlTMUccpG9xt/1mPLBOsmZUP/mhvV65Kd/8jdGjittY9NNu2yjLxJPoM34mwoXdT266MA== X-Received: by 10.159.34.229 with SMTP id 92mr10415957uan.150.1466608922182; Wed, 22 Jun 2016 08:22:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.28.5 with HTTP; Wed, 22 Jun 2016 08:22:01 -0700 (PDT) In-Reply-To: <20160619211440.86830.qmail@mail.muc.de> References: <20160619211440.86830.qmail@mail.muc.de> From: Ivan Andrus Date: Wed, 22 Jun 2016 09:22:01 -0600 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sun, Jun 19, 2016 at 3:14 PM, Alan Mackenzie wrote: > 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. It looks pretty good. I didn't notice this before, but the following example from Wikipedia is fontified differently if the ... is removed from before the `args`. In that case args is fontified with `font-lock-variable-name-face`. template inline void expand(Args&&... args) { pass( some_function(args)... ); } FWIW, I've seen similar mis-fontifications before (without ...) and it hasn't bothered me too much. I just found a reproducible case, so I guess I'll open a bug for it. Thanks for working on this. The raw string support is awesome! -Ivan From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 30 Jun 2016 14:37:01 +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: To: Ivan Andrus Cc: 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.14672973912370 (code B ref 23610); Thu, 30 Jun 2016 14:37:01 +0000 Received: (at 23610) by debbugs.gnu.org; 30 Jun 2016 14:36:31 +0000 Received: from localhost ([127.0.0.1]:60959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bId4w-0000cA-Q1 for submit@debbugs.gnu.org; Thu, 30 Jun 2016 10:36:30 -0400 Received: from mail.muc.de ([193.149.48.3]:10804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bId4v-0000c0-2E for 23610@debbugs.gnu.org; Thu, 30 Jun 2016 10:36:29 -0400 Received: (qmail 44000 invoked by uid 3782); 30 Jun 2016 14:36:27 -0000 Received: from acm.muc.de (p4FC460AB.dip0.t-ipconnect.de [79.196.96.171]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 30 Jun 2016 16:36:26 +0200 Received: (qmail 5763 invoked by uid 1000); 30 Jun 2016 14:36:36 -0000 Date: Thu, 30 Jun 2016 14:36:36 +0000 Message-ID: <20160630143636.GD3082@acm.fritz.box> References: <20160619211440.86830.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello, Ivan. On Wed, Jun 22, 2016 at 09:22:01AM -0600, Ivan Andrus wrote: > On Sun, Jun 19, 2016 at 3:14 PM, Alan Mackenzie wrote: > > 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. > It looks pretty good. I didn't notice this before, but the following example > from Wikipedia is fontified differently if the ... is removed from before the > `args`. In that case args is fontified with `font-lock-variable-name-face`. > template inline void expand(Args&&... args) { > pass( some_function(args)... ); > } What is this "&&" operator? It cannot be a logical and, and doesn't look like anything to do with a move constructor. I've tried, and failed, to find an explanation in http://en.cppreference.com/w/cpp/language. I didn't find and explanation in the article "variadic templates" in wikipedia either. A pointer to a web page explaining it would be much appreciated. I'm tempted to commit the patch as it is at the moment, but feel I ought to understand this "&&" first. > FWIW, I've seen similar mis-fontifications before (without ...) and it hasn't > bothered me too much. I just found a reproducible case, so I guess I'll > open a bug for it. > Thanks for working on this. The raw string support is awesome! Thanks! There've recently been one or two bugs fixed for raw string support. The corrections are in the Emacs master branch. > -Ivan -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: John Yates Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 30 Jun 2016 15:11: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: To: Alan Mackenzie Cc: Ivan Andrus , 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.14672994215884 (code B ref 23610); Thu, 30 Jun 2016 15:11:02 +0000 Received: (at 23610) by debbugs.gnu.org; 30 Jun 2016 15:10:21 +0000 Received: from localhost ([127.0.0.1]:60985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIdbh-0001Wq-Eq for submit@debbugs.gnu.org; Thu, 30 Jun 2016 11:10:21 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:38642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIdbf-0001WZ-Le for 23610@debbugs.gnu.org; Thu, 30 Jun 2016 11:10:19 -0400 Received: by mail-it0-f50.google.com with SMTP id h190so73427702ith.1 for <23610@debbugs.gnu.org>; Thu, 30 Jun 2016 08:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ENESfR7ra+vOCv4TvnC29RPr/tlmaa3FQBcidZM1ifM=; b=oUz2uCmGreBuaCoPRLLQNrZWKQRiKtTfccmn6Wfxx7QozPt/mSnvrS0T9B0O301EpN /QryJ6rDbvvmT2tfCaWlHZCvQK0Qvvg+KF4hZ9tLcKMaMXQuWRAk4MyMqYmQFb28Bi1X xEQWKeTDncvmvHplvm/gtZYR++7ocI7iq9jmkHY6KlX3gYHA0z3tgJel9TeTN8ePRW9T wtA6+6R+gY2DWnXcSNOYzGi/OSRRCTS+cxF+Mf+hqpW50dXGfyY8pQKTMmI1F6cMzUIE vzAe179tibYsGoDY+j4izR7TIl5FfbaolCHTPzO82LR9qQxujmijm/cDPbjc0lxJujF5 4CSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ENESfR7ra+vOCv4TvnC29RPr/tlmaa3FQBcidZM1ifM=; b=XTLkNqj37VXU8BRE7VCa5Q10Yknnbx7Tpp3oQzBvj4VzTyjwaB+zhlD4DPOosrd/x0 7cW0ZafDH4L1O1NN9Eiir/7cnGSc8UJjsEuy6ns7t21/MGfCQJypGXJWQSz7i+suMbec Xa/ecENJWMtZaUXzLilgYfxxPMUOwjwO9uqNRC4SLplPLoenveAwGj90Ijr5Ya62oFmX a/UPfjgiLaRUT00607cRQaHPHXDuj7XTbW3Et+7ZhRZ6xK2UJ0Zh21GfsQJjj2E5SeTu pHlin2CEkFd4SLEvBfJ5zbMOZWKiBMw/MBBPBeaalIzsGr5XQ/piyMxRAUQFpVDQ+D2M 8j8g== X-Gm-Message-State: ALyK8tJ5fV53RexrWmO46EteDFvRPOzW3P6j88PvzlOmxRoyBXGvo4mn6G9wNBc68V7La7YO85idaLvvxZ18Wg== X-Received: by 10.36.111.81 with SMTP id x78mr26395110itb.6.1467299413892; Thu, 30 Jun 2016 08:10:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.184.129 with HTTP; Thu, 30 Jun 2016 08:10:13 -0700 (PDT) In-Reply-To: <20160630143636.GD3082@acm.fritz.box> References: <20160619211440.86830.qmail@mail.muc.de> <20160630143636.GD3082@acm.fritz.box> From: John Yates Date: Thu, 30 Jun 2016 11:10:13 -0400 X-Google-Sender-Auth: EhFhzphPG1MzrbemcG4hV98TOR8 Message-ID: Content-Type: multipart/alternative; boundary=001a11436de8582711053680443b X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11436de8582711053680443b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jun 30, 2016 at 10:36 AM, Alan Mackenzie wrote: > What is this "&&" operator? =E2=80=8BIt is an "rvalue reference". /john=E2=80=8B --=20 John Yates 109 Chandler St, #1 Boston, MA 02116 --001a11436de8582711053680443b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= hu, Jun 30, 2016 at 10:36 AM, Alan Mackenzie <acm@muc.de> wrote:
What is this "&&" operat= or?

=E2=80=8BIt is an "rvalue reference".
=

=
/john=E2=80=8B



--
<= div>John Yates
109 Chandler St, #1
Boston, MA 02116=
--001a11436de8582711053680443b-- From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 30 Jun 2016 16:48: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: To: John Yates Cc: Ivan Andrus , 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146730522516149 (code B ref 23610); Thu, 30 Jun 2016 16:48:02 +0000 Received: (at 23610) by debbugs.gnu.org; 30 Jun 2016 16:47:05 +0000 Received: from localhost ([127.0.0.1]:32771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIf7J-0004CO-Fx for submit@debbugs.gnu.org; Thu, 30 Jun 2016 12:47:05 -0400 Received: from mail.muc.de ([193.149.48.3]:17296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIf7H-0004C4-AI for 23610@debbugs.gnu.org; Thu, 30 Jun 2016 12:47:04 -0400 Received: (qmail 76625 invoked by uid 3782); 30 Jun 2016 16:47:01 -0000 Received: from acm.muc.de (p4FC460AB.dip0.t-ipconnect.de [79.196.96.171]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 30 Jun 2016 18:47:00 +0200 Received: (qmail 6398 invoked by uid 1000); 30 Jun 2016 16:47:10 -0000 Date: Thu, 30 Jun 2016 16:47:10 +0000 Message-ID: <20160630164710.GE3082@acm.fritz.box> References: <20160619211440.86830.qmail@mail.muc.de> <20160630143636.GD3082@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello, John. On Thu, Jun 30, 2016 at 11:10:13AM -0400, John Yates wrote: > On Thu, Jun 30, 2016 at 10:36 AM, Alan Mackenzie wrote: > > What is this "&&" operator? > It is an "rvalue reference". Thanks, that's exactly what I needed to know. I've now got these "Args&&... args" expressions fontifying. > /john > -- > John Yates > 109 Chandler St, #1 > Boston, MA 02116 -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 00:35:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 30 Jun 2016 17:25: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: To: Ivan Andrus Cc: 23610@debbugs.gnu.org Received: via spool by 23610-submit@debbugs.gnu.org id=B23610.146730747019994 (code B ref 23610); Thu, 30 Jun 2016 17:25:02 +0000 Received: (at 23610) by debbugs.gnu.org; 30 Jun 2016 17:24:30 +0000 Received: from localhost ([127.0.0.1]:32784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIfhW-0005CQ-EF for submit@debbugs.gnu.org; Thu, 30 Jun 2016 13:24:30 -0400 Received: from mail.muc.de ([193.149.48.3]:60834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIfhQ-0005C8-GI for 23610@debbugs.gnu.org; Thu, 30 Jun 2016 13:24:28 -0400 Received: (qmail 85675 invoked by uid 3782); 30 Jun 2016 17:24:23 -0000 Received: from acm.muc.de (p4FC460AB.dip0.t-ipconnect.de [79.196.96.171]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 30 Jun 2016 19:24:22 +0200 Received: (qmail 6942 invoked by uid 1000); 30 Jun 2016 17:24:32 -0000 Date: Thu, 30 Jun 2016 17:24:32 +0000 Message-ID: <20160630172432.GF3082@acm.fritz.box> References: <20160619211440.86830.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello again, Ivan. On Wed, Jun 22, 2016 at 09:22:01AM -0600, Ivan Andrus wrote: > On Sun, Jun 19, 2016 at 3:14 PM, Alan Mackenzie wrote: > > 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. > It looks pretty good. I didn't notice this before, but the following example > from Wikipedia is fontified differently if the ... is removed from before the > `args`. In that case args is fontified with `font-lock-variable-name-face`. > template inline void expand(Args&&... args) { > pass( some_function(args)... ); > } OK. I think the patch below fixes it. Please try it out and report back. (Same instructions about recompilation of CC Mode as last time apply, since further macros in cc-langs.el have been modified). Please note that the patch below is complete in itself, it isn't incremental, based on the last patch. It's based on a current Emacs master branch. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 48b9e5e..cc60175 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -7090,6 +7090,9 @@ c-forward-type (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 --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 4d36684..b903190 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1329,6 +1329,14 @@ 'c-opt-op-identitier-prefix (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 @@ -2958,6 +2966,10 @@ 'c-opt-op-identitier-prefix "\\)" "\\([^=]\\|$\\)") c++ (concat "\\(" + "&&" + "\\|" + "\\.\\.\\." + "\\|" "[*(&]" "\\|" (c-lang-const c-type-decl-prefix-key) > -Ivan -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Jun 23 00:35:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ivan Andrus Subject: bug#23610: closed (Re: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename) Message-ID: References: <20160723151314.GC2295@acm.fritz.box> X-Gnu-PR-Message: they-closed 23610 X-Gnu-PR-Package: emacs,cc-mode Reply-To: 23610@debbugs.gnu.org Date: Sat, 23 Jul 2016 15:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1469286842-31768-1" This is a multi-part message in MIME format... ------------=_1469286842-31768-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #23610: 25.0.94; c++-mode doesn't fontify typename... like typename which was filed against the emacs,cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 23610@debbugs.gnu.org. --=20 23610: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23610 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1469286842-31768-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23610-done) by debbugs.gnu.org; 23 Jul 2016 15:14:01 +0000 Received: from localhost ([127.0.0.1]:35048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQycq-0008G4-OP for submit@debbugs.gnu.org; Sat, 23 Jul 2016 11:14:00 -0400 Received: from mail.muc.de ([193.149.48.3]:52972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQycp-0008Fw-1A for 23610-done@debbugs.gnu.org; Sat, 23 Jul 2016 11:13:59 -0400 Received: (qmail 2665 invoked by uid 3782); 23 Jul 2016 15:13:57 -0000 Received: from acm.muc.de (p4FC46332.dip0.t-ipconnect.de [79.196.99.50]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 23 Jul 2016 17:13:57 +0200 Received: (qmail 20925 invoked by uid 1000); 23 Jul 2016 15:13:14 -0000 Date: Sat, 23 Jul 2016 15:13:14 +0000 To: 23610-done@debbugs.gnu.org Subject: Re: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Message-ID: <20160723151314.GC2295@acm.fritz.box> References: <20160530125717.37913.qmail@mail.muc.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160530125717.37913.qmail@mail.muc.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 23610-done Cc: Ivan Andrus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Bug fixed in master. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1469286842-31768-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 May 2016 17:01:31 +0000 Received: from localhost ([127.0.0.1]:36615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Fhz-0007XU-BK for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Fhy-0007XH-1O for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Fhn-0003sR-3T for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhn-0003sL-0T for submit@debbugs.gnu.org; Tue, 24 May 2016 13:01:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhi-0001YU-Og for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Fhh-0003rY-Ou for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:14 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:33441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Fhh-0003rS-Ja for bug-gnu-emacs@gnu.org; Tue, 24 May 2016 13:01:13 -0400 Received: by mail-oi0-x234.google.com with SMTP id k23so36759274oih.0 for ; Tue, 24 May 2016 10:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=YWZOD6V5dy5POdTo+xQIHFyXbP4eQOjjnaJF64NNqsE=; b=s0dN75gfjaMvr8e9lDuN3ffrGvQXmPfjlKCMLSWhzA25IsqTt4vguAbsz2C5s9jLbR YBUE2MiMQVOyyQoil3QSN0ZZ2ISFo4NE3UI1b9G1lo85JnX6M1OtekGhtnqB8cyC8+7r VJb4iv3FIZOrJBKwZZFjXPwKv/PZf4aMPiKWlEgnphM2S2ktKfDSjxj7BsP6uWYI8h1g Qu4SHjh7LWB5sbrtMGxVrkJs4KPm723CweLCK+DSRIawRAhkkgPIT+E8ta+8839dJL38 9tuuhQyz2Y6s7/N6GXNGt4aNt9c2FmkaEGJhwxUFe+GrA/eDMP55Qv1tlSfovc4uwd2s q66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=YWZOD6V5dy5POdTo+xQIHFyXbP4eQOjjnaJF64NNqsE=; b=bPr2i1Pd7ajERhP1FfgiuAJzfoYqHamRAdgrEWM5g1nQUu0Koo8W4T2bgP5WcQzF83 GSFiQowPtYICnJ20PNycGRWi1mFe9MN5n39SlaP1eSWSrPaHPZRJnzjPsa2gUPMbRAzk +/C3DhHQ3T1sieACWELPEMHzdh3FF4kqCXUSqXzEzMiyMsXbl4FRcZAK7ww8Nhy61lPz PlSKdMGd0/9LuGqaz7JpngG3T3YNrK8DOeEDibgqYOBS2waJas9IdpeBexHHkm/ZQReA UNmHY5RcKiNw1+UKoWCzJbNBGRetxRmx/DPIvXPuPJ3wGO6/2nwhmdBE61Bbk+jtCN0E JCNw== X-Gm-Message-State: ALyK8tJfgxsJGexZCtHXoAklsymB3y6Oq+xcQKgND0/1FEj30Yr/OmrV4sOXBFLcjNdX0ifuVeaKTj43yRcFvg== MIME-Version: 1.0 X-Received: by 10.157.34.12 with SMTP id o12mr3405429ota.55.1464109272422; Tue, 24 May 2016 10:01:12 -0700 (PDT) Received: by 10.202.65.8 with HTTP; Tue, 24 May 2016 10:01:12 -0700 (PDT) Date: Tue, 24 May 2016 11:01:12 -0600 Message-ID: Subject: 25.0.94; c++-mode doesn't fontify typename... like typename From: Ivan Andrus To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Starting with emacs -Q, Y is not fontified in the snippet below, whereas X is. -Ivan template class bob { }; In GNU Emacs 25.0.94.2 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 Version 10.11.4 (Build 15E65)) of 2016-05-22 built on iandrus-osx Repository revision: ae8352b8219b3d40f70fda8986ae86fbef7322fb Windowing system distributor 'Apple', version 10.3.1404 Configured using: 'configure --with-ns --with-modules PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' Configured features: JPEG RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C++/l Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: The mark is not set now, so there is no region Undo! is undefined user-error: The mark is not set now, so there is no region user-error: No mark set in this buffer Mark set Undo! Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cl-extra help-mode cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 216680 9514) (symbols 48 22190 2) (miscs 40 50 243) (strings 32 20775 6226) (string-bytes 1 712665) (vectors 16 35464) (vector-slots 8 687847 4136) (floats 8 163 110) (intervals 56 332 8) (buffers 976 11)) ------------=_1469286842-31768-1--