GNU bug report logs - #36492
c-mode fails with errors during fontification

Previous Next

Packages: cc-mode, emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 3 Jul 2019 20:58:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in versions 27.0.50, 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 36492 <at> debbugs.gnu.org
Subject: bug#36492: c-mode fails with errors during fontification
Date: Tue, 09 Jul 2019 00:46:10 +0300
>> > 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).
>
> Rather than ignore-errors, perhaps using with-demoted-errors would
> still let the errors be noticed without too much inconvenience?

I tried this change:

diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 6ffa1fc168..c833f2ed01 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -500,7 +500,7 @@ mm-display-inline-fontify
 	      (setq mode major-mode)))
 	  ;; Do not fontify if the guess mode is fundamental.
 	  (unless (eq major-mode 'fundamental-mode)
-	    (font-lock-ensure))))
+	    (with-demoted-errors (font-lock-ensure)))))
       (setq text (buffer-string))
       (when (eq mode 'diff-mode)
 	(setq ovs (mapcar (lambda (ov) (list ov (overlay-start ov)

But it pops up the same error backtrace buffer.




This bug report was last modified 5 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.