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#70435: 30.0.50; cc-mode: <> are sometimes not recognized as parentheses Date: Thu, 2 May 2024 13:16:27 +0000 Message-ID: References: <87le5cuuyq.fsf@gmail.com> <87y18xifpb.fsf@gmail.com> <87sez4uleo.fsf@gmail.com> <8634r0muh3.fsf@gnu.org> <87zft8s7dh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7435"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 70435@debbugs.gnu.org To: Herman =?UTF-8?Q?G=C3=A9za?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 02 15:18:05 2024 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 1s2WK4-0001g8-IH for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 May 2024 15:18:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2WJq-0003mz-1W; Thu, 02 May 2024 09:17:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2WJh-0003kL-1Q for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 09:17:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2WJg-0003k7-OH for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 09:17:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2WK2-0000Ed-GB for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 09:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2024 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70435 X-GNU-PR-Package: emacs Original-Received: via spool by 70435-submit@debbugs.gnu.org id=B70435.1714655822888 (code B ref 70435); Thu, 02 May 2024 13:18:02 +0000 Original-Received: (at 70435) by debbugs.gnu.org; 2 May 2024 13:17:02 +0000 Original-Received: from localhost ([127.0.0.1]:43746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2WJ4-0000E6-9T for submit@debbugs.gnu.org; Thu, 02 May 2024 09:17:02 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:32149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2WJ0-0000DS-U1 for 70435@debbugs.gnu.org; Thu, 02 May 2024 09:17:00 -0400 Original-Received: (qmail 7888 invoked by uid 3782); 2 May 2024 15:16:31 +0200 Original-Received: from muc.de (p4fe15d0d.dip0.t-ipconnect.de [79.225.93.13]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 02 May 2024 15:16:30 +0200 Original-Received: (qmail 9747 invoked by uid 1000); 2 May 2024 13:16:27 -0000 Content-Disposition: inline In-Reply-To: <87zft8s7dh.fsf@gmail.com> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284320 Archived-At: Hello, Géza. On Thu, May 02, 2024 at 14:49:57 +0200, Herman, Géza wrote: > Alan Mackenzie writes: > > Géza, would you be prepared to do a little more testing if I modified > > the patch? > Sure, I'm happy to test whether a modified patch still fixes the issue. Thanks, that's appreciated. The modified patch is quite a bit shorter than the first one, but it does a little more. There was a subtle detail about deleting an unterminated string, too. Please remove the first patch from your cc-engine.el, then apply the patch below. Byte compile cc-engine.el, then load the resulting CC Mode into a running Emacs (or restart Emacs). The test case should (still) be fixed. Any testing you can do on real code would also be appreciated. Please confirm, again, that the bug is truly fixed, or tell me what still needs to be fixed. Thanks! Here's the patch. It should apply cleanly to the Emacs master: diff -r 072940aaeb40 cc-engine.el --- a/cc-engine.el Sun Apr 14 07:59:01 2024 +0000 +++ b/cc-engine.el Thu May 02 13:05:48 2024 +0000 @@ -7172,7 +7172,7 @@ ;; FIXME!!! This routine ignores the possibility of macros entirely. ;; 2010-01-29. - (when (> end beg) + (when (or old-len (> end beg)) ;; Extend the region (BEG END) to deal with any complicating literals. (let* ((lit-search-beg (if (memq (char-before beg) '(?/ ?*)) (1- beg) beg)) @@ -7246,7 +7246,8 @@ (c-put-char-properties beg end 'syntax-table '(1)) ;; If an open string's opener has just been neutralized, ;; do the same to the terminating LF. - (when (and end-literal-end + (when (and (> end beg) + end-literal-end (eq (char-before end-literal-end) ?\n) (equal (c-get-char-property (1- end-literal-end) 'syntax-table) -- Alan Mackenzie (Nuremberg, Germany).