From unknown Mon Aug 18 00:07:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3269 <3269@debbugs.gnu.org> To: bug#3269 <3269@debbugs.gnu.org> Subject: Status: 23.0.93; C-mode text highlighting Reply-To: bug#3269 <3269@debbugs.gnu.org> Date: Mon, 18 Aug 2025 07:07:03 +0000 retitle 3269 23.0.93; C-mode text highlighting reassign 3269 emacs,cc-mode submitter 3269 Thomas Christensen severity 3269 normal thanks From thomasc@thomaschristensen.org Wed May 13 00:14:58 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 13 May 2009 07:14:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4D7EpG6029531 for ; Wed, 13 May 2009 00:14:52 -0700 Received: from mail.gnu.org ([199.232.76.166]:44205 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M48fy-0002oB-Fl for emacs-pretest-bug@gnu.org; Wed, 13 May 2009 03:14:50 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M48fv-0005M2-Hk for emacs-pretest-bug@gnu.org; Wed, 13 May 2009 03:14:50 -0400 Received: from mx20.gnu.org ([199.232.41.8]:18709) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M48fv-0005LZ-0O for emacs-pretest-bug@gnu.org; Wed, 13 May 2009 03:14:47 -0400 Received: from [86.58.187.172] (helo=smtp.thomaschristensen.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M48fo-00030A-M2 for emacs-pretest-bug@gnu.org; Wed, 13 May 2009 03:14:40 -0400 Received: from ancient.thomaschristensen.org (sat2.thomaschristensen.org [194.239.24.50]) by smtp.thomaschristensen.org (Postfix) with ESMTP id 03D393898013; Wed, 13 May 2009 08:41:04 +0200 (CEST) From: Thomas Christensen To: emacs-pretest-bug@gnu.org Subject: 23.0.93; C-mode text highlighting Date: Wed, 13 May 2009 08:39:47 +0200 Message-ID: <878wl1h5fw.fsf@ancient.thomaschristensen.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-Greylist: delayed 1780 seconds by postgrey-1.27 at nadesico; Wed, 13 May 2009 03:14:34 EDT X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: In c-mode type: #define FOO "\ foo\n\ bar\n\ " Then place the cursor after foo\n\ and press RETURN for a new line. The highlighting is now broken, and I can only restore it by reverting the buffer. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /home/thomasc/emacs/etc/DEBUG for instructions. In GNU Emacs 23.0.93.3 (i686-pc-linux-gnu, GTK+ Version 2.16.1) of 2009-05-12 on ancient.thomaschristensen.org Windowing system distributor `The X.Org Foundation', version 11.0.10600000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_DK.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: C/l Minor modes in effect: iswitchb-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: C-e - h \ n \ SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC H I T S / M I N U T E C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-e C-x C-s M-x r e v e r t - b u f y e s M-x b u g r e p o r Recent messages: Loading gnus...done For information about GNU Emacs and the GNU system, type C-h C-a. Loading vc-git...done Auto-saving...done Saving file /home/thomasc/Private/polcap/polcap.c... Wrote /home/thomasc/Private/polcap/polcap.c Making completion list... From whitebox@nefkom.net Thu May 14 02:28:44 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 14 May 2009 09:28:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4E9SeNW022357 for ; Thu, 14 May 2009 02:28:41 -0700 Received: from mx10.gnu.org ([199.232.76.166]:50313) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M4XF1-0004AL-N6 for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 05:28:40 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M4XEx-0003Wv-VW for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 05:28:39 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:33383) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M4XEx-0003Wh-L8 for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 05:28:35 -0400 Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 13ED51C15476; Thu, 14 May 2009 11:28:33 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id 8CE2C902D1; Thu, 14 May 2009 11:28:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id QQCPXIFJeWeL; Thu, 14 May 2009 11:28:32 +0200 (CEST) Received: from igel.home (DSL01.83.171.184.188.ip-pool.NEFkom.net [83.171.184.188]) by mail.mnet-online.de (Postfix) with ESMTP; Thu, 14 May 2009 11:28:32 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 829B910C4CD; Thu, 14 May 2009 11:28:30 +0200 (CEST) From: Andreas Schwab To: Thomas Christensen Cc: 3269@debbugs.gnu.org, emacs-pretest-bug@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> X-Yow: A dwarf is passing out somewhere in Detroit! Date: Thu, 14 May 2009 11:28:30 +0200 In-Reply-To: <878wl1h5fw.fsf@ancient.thomaschristensen.org> (Thomas Christensen's message of "Wed, 13 May 2009 08:39:47 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Thomas Christensen writes: > In c-mode type: > #define FOO "\ > foo\n\ > bar\n\ > " > > Then place the cursor after foo\n\ and press RETURN for a new line. > > The highlighting is now broken, and I can only restore it by reverting > the buffer. Typing M-o M-o (font-lock-fontify-block) works fine for me. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From acm@muc.de Thu May 14 14:39:01 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 14 May 2009 21:39:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4ELctiW026295 for ; Thu, 14 May 2009 14:38:56 -0700 Received: from mail.gnu.org ([199.232.76.166]:52184 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M4idi-0000cD-OH for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 17:38:54 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M4idh-00059A-1b for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 17:38:54 -0400 Received: from colin.muc.de ([193.149.48.1]:1399 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M4idg-00058t-9g for emacs-pretest-bug@gnu.org; Thu, 14 May 2009 17:38:52 -0400 Received: (qmail 61309 invoked by uid 3782); 14 May 2009 21:38:49 -0000 Received: from acm.muc.de (pD9E23C92.dip.t-dialin.net [217.226.60.146]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 14 May 2009 23:38:47 +0200 Received: (qmail 6147 invoked by uid 1000); 14 May 2009 21:39:24 -0000 Date: Thu, 14 May 2009 21:39:24 +0000 To: Thomas Christensen , 3269@debbugs.gnu.org Cc: emacs-pretest-bug@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090514213924.GB2413@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878wl1h5fw.fsf@ancient.thomaschristensen.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 On Wed, May 13, 2009 at 08:39:47AM +0200, Thomas Christensen wrote: > In c-mode type: > #define FOO "\ > foo\n\ > bar\n\ > " > Then place the cursor after foo\n\ and press RETURN for a new line. > The highlighting is now broken, and I can only restore it by reverting > the buffer. That's a bit vague, so let me fill it out for you. ;-) When you press RETURN as described, the new line you've just made lacks a backslash, hence terminates the macro. (Yes, I know you knew that.) #define FOO "\ foo\n\ bar\n\ " The "foo" line has lost its fontification, and this is the bug. I know what's causing it, and it _might_ be easily fixable. What's more, I don't this bug was in Emacs 22, so Chong Yidong would allow it to be fixed. :-) The "bar" line and what follows (which is no longer part of the macro) is so remote from being valid C syntax that no compaint about its fontification is reasonable. If you insert a backslash in the blank line, the bottom bit becomes correctly fontified again. The top bit needs you to type M-o M-o, as Andreas said, to restore its colour. This is because font lock, when triggered by a buffer change, only refontifies the current line and those below it. This is a longstanding problem with font lock which is difficult (though not impossible) to fix. Thanks for taking the trouble to report this bug. -- Alan Mackenzie (Nuremberg, Germany). From acm@muc.de Mon May 18 08:06:18 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 15:06:18 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.2 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4IF6DhL018665 for ; Mon, 18 May 2009 08:06:14 -0700 Received: from mail.gnu.org ([199.232.76.166]:45057 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M64Ps-0007ZI-7P for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 11:06:12 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M64Po-0003kv-UQ for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 11:06:11 -0400 Received: from colin.muc.de ([193.149.48.1]:2382 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M64Po-0003jq-7L for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 11:06:08 -0400 Received: (qmail 25494 invoked by uid 3782); 18 May 2009 15:06:04 -0000 Received: from acm.muc.de (pD9E22FAC.dip.t-dialin.net [217.226.47.172]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 May 2009 17:06:00 +0200 Received: (qmail 14502 invoked by uid 1000); 18 May 2009 15:06:43 -0000 Date: Mon, 18 May 2009 15:06:43 +0000 To: Chong Yidong , Thomas Christensen , 3269@debbugs.gnu.org Cc: emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090518150643.GA12920@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090514213924.GB2413@muc.de> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hello, Thomas and Yidong! On Thu, May 14, 2009 at 09:39:24PM +0000, Alan Mackenzie wrote: > On Wed, May 13, 2009 at 08:39:47AM +0200, Thomas Christensen wrote: > > In c-mode type: > > #define FOO "\ > > foo\n\ > > bar\n\ > > " > > Then place the cursor after foo\n\ and press RETURN for a new line. > > The highlighting is now broken, and I can only restore it by reverting > > the buffer. > That's a bit vague, so let me fill it out for you. ;-) > When you press RETURN as described, the new line you've just made lacks a > backslash, hence terminates the macro. (Yes, I know you knew that.) > #define FOO "\ > foo\n\ > bar\n\ > " > The "foo" line has lost its fontification, and this is the bug. I know > what's causing it, and it _might_ be easily fixable. What's more, I > don't this bug was in Emacs 22, so Chong Yidong would allow it to be > fixed. :-) OK, here is a patch for half of the problem - it now fontifies a broken string in a #define properly - just that you need to type M-o M-o after the change. Would you check that this works properly please, Thomas! May I presume I can commit this to trunk before this week's pretest release, Yidong? The second half of the problem is to fix it so that you don't have to type MoMo afterwards. Any change you'll let me do this before this week's pretest, Yidong? 2009-05-18 Alan Mackenzie * progmodes/cc-fonts.el (c-font-lock-invalid-cpp-string-matcher): New function. (c-basic-matchers-before): New clause to fontify invalid strings in a CPP construct. * progmodes/cc-engine.el: Update some commenting. * progmodes/cc-defs.el (c-search-forward-char-property): new macro. *** /home/acm/emacs/emacs.cvs/lisp/progmodes/cc-defs.el 2009-02-12 12:44:40.000000000 +0000 --- cc-defs.el 2009-05-18 10:55:56.716563912 +0000 *************** *** 1029,1034 **** --- 1029,1053 ---- ;; Emacs. `(remove-text-properties ,from ,to '(,property nil)))) + (defmacro c-search-forward-char-property (property value &optional limit) + "Search forward for a text-property PROPERTY having value VALUE. + LIMIT bounds the search. The comparison is done with `equal'. + + Leave point just after the character, and set the match data on + this character, and return point. If VALUE isn't found, Return + nil; point is then left undefined." + `(let ((place (point))) + (while + (and + (< place ,(or limit '(point-max))) + (not (equal (get-text-property place ,property) ,value))) + (setq place (next-single-property-change + place ,property nil ,(or limit '(point-max))))) + (when (< place ,(or limit '(point-max))) + (goto-char place) + (search-forward-regexp ".") ; to set the match-data. + (point)))) + (defun c-clear-char-property-with-value-function (from to property value) "Remove all text-properties PROPERTY from the region (FROM, TO) which have the value VALUE, as tested by `equal'. These *** /home/acm/emacs/emacs.cvs/lisp/progmodes/cc-engine.el 2009-02-21 20:19:30.000000000 +0000 --- cc-engine.el 2009-05-18 10:55:56.779554336 +0000 *************** *** 81,88 **** ;; ;; 'syntax-table ;; Used to modify the syntax of some characters. It is used to ! ;; mark the "<" and ">" of angle bracket parens with paren syntax, and ! ;; to "hide" obtrusive characters in preprocessor lines. ;; ;; This property is used on single characters and is therefore ;; always treated as front and rear nonsticky (or start and end open --- 81,91 ---- ;; ;; 'syntax-table ;; Used to modify the syntax of some characters. It is used to ! ;; mark the "<" and ">" of angle bracket parens with paren syntax; ! ;; also to "hide" obtrusive characters in preprocessor lines, by ! ;; marking them with punctuation syntax, '(1). If this value is ever ! ;; used for any other purpose, modify ! ;; `c-font-lock-invalid-cpp-string-matcher' accordingly. ;; ;; This property is used on single characters and is therefore ;; always treated as front and rear nonsticky (or start and end open *** /home/acm/emacs/emacs.cvs/lisp/progmodes/cc-fonts.el 2009-01-05 03:23:18.000000000 +0000 --- cc-fonts.el 2009-05-18 10:55:56.887537920 +0000 *************** *** 285,291 **** ;; bit of the overhead compared to a real matcher. The main reason ;; is however to pass the real search limit to the anchored ;; matcher(s), since most (if not all) font-lock implementations ! ;; arbitrarily limits anchored matchers to the same line, and also ;; to insulate against various other irritating differences between ;; the different (X)Emacs font-lock packages. ;; --- 285,291 ---- ;; bit of the overhead compared to a real matcher. The main reason ;; is however to pass the real search limit to the anchored ;; matcher(s), since most (if not all) font-lock implementations ! ;; arbitrarily limit anchored matchers to the same line, and also ;; to insulate against various other irritating differences between ;; the different (X)Emacs font-lock packages. ;; *************** *** 306,312 **** ;; covered by the font-lock context.) ;; Note: Replace `byte-compile' with `eval' to debug the generated ! ;; lambda easier. (byte-compile `(lambda (limit) (let (;; The font-lock package in Emacs is known to clobber --- 306,312 ---- ;; covered by the font-lock context.) ;; Note: Replace `byte-compile' with `eval' to debug the generated ! ;; lambda more easily. (byte-compile `(lambda (limit) (let (;; The font-lock package in Emacs is known to clobber *************** *** 559,564 **** --- 559,583 ---- t) (c-put-font-lock-face start (1+ start) 'font-lock-warning-face))))) + (defun c-font-lock-invalid-cpp-string-matcher (lim) + ;; Fontify unterminated strings within preprocessor constructs. + ;; + ;; Unmatched string quotes will have been marked with a punctuation + ;; syntax-table text property (value '(1)) by `c-neutralize-syntax-in-CPP'. + ;; + ;; This function will be called from font-lock for a region bounded by POINT + ;; and LIM, as though it were to identify a keyword for + ;; font-lock-keyword-face. It always returns NIL to inhibit this and + ;; prevent a repeat invocation. See elisp/lispref page "Search-based + ;; Fontification". + (while (c-search-forward-char-property 'syntax-table '(1) lim) ; punctuation + (when (memq (char-before) '(?\" ?\')) + (c-put-font-lock-face (1- (point)) (point) 'font-lock-warning-face) + (search-forward-regexp "\\(.*\\\\[\n\r]\\)*\\(.*$\\)") + (if (> (match-end 0) (match-beginning 0)) + (c-put-font-lock-face (match-beginning 0) (match-end 0) + 'font-lock-string-face))))) + (c-lang-defconst c-basic-matchers-before "Font lock matchers for basic keywords, labels, references and various other easily recognizable things that should be fontified before generic *************** *** 580,585 **** --- 599,611 ---- (concat ".\\(" c-string-limit-regexp "\\)") '((c-font-lock-invalid-string))) + ;; Put a warning face on the opening quote of unclosed strings inside + ;; preprocessor construcs (#define). The previous clause doesn't do + ;; this, since the hook function `c-neutralize-syntax-in-CPP' has + ;; splatted the syntax of the unmated string quotes. + ,@(when (c-lang-const c-opt-cpp-prefix) + '((c-font-lock-invalid-cpp-string-matcher))) + ;; Fontify keyword constants. ,@(when (c-lang-const c-constant-kwds) (let ((re (c-make-keywords-re nil (c-lang-const c-constant-kwds)))) -- Alan Mackenzie (Nuremberg, Germany). From cyd@stupidchicken.com Mon May 18 09:41:13 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 16:41:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4IGf9Mm013303 for ; Mon, 18 May 2009 09:41:10 -0700 Received: from mx10.gnu.org ([199.232.76.166]:53584) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M65tk-0002pJ-CJ for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 12:41:08 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M65th-0007Xs-44 for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 12:41:08 -0400 Received: from cyd.mit.edu ([18.115.2.24]:60785) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M65tg-0007Xc-Oq; Mon, 18 May 2009 12:41:04 -0400 Received: by cyd.mit.edu (Postfix, from userid 1000) id B30FF57E22A; Mon, 18 May 2009 12:41:21 -0400 (EDT) From: Chong Yidong To: Alan Mackenzie Cc: Thomas Christensen , 3269@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> Date: Mon, 18 May 2009 12:41:21 -0400 In-Reply-To: <20090518150643.GA12920@muc.de> (Alan Mackenzie's message of "Mon, 18 May 2009 15:06:43 +0000") Message-ID: <87iqjygy8e.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Alan Mackenzie writes: >> The "foo" line has lost its fontification, and this is the bug. I know >> what's causing it, and it _might_ be easily fixable. What's more, I >> don't this bug was in Emacs 22 > > OK, here is a patch for half of the problem - it now fontifies a broken > string in a #define properly - just that you need to type M-o M-o after > the change. Would you check that this works properly please, Thomas! > > The second half of the problem is to fix it so that you don't have to > type MoMo afterwards. Any change you'll let me do this before this > week's pretest, Yidong? Could you test these patches on some large C files, to make sure they don't cause any additional performance problems? But if everything seems OK, please go ahead and check both patches in. From monnier@iro.umontreal.ca Mon May 18 12:53:48 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 19:53:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4IJrjDu004525 for ; Mon, 18 May 2009 12:53:46 -0700 Received: from mx10.gnu.org ([199.232.76.166]:42502) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M68u9-0001qk-0m for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 15:53:45 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M68u7-0001SP-TR for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 15:53:44 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:22516) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M68u7-0001SH-JA; Mon, 18 May 2009 15:53:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwFAARZEUpMCovv/2dsb2JhbACBT81lhAEFhWo X-IronPort-AV: E=Sophos;i="4.41,211,1241409600"; d="scan'208";a="38737995" Received: from 76-10-139-239.dsl.teksavvy.com (HELO ceviche.home) ([76.10.139.239]) by ironport2-out.teksavvy.com with ESMTP; 18 May 2009 15:53:42 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 60CADB4136; Mon, 18 May 2009 15:53:42 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: Chong Yidong , Thomas Christensen , 3269@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> Date: Mon, 18 May 2009 15:53:42 -0400 In-Reply-To: <20090518150643.GA12920@muc.de> (Alan Mackenzie's message of "Mon, 18 May 2009 15:06:43 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > OK, here is a patch for half of the problem - it now fontifies a broken > string in a #define properly For some definition of "properly". > The second half of the problem is to fix it so that you don't have to > type M-o M-o afterwards. Any change you'll let me do this before this > week's pretest, Yidong? I think this part is more important. I don't care much (if at all) about how invalid code is highlighted. Stefan From acm@muc.de Mon May 18 14:15:38 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 21:15:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4ILFX4G029772 for ; Mon, 18 May 2009 14:15:34 -0700 Received: from mail.gnu.org ([199.232.76.166]:48977 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6ABI-0004rG-Sw for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:15:32 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6ABH-0002uD-6e for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:15:32 -0400 Received: from colin.muc.de ([193.149.48.1]:4726 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6ABG-0002tL-No for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:15:31 -0400 Received: (qmail 45460 invoked by uid 3782); 18 May 2009 21:15:25 -0000 Received: from acm.muc.de (pD9E22FAC.dip.t-dialin.net [217.226.47.172]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 May 2009 23:15:24 +0200 Received: (qmail 21744 invoked by uid 1000); 18 May 2009 21:16:08 -0000 Date: Mon, 18 May 2009 21:16:08 +0000 To: Chong Yidong Cc: emacs-pretest-bug@gnu.org, 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090518211608.GC12920@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> <87iqjygy8e.fsf@cyd.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87iqjygy8e.fsf@cyd.mit.edu> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Yidong! On Mon, May 18, 2009 at 12:41:21PM -0400, Chong Yidong wrote: > Alan Mackenzie writes: > >> The "foo" line has lost its fontification, and this is the bug. I > >> know what's causing it, and it _might_ be easily fixable. What's > >> more, I don't this bug was in Emacs 22 > > OK, here is a patch for half of the problem - it now fontifies a > > broken string in a #define properly - just that you need to type M-o > > M-o after the change. Would you check that this works properly > > please, Thomas! > > The second half of the problem is to fix it so that you don't have to > > type MoMo afterwards. Any change you'll let me do this before this > > week's pretest, Yidong? > Could you test these patches on some large C files, to make sure they > don't cause any additional performance problems? But if everything > seems OK, please go ahead and check both patches in. I've got both bits working now. I'll do some more testing, and I expect to be committing the whole caboodle withing 24 hours. -- Alan Mackenzie (Nuremberg, Germany). From acm@muc.de Mon May 18 14:29:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 May 2009 21:29:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4ILTqQO000846 for ; Mon, 18 May 2009 14:29:53 -0700 Received: from mail.gnu.org ([199.232.76.166]:49869 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6AP9-0005CG-Ro for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:29:51 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6AP8-0004wI-5W for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:29:51 -0400 Received: from colin.muc.de ([193.149.48.1]:4255 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6AP7-0004w0-M3 for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 17:29:50 -0400 Received: (qmail 50159 invoked by uid 3782); 18 May 2009 21:29:47 -0000 Received: from acm.muc.de (pD9E22FAC.dip.t-dialin.net [217.226.47.172]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 18 May 2009 23:29:45 +0200 Received: (qmail 21937 invoked by uid 1000); 18 May 2009 21:30:30 -0000 Date: Mon, 18 May 2009 21:30:30 +0000 To: Stefan Monnier Cc: emacs-pretest-bug@gnu.org, Chong Yidong , 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090518213030.GD12920@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Stefan! On Mon, May 18, 2009 at 03:53:42PM -0400, Stefan Monnier wrote: > > OK, here is a patch for half of the problem - it now fontifies a broken > > string in a #define properly > For some definition of "properly". The opening string quote (?\" or ?\') gets f-l-warning-face. The rest of the unclosed string (up to the first EOL which isn't escaped) gets f-l-string-face. Actually, that's not _quite_ "proper". A string with an even number of backslashes at an EOL is broken at that point, but the font locking doesn't show this (yet). I don't suppose that will bother you all that much. ;-) > > The second half of the problem is to fix it so that you don't have to > > type M-o M-o afterwards. Any change you'll let me do this before > > this week's pretest, Yidong? > I think this part is more important. I don't care much (if at all) > about how invalid code is highlighted. I agree it's important. I've got it working; what's more, the code doesn't advise any of the font lock functions for (>= emacs-major-version 22). I'll commit it tomorrow sometime. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From monnier@iro.umontreal.ca Mon May 18 19:23:15 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 May 2009 02:23:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4J2NBr5019460 for ; Mon, 18 May 2009 19:23:12 -0700 Received: from mail.gnu.org ([199.232.76.166]:34861 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6Ez0-0006Yn-L0 for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 22:23:10 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6Eyy-0008Tk-TT for emacs-pretest-bug@gnu.org; Mon, 18 May 2009 22:23:10 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:6830) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6Eyy-0008Te-ME; Mon, 18 May 2009 22:23:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AugEALK0EUpMCovv/2dsb2JhbACBT8tygjiBSQWFag X-IronPort-AV: E=Sophos;i="4.41,212,1241409600"; d="scan'208";a="38744872" Received: from 76-10-139-239.dsl.teksavvy.com (HELO pastel.home) ([76.10.139.239]) by ironport2-out.teksavvy.com with ESMTP; 18 May 2009 22:23:05 -0400 Received: by pastel.home (Postfix, from userid 20848) id CDE0E7F29; Mon, 18 May 2009 22:24:02 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: emacs-pretest-bug@gnu.org, Chong Yidong , 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> <20090518213030.GD12920@muc.de> Date: Mon, 18 May 2009 22:24:02 -0400 In-Reply-To: <20090518213030.GD12920@muc.de> (Alan Mackenzie's message of "Mon, 18 May 2009 21:30:30 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. >> > OK, here is a patch for half of the problem - it now fontifies a broken >> > string in a #define properly >> For some definition of "properly". > The opening string quote (?\" or ?\') gets f-l-warning-face. The rest of > the unclosed string (up to the first EOL which isn't escaped) gets > f-l-string-face. > Actually, that's not _quite_ "proper". A string with an even number of > backslashes at an EOL is broken at that point, but the font locking > doesn't show this (yet). I don't suppose that will bother you all that > much. ;-) I won't oppose the change, but just to be clear: I think that the increased code complexity introduced by your patch is a worse problem than the "improper" highlighting it tries to fix. When code is syntactically incorrect, it's common/normal/expected for the highlighting to be "incorrect". This "incorrect" behavior is actually a good way for the user to notice that his code has problems. So, from this point of view, there's no need to highlight the opening string quote with f-l-warning-face: just looking back in the buffer until you find the first char that is not font-locked as expected will find the culprit without any need for any extra elisp code, and moreover this method will work in many more cases. In other words, messed-up highlighting for incorrect code is just as good if not better than explicitly recognizing the incorrect code and highlighting it with f-l-warning-face. When I introduced the use of f-l-warning-face in C strings, it was not to avoid messed-up highlighting, but rather to avoid apparently correct highlighting for code that was actually incorrect/unportable (and even accepted by GCC at that time). >> I think this part is more important. I don't care much (if at all) >> about how invalid code is highlighted. > I agree it's important. I've got it working; what's more, the code > doesn't advise any of the font lock functions for (>= emacs-major-version > 22). I'll commit it tomorrow sometime. Thanks, Stefan From acm@muc.de Tue May 19 03:25:52 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 May 2009 10:25:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4JAPmuc028523 for ; Tue, 19 May 2009 03:25:50 -0700 Received: from mx10.gnu.org ([199.232.76.166]:43813) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6MW3-00063m-S6 for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 06:25:48 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6MVz-0001nU-6C for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 06:25:45 -0400 Received: from colin.muc.de ([193.149.48.1]:4494 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6MVy-0001ms-EF for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 06:25:42 -0400 Received: (qmail 8334 invoked by uid 3782); 19 May 2009 10:25:40 -0000 Received: from acm.muc.de (pD9E2397A.dip.t-dialin.net [217.226.57.122]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 19 May 2009 12:25:38 +0200 Received: (qmail 1649 invoked by uid 1000); 19 May 2009 10:26:20 -0000 Date: Tue, 19 May 2009 10:26:19 +0000 To: Stefan Monnier Cc: emacs-pretest-bug@gnu.org, Chong Yidong , 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090519102619.GA1317@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> <20090518213030.GD12920@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Stefan, On Mon, May 18, 2009 at 10:24:02PM -0400, Stefan Monnier wrote: > > The opening string quote (?\" or ?\') gets f-l-warning-face. The > > rest of the unclosed string (up to the first EOL which isn't escaped) > > gets f-l-string-face. > > Actually, that's not _quite_ "proper". A string with an even number of > > backslashes at an EOL is broken at that point, but the font locking > > doesn't show this (yet). I don't suppose that will bother you all that > > much. ;-) Whoops! I was utterly wrong there. When a string inside a #define has an even number of backslashes at an EOL, this is perfectly legal; the last \ escapes the EOL, concatenating the lines, and the second last \ escapes the first character on the next line. Nice simple language, C. ;-) > I won't oppose the change, but just to be clear: I think that the > increased code complexity introduced by your patch is a worse problem > than the "improper" highlighting it tries to fix. Well, I don't agree with that, but I'm beginning to think that the current fontification (ommitting f-l-string-face until the closing " is there) wasn't perhaps quite so bad after all. > When code is syntactically incorrect, it's common/normal/expected for > the highlighting to be "incorrect". Where "incorrect" here means "different from what it would be if the code were correct". > This "incorrect" behavior is actually a good way for the user to notice > that his code has problems. Agreed, totally. > So, from this point of view, there's no need to highlight the opening > string quote with f-l-warning-face: just looking back in the buffer > until you find the first char that is not font-locked as expected will > find the culprit without any need for any extra elisp code, and > moreover this method will work in many more cases. > In other words, messed-up highlighting for incorrect code is just as > good if not better than explicitly recognizing the incorrect code and > highlighting it with f-l-warning-face. I was thinking of "compatibility" with unterminated strings in normal code. But they're not the same thing. An open string in a #define is perfectly valid code, if somewhat unusual outside of the Obfuscated C competition. You've persuaded me that the existing fontification is actually better. So I won't be committing yesterday's patch. Thanks! I'll just finish the other patch and commit that. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From monnier@iro.umontreal.ca Tue May 19 07:35:16 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 May 2009 14:35:16 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4JEZ7wu008707 for ; Tue, 19 May 2009 07:35:08 -0700 Received: from mail.gnu.org ([199.232.76.166]:57796 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6QPK-0003Te-F8 for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 10:35:06 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6QPJ-0001Hs-Az for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 10:35:06 -0400 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:17184 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6QPJ-0001Hk-06; Tue, 19 May 2009 10:35:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al4FAOtgEkpMCovv/2dsb2JhbACBT84agkCBQgWFcA X-IronPort-AV: E=Sophos;i="4.41,215,1241409600"; d="scan'208";a="38759909" Received: from 76-10-139-239.dsl.teksavvy.com (HELO pastel.home) ([76.10.139.239]) by ironport2-out.teksavvy.com with ESMTP; 19 May 2009 10:35:04 -0400 Received: by pastel.home (Postfix, from userid 20848) id 904797F29; Tue, 19 May 2009 10:36:05 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: emacs-pretest-bug@gnu.org, Chong Yidong , 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> <20090518213030.GD12920@muc.de> <20090519102619.GA1317@muc.de> Date: Tue, 19 May 2009 10:36:05 -0400 In-Reply-To: <20090519102619.GA1317@muc.de> (Alan Mackenzie's message of "Tue, 19 May 2009 10:26:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. >> In other words, messed-up highlighting for incorrect code is just as >> good if not better than explicitly recognizing the incorrect code and >> highlighting it with f-l-warning-face. > I was thinking of "compatibility" with unterminated strings in normal > code. But they're not the same thing. An open string in a #define is > perfectly valid code, if somewhat unusual outside of the Obfuscated C > competition. > You've persuaded me that the existing fontification is actually better. > So I won't be committing yesterday's patch. Thanks! I'm glad we ended up agreeing, tho for completely different reasons. > I'll just finish the other patch and commit that. Thanks, Stefan From acm@muc.de Tue May 19 15:39:54 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 May 2009 22:39:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.1 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4JMdpdA023444 for ; Tue, 19 May 2009 15:39:52 -0700 Received: from mail.gnu.org ([199.232.76.166]:44234 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M6XyQ-0005kb-40 for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 18:39:50 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M6XyO-00037y-4v for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 18:39:49 -0400 Received: from colin.muc.de ([193.149.48.1]:3939 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6XyN-000378-Mj for emacs-pretest-bug@gnu.org; Tue, 19 May 2009 18:39:48 -0400 Received: (qmail 79457 invoked by uid 3782); 19 May 2009 22:39:40 -0000 Received: from acm.muc.de (pD9E51DA3.dip.t-dialin.net [217.229.29.163]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 20 May 2009 00:39:37 +0200 Received: (qmail 7163 invoked by uid 1000); 19 May 2009 22:40:21 -0000 Date: Tue, 19 May 2009 22:40:21 +0000 To: Stefan Monnier Cc: emacs-pretest-bug@gnu.org, Chong Yidong , 3269@debbugs.gnu.org, Thomas Christensen , emacs-devel@gnu.org Subject: Re: bug#3269: 23.0.93; C-mode text highlighting Message-ID: <20090519224021.GA7126@muc.de> References: <878wl1h5fw.fsf@ancient.thomaschristensen.org> <20090514213924.GB2413@muc.de> <20090518150643.GA12920@muc.de> <20090518213030.GD12920@muc.de> <20090519102619.GA1317@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, All! On Tue, May 19, 2009 at 10:36:05AM -0400, Stefan Monnier wrote: > >> In other words, messed-up highlighting for incorrect code is just as > >> good if not better than explicitly recognizing the incorrect code and > >> highlighting it with f-l-warning-face. > > I was thinking of "compatibility" with unterminated strings in normal > > code. But they're not the same thing. An open string in a #define is > > perfectly valid code, if somewhat unusual outside of the Obfuscated C > > competition. > > You've persuaded me that the existing fontification is actually better. > > So I won't be committing yesterday's patch. Thanks! > I'm glad we ended up agreeing, tho for completely different reasons. > > I'll just finish the other patch and commit that. DONE. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From cyd@stupidchicken.com Sun May 24 16:32:56 2009 Received: (at control) by emacsbugs.donarmstrong.com; 24 May 2009 23:32:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.9 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4ONWrPw020976 for ; Sun, 24 May 2009 16:32:54 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 9B5A357E263; Sun, 24 May 2009 19:33:14 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: merge 3269 3270 Date: Sun, 24 May 2009 19:33:14 -0400 Message-ID: <87my92nkjp.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii merge 3269 3270 thanks From rgm@gnu.org Wed Jun 17 00:29:42 2009 Received: (at control) by emacsbugs.donarmstrong.com; 17 Jun 2009 07:29:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5H7TcQa018381 for ; Wed, 17 Jun 2009 00:29:39 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MGpaT-00005k-JR; Wed, 17 Jun 2009 03:29:37 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19000.39777.414084.568239@fencepost.gnu.org> Date: Wed, 17 Jun 2009 03:29:37 -0400 From: Glenn Morris To: control Subject: control message Sender: Glenn Morris tags 3196 moreinfo unreproducible reassign 3221 emacs,ns reassign 3256 emacs,ns tags 3264 moreinfo reassign 3269 emacs,cc-mode close 3269 reassign 3281 emacs,w32 tags 3291 moreinfo severity 3310 minor close 3319 severity 3327 minor tags 3330 moreinfo unreproducible reassign 3331 emacs,ns close 3331 reassign 3351 emacs,ns severity 3350 minor reassign 3397 emacs,ns severity 3425 wishlist close 3448 reassign 3459 emacs,ns severity 3462 wishlist tags 3467 wontfix reassign 3500 emacs,ns merge 3234 3483 severity 3540 wishlist reassign 3452 emacs,w32 severity 3577 minor reassign 3581 emacs,ns reassign 3583 emacs,ns merge 3588 3593 reassign 3588 emacs,ns reassign 3589 emacs,ns reassign 3478 emacs22,w32 close 3146 From unknown Mon Aug 18 00:07:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 Jul 2009 14:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 25 21:38:17 2010 Received: (at control) by debbugs.gnu.org; 26 Jan 2010 02:38:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZbJp-0006of-O2 for submit@debbugs.gnu.org; Mon, 25 Jan 2010 21:38:17 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZbJo-0006oW-PD for control@debbugs.gnu.org; Mon, 25 Jan 2010 21:38:16 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NZbJl-0000z8-BV; Mon, 25 Jan 2010 21:38:13 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19294.21909.334772.786205@fencepost.gnu.org> Date: Mon, 25 Jan 2010 21:38:13 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: tG@#tMhFs[`:@o}O]y:3[/w&o X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) unarchive 3270 unmerge 3270 tags 3296 moreinfo reassign 3296 emacs22 From unknown Mon Aug 18 00:07:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 23 Feb 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator