Subject: Re: bug#36492: c-mode fails with errors during fontification

From: Noam Postavsky <[email-masked]>
Date: Mon, 08 Jul 2019 17:58:50 -0400

Juri Linkov <[email-masked]> writes:

>> Rather than ignore-errors, perhaps using with-demoted-errors would
>> still let the errors be noticed without too much inconvenience?
>
> I tried this change:
>
>  	  (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.

Right, if you have debug-on-error set, with-demoted-errors won't stop
the debugger.  But you should be able to continue with 'c' as normal, or
if you don't have debug-on-error set, you only get a message.