From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2422"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57318-done@debbugs.gnu.org To: Naofumi Yasufuku Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 31 22:21:01 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTUCr-0000Sf-I9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 22:21:01 +0200 Original-Received: from localhost ([::1]:33652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTUCq-0000Na-Ji for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 16:21:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTTMe-000349-Ch for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 15:27:13 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTTMc-0004g3-Ug for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 15:27:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTTMc-0005xb-Oz for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 15:27:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Aug 2022 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 57318 X-GNU-PR-Package: emacs Mail-Followup-To: 57318@debbugs.gnu.org, acm@muc.de, naofumi@yasufuku.dev Original-Received: via spool by 57318-done@debbugs.gnu.org id=D57318.166197399122869 (code D ref 57318); Wed, 31 Aug 2022 19:27:02 +0000 Original-Received: (at 57318-done) by debbugs.gnu.org; 31 Aug 2022 19:26:31 +0000 Original-Received: from localhost ([127.0.0.1]:40494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTM6-0005wn-T5 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 15:26:31 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:45701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTM4-0005wY-D3 for 57318-done@debbugs.gnu.org; Wed, 31 Aug 2022 15:26:29 -0400 Original-Received: (qmail 58072 invoked by uid 3782); 31 Aug 2022 21:26:20 +0200 Original-Received: from acm.muc.de (p4fe15a7c.dip0.t-ipconnect.de [79.225.90.124]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 31 Aug 2022 21:26:20 +0200 Original-Received: (qmail 31620 invoked by uid 1000); 31 Aug 2022 19:26:19 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241222 Archived-At: 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).