unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Naofumi Yasufuku <naofumi@yasufuku.dev>
Cc: 57318-done@debbugs.gnu.org
Subject: bug#57318: 29.0.50; c++-mode: Functions are shown as variables: partial template specialization
Date: Wed, 31 Aug 2022 19:26:19 +0000	[thread overview]
Message-ID: <Yw+12xTaoIEvH6+1@ACM> (raw)
In-Reply-To: <m11qsw8kqz.fsf@yasufuku.dev>

Hello, Naofumi.

On Thu, Sep 01, 2022 at 01:01:56 +0900, Naofumi Yasufuku wrote:
> Hello Alan,

[ .... ]

> > When this dynamic binding is instead at nil (rather than t), the
> > fontification works properly, with functions fontified as functions.
> > The reason for this faulty binding was fixing a bug report where
> > scrolling a buffer containing lots of templates was very slow.  Binding
> > c-restricted-<>-arglists to t "solved" that slowness.


> Indeed.  I confirmed that avoiding (c-restricted-<>-arglists t) binding
> solves this misfontification problem at least, but it makes scrolling
> terribly slow...

Yes.  For the bug in 2019 for which I "fixed" this, the scrolling was
around a factor of 6 slower.

[ .... ]

> [..snip..]
> > Can I ask you, please, to apply and test my proposed patch, which I
> > enclose below.  Would you please test it on your real C++ source code,
> > and either confirm it really works, or say what's still faulty about it.
> > If there are any problems with applying the patch, feel free to send me
> > personal email.


> I've applied your patch.  It works well and solves misfontification
> problem.  At the same time, I've not seen any noticeable performance
> degradation by this patch so far.  Great.

Many thanks!

I've committed the patch to the standalone CC Mode repository and the
Emacs master branch at savannah.  I'm closing the bug with this post.

>   attachment: fix_c-restricted--arglists_verification.png

> I came across this problem when I tried to compare the current
> tree-sitter's fontification quality and performance with familiar
> cc-mode by using very-fast flat_hash_map code [1][2].  Now problematic
> fontification has gone.

In the long run, tree-sitter (or something like it) is going to be
superseding CC Mode.  Keeping up with the constantly evolving standards
in CC Mode has proven to be just too much work.  :-(

[ .... ]

> Best regards,
>   Naofumi

> [1] https://github.com/skarupke/flat_hash_map/blob/master/flat_hash_map.hpp
> [2] https://probablydance.com/2017/02/26/i-wrote-the-fastest-hashtable/

-- 
Alan Mackenzie (Nuremberg, Germany).





      reply	other threads:[~2022-08-31 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21 13:27 bug#57318: 29.0.50; c++-mode: Functions are shown as variables: partial template specialization Naofumi Yasufuku
2022-08-28  5:33 ` Naofumi Yasufuku
2022-08-30 20:00   ` Alan Mackenzie
2022-08-31 16:01     ` Naofumi Yasufuku
2022-08-31 19:26       ` Alan Mackenzie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yw+12xTaoIEvH6+1@ACM \
    --to=acm@muc.de \
    --cc=57318-done@debbugs.gnu.org \
    --cc=naofumi@yasufuku.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).