From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24271: 25.1; font-lock problem of c++-mode Date: Sat, 20 Aug 2016 11:15:02 +0300 Message-ID: <83k2fbdfg9.fsf@gnu.org> References: <7756A5F1-342F-4F55-8D6B-1A41B528DE5A@gmail.com> <83twegc4ie.fsf@gnu.org> <1645ABE9-D61A-4DDE-B4D6-94A29A2CC2AA@gmail.com> <02148DC1-20D2-41B8-BA43-CFBE6A07C3F6@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1471680982 12928 195.159.176.226 (20 Aug 2016 08:16:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Aug 2016 08:16:22 +0000 (UTC) Cc: 24271@debbugs.gnu.org To: Jiajian Huang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 20 10:16:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bb1Ry-000374-14 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Aug 2016 10:16:18 +0200 Original-Received: from localhost ([::1]:60254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bb1Rv-0003Sp-7o for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Aug 2016 04:16:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bb1Rn-0003RF-OK for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2016 04:16:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bb1Ri-0001PM-L8 for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2016 04:16:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bb1Ri-0001PI-Hh for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2016 04:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bb1Ri-0003Gp-De for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2016 04:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Aug 2016 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24271 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24271-submit@debbugs.gnu.org id=B24271.147168090912503 (code B ref 24271); Sat, 20 Aug 2016 08:16:02 +0000 Original-Received: (at 24271) by debbugs.gnu.org; 20 Aug 2016 08:15:09 +0000 Original-Received: from localhost ([127.0.0.1]:34677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bb1Qq-0003Fb-Tk for submit@debbugs.gnu.org; Sat, 20 Aug 2016 04:15:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bb1Qp-0003FO-7Y for 24271@debbugs.gnu.org; Sat, 20 Aug 2016 04:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bb1Qf-0001Dv-3S for 24271@debbugs.gnu.org; Sat, 20 Aug 2016 04:15:01 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bb1Qe-0001Dp-WF; Sat, 20 Aug 2016 04:14:57 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1198 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bb1Qc-0005pZ-DA; Sat, 20 Aug 2016 04:14:54 -0400 In-reply-to: <02148DC1-20D2-41B8-BA43-CFBE6A07C3F6@gmail.com> (message from Jiajian Huang on Sat, 20 Aug 2016 15:57:02 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:122410 Archived-At: > From: Jiajian Huang > Date: Sat, 20 Aug 2016 15:57:02 +0800 > Cc: 24271@debbugs.gnu.org > > This is a more serious example. As you can see, I normally input such a short line “using std::string”, the color have change 6 times ! > I don’s think any of them is a “valid” C++ program except the last one. > > I’ve not seen any other major mode has such a “feature”. This is my first time get into c++-mode. Because of this mechanism, > the current input area keep “flashing” too much when keep typing fast within a buffer full of words even under such a light color theme. > I feel that it’s so different from other major mode(python-mode etc.) soon as I switch to c++-mode. Maybe it’s not a bug, but I don’t think it’s a good feature. The effects of changing the colors is exacerbated in your case by the fact that you use a bold face for some of the faces. If you just use colors, the changes are not really as annoying as you say, IMO. Regardless of what Alan, the developer of the C++ mode says about this, I think you can avoid at least some of the unpleasant effects of this in your setup if you activate stealth fontification by setting jit-stealth-time to some non-nil value, like 0.1. Then Emacs will not attempt to re-fontify the buffer as long as you are typing, and will only do so after Emacs has been idle for 0.1 sec (or any other value you assign to jit-stealth-time). (If you do try jit-stealth, I suggest to also set jit-stealth-load to something like 25, to prevent stealth fontifications from hogging the CPU.)