Subject: Re: bug#14886: Fwd: bug#14886: Fwd: A significant slowdown calling font-lock-fontify-buffer from a hook

From: Stefan Monnier <[email-masked]>
Date: Wed, 24 Jul 2013 21:24:37 -0400

> - Font-lock-fontify-buffer should not be called from a hook.

Font-lock-fontify-buffer is definitely a bad function, since it has
2 different meanings (either "make sure the buffer is fontified" or
"please refontify the buffer").  It should be replaced by two different
functions:
- font-lock-ensure-fontification, which makes sure fontification is
  applied to a particular region (e.g. for use by things like
  htmlfontify or ps-print).
- font-lock-flush-fontification which indicates that the fontification
  for a particular region should be considered out-of-date (e.g. for use
  after calling font-lock-add/remove-keywords).
I don't see why any of those 3 functions shouldn't be called from
a hook, tho.
  
> - Errors during fontification should be visible.  That would have made
> clear that there was something wrong with the 24.3 use case.

Silent errors are bugs.  Please try and find what happens with
the error message.

        Stefan