From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Fix to handling of C++ digit separators, improvements in handling of single quotes. Date: Sat, 1 Jul 2017 16:10:08 +0000 Message-ID: <20170701161008.GB8743@acm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1498925569 12809 195.159.176.226 (1 Jul 2017 16:12:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Jul 2017 16:12:49 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 01 18:12:46 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dRL0n-000337-3v for ged-emacs-devel@m.gmane.org; Sat, 01 Jul 2017 18:12:45 +0200 Original-Received: from localhost ([::1]:55292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRL0s-0008Np-7U for ged-emacs-devel@m.gmane.org; Sat, 01 Jul 2017 12:12:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRKzV-0007vl-E5 for emacs-devel@gnu.org; Sat, 01 Jul 2017 12:11:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRKzS-0003Rh-7x for emacs-devel@gnu.org; Sat, 01 Jul 2017 12:11:25 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:16921 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1dRKzR-0003QS-ST for emacs-devel@gnu.org; Sat, 01 Jul 2017 12:11:22 -0400 Original-Received: (qmail 49462 invoked by uid 3782); 1 Jul 2017 16:11:20 -0000 Original-Received: from acm.muc.de (p548C69C7.dip0.t-ipconnect.de [84.140.105.199]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 01 Jul 2017 18:11:19 +0200 Original-Received: (qmail 8893 invoked by uid 1000); 1 Jul 2017 16:10:08 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216078 Archived-At: Hello, Emacs. Up until half an hour ago, the handling of C++ digit separators (') was broken. They were find for when you'd just loaded a file, but on typing in digits and separators they were broken. I've rewritten this part of CC Mode, in the process improving the handling of single quotes generally. Now, single quotes are fontified with font-lock-warning-face unless they form part of a valid character constant, or are digit separators in C++. Just as a matter of interest, single quotes inside strings and comments now get the same syntax-table text properties that they do in plain text. It's just simpler this way. The code involved is moderately involved, with special cases needed to handle things like '\'', '\\', or char foo [] = {',',',',',',','};. So if there are any problems with it (in particular, large areas of text following a quotey bit getting misfontified with font-lock-string-face), please let me know. -- Alan Mackenzie (Nuremberg, Germany).