bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename


From: Ivan Andrus
Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename
Date: Wed, 22 Jun 2016 09:22:01 -0600

On Sun, Jun 19, 2016 at 3:14 PM, Alan Mackenzie <acm@muc.de> wrote:
> Hello, Ivan.
>
> In article <mailman.202.1464109329.1216.bug-gnu-emacs@gnu.org> you wrote:
>> Starting with emacs -Q, Y is not fontified in the snippet below, whereas
>> X is.
>
>> -Ivan
>
>
>> template <typename X, typename... Y>
>> 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<typename... Args> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]