unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>, 36492@debbugs.gnu.org
Subject: bug#36492: c-mode fails with errors during fontification
Date: Tue, 09 Jul 2019 00:46:10 +0300	[thread overview]
Message-ID: <877e8s19p9.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAM-tV-9YFvjbbhws4oZWegpui3hKC1k=cWTDTyB9EKFP1hbjmQ@mail.gmail.com> (Noam Postavsky's message of "Mon, 8 Jul 2019 09:16:56 -0400")

>> > 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.





  reply	other threads:[~2019-07-08 21:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 20:56 bug#36492: c-mode fails with errors during fontification Juri Linkov
2019-07-04 20:08 ` Juri Linkov
     [not found] ` <mailman.154.1562272763.2688.bug-gnu-emacs@gnu.org>
2019-07-04 21:19   ` Alan Mackenzie
2019-07-06 14:27   ` Alan Mackenzie
2019-07-07 21:52     ` Juri Linkov
2019-07-08 12:53       ` Alan Mackenzie
2019-07-08 13:16         ` Noam Postavsky
2019-07-08 21:46           ` Juri Linkov [this message]
2019-07-08 21:58             ` Noam Postavsky
2019-07-08 13:47         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877e8s19p9.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=36492@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).