From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#36492: c-mode fails with errors during fontification Date: Mon, 8 Jul 2019 12:53:32 +0000 Message-ID: <20190708125332.GA5244@ACM> References: <20190706142748.85417.qmail@mail.muc.de> <871rz15xp1.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240801"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 36492-done@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 15:02:01 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkTHG-0010DF-QA for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 15:01:54 +0200 Original-Received: from localhost ([::1]:41466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkT9o-0002V4-Tx for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 08:54:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43559) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkT9k-0002US-CG for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 08:54:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkT9j-0000JD-AD for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 08:54:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkT9e-0000FF-AW; Mon, 08 Jul 2019 08:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkT9e-00055r-6g; Mon, 08 Jul 2019 08:54:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 08 Jul 2019 12:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 36492 X-GNU-PR-Package: emacs,cc-mode Mail-Followup-To: 36492@debbugs.gnu.org, acm@muc.de, juri@linkov.net Original-Received: via spool by 36492-done@debbugs.gnu.org id=D36492.156259042919556 (code D ref 36492); Mon, 08 Jul 2019 12:54:01 +0000 Original-Received: (at 36492-done) by debbugs.gnu.org; 8 Jul 2019 12:53:49 +0000 Original-Received: from localhost ([127.0.0.1]:58026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkT9Q-00055M-Qf for submit@debbugs.gnu.org; Mon, 08 Jul 2019 08:53:49 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51629 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hkT9O-00055C-9g for 36492-done@debbugs.gnu.org; Mon, 08 Jul 2019 08:53:47 -0400 Original-Received: (qmail 22265 invoked by uid 3782); 8 Jul 2019 12:53:33 -0000 Original-Received: from acm.muc.de (p4FE15FEC.dip0.t-ipconnect.de [79.225.95.236]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 08 Jul 2019 14:53:32 +0200 Original-Received: (qmail 5251 invoked by uid 1000); 8 Jul 2019 12:53:32 -0000 Content-Disposition: inline In-Reply-To: <871rz15xp1.fsf@mail.linkov.net> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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: 209.51.188.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:162326 Archived-At: Hello, Juri. On Mon, Jul 08, 2019 at 00:52:02 +0300, Juri Linkov wrote: > >>> Opening this message in Gnus fails with the following backtrace > >>> because c-mode fails to fontify the attachment. > >> Actually, with the attachment in this message the bug in c-mode > >> font-lock is much easier to reproduce. > > That is one ugly piece of erroneous C. ;-) > > What triggers the bug is the ) without a preceding (. A variable > > recording the position of the opening ( is still set to nil, and we > > tried to use it in the given buffer with the unbalanced ). > >> [-- text/x-csrc, encoding 7bit, charset: US-ASCII, 3 lines, name: test.c --] > > The following patch fixes it, I hope. Would you please do the usual, > > and confirm that it does indeed fix the bug (or tell me what's still > > wrong). > Thanks, Alan. Now there is no error anymore. Thanks. I've committed the fix, and I'm closing the bug. > I wonder if ignore-errors around font-lock-ensure in mm-display-inline-fontify > is still necessary to ensure no more bugs in other modes disrupt Gnus > by erroneous code in attachments? Or maybe raising such errors will help > to find fontification bugs sooner? My feeling is that it's better to let the errors happen, so that we can debug them. But on the other hand, it's not me that gets inconvenienced by such an error (I don't use gnus). -- Alan Mackenzie (Nuremberg, Germany).